# Prove that if $p$ is prime greater than $3$ ,then: $p^2+2015$ is multiple of $24$? [duplicate]

Prove that if $p$ is prime number $(p >3)$, then the number $p^2+2015$ is

multiple of $24$?

Thank you for any help

• No problem, thanks for thanking me :-) – Gregory Grant May 30 '15 at 14:38
• Do you have any specific $p$ in mind? – PyRulez May 30 '15 at 14:50
• only what i cited : p greater than 3 – zeraoulia rafik May 30 '15 at 14:52

All primes $p>3$ are of the form $6n\pm1$. But $$(6n\pm1)^2 +2015=12n(3n\pm1) +2016$$ is divisible by $24$ since one of $n$ and $3n\pm1$ is even, and $2016=84\cdot24$.

Note that $-1 \equiv 2015 \pmod{24}$. So you can consider $p^2 -1$ instead of $p^2 + 2015$. For help with this see for example Show that for any odd $n$ it follows that $n^2 \equiv 1 \mod 8$ and for uneven primes $p\neq 3$ we have $p^2 \equiv 1\mod 24$.

Hint: you can show first that it is a multiple of 8, then that it is a multiple of 3.

Other method: you calculate the equation modulo 24 and for $p$ use all numbers with $\gcd(p,24)=1$ and $0<p<24$

• That doesn't really rise to the level of an answer, you should probably have posted this as a comment. – Gregory Grant May 30 '15 at 14:39
• @GregoryGrant OP asks for help, and this gives some. – Mark Bennet May 30 '15 at 14:40
• @GregoryGrant should i give a full proof instead? – supinf May 30 '15 at 14:41
• @MarkBennet Sure, but help comes in two forms, comments and answers. This is a comment, as best as I can ascertain from the rules of the site – Gregory Grant May 30 '15 at 14:41
• @supinf I don't think it has to be a full proof, there is not really a clear line between what constitutes an answer and what constitutes a comment. But I left my comment before you made your first edit when it was just the first sentence. That definitely was too minimal to be a answer. – Gregory Grant May 30 '15 at 14:43

Hint: use the fact that $2016=84\times 24$ to say transform the question to whether $p^2+2016-1=2016+p^2-1$ is divisible by $24$.

Further hints follow, which suggest a slightly different route through which avoids dealing with cases.

Then any prime greater than $3$ is of the form $6n\pm1$ so that $p^2-1=36n^2\pm 12n=24n+12n(n\pm1)$

And we can then note:

Then $n(n\pm1)$ is the product of two successive integers, hence is even.