# The largest integer that divides $p^4-1$, in which p is a prime greater than $5$ [duplicate]

The question is to find the largest integer that divides all $p^4-1$, where p is a prime greater than 5. Being asked this question, I just assume this number exists. Set $p = 7$, then $p^4-1=2400$. I don't have any background in number theory and not sure what to do next. Thank you for your help!

## marked as duplicate by Carl Mummert, José Carlos Santos, Bill Dubuque number-theory StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Aug 14 '17 at 19:41

• in what context did you find the question ? – user451844 Aug 13 '17 at 1:21
• $2^4\cdot3\cdot5$ divides $(p-1)(p+1)(p^2+1)$ and is the gcd of $7^4-1$ and $11^4-1$ – uSir470888 Aug 13 '17 at 1:24
• @RoddyMacPhee GRE Sub Practice exam. Since no calculator is permitted, I really don't know how to solve this in a quick way. – Edward Wang Aug 13 '17 at 1:31
• what do we know about all primes greater than 3 ? that's a start. – user451844 Aug 13 '17 at 1:44
• I was pointing to the fact they are all 1 or 5 mod 6 so we know 6 is in the divisors of the number we want because the value of $p^4$ will be 1 mod 6 and subtracting 1 is 0 mod 6. add in fermat's little theorem and you get that it also is divisible by 5 so $5\cdot lcm(16,6)=240$ and that at least shows 240 is a minimum to the value. – user451844 Aug 13 '17 at 1:59

Let $n$ be the largest integer that divides $p^4-1$ for all prime $p\geq 7.$

We have $11^4-1=14640$ and $7^4-1=2400.$ The $gcd$ of $14640$ and $2400$ is $240.$ So $$n\leq 240.$$ If $p$ is odd then modulo $16$ we have $p^4\in \{(\pm 1)^4, (\pm 3)^4,(\pm 5)^4,(\pm 7)^4\}=\{1^2,9^2, 25^2, 49^2\}=\{1^2,9^2,9^2,1^2\}=$ $=\{1,81,81,1\}=\{1\}.$

If $p$ is not divisible by $3$ then modulo $3$ we have $p^4\in \{(\pm 1)^4\}=\{1\}.$

If $p$ is not divisible by $5$ then modulo $5$ we have $p^4\in \{(\pm 1)^4,(\pm 2)^4\}=\{1,16\}=\{1\}.$

So for any integer $p$ that is not divisible by $2,3,$ or $5$ we have $p^4\equiv 1 \pmod {16}$ and $p^4 \equiv 1 \pmod 3$ and $p^4 \equiv 1 \pmod 5;$ and since $16,3,$ and 5 are pair-wise co-prime, therefore $p^4\equiv 1 \pmod {16\cdot 3\cdot 5}=240,$ so $$n\geq 240.$$

Let $n$ be the number you are trying to find.

One of the main reasons to look at an example $p=7$ is to gain information about $n$. If $n$ divides all $p^4 - 1$, and $7^4 - 1 = 2400$, then $n$ divides $2400$.

Thus, you've gained information about $n$. Follow that up — what information does knowing that $n \mid 2400$ give you?

In my opinion, the next obvious things to do are to try the next few primes and gain more information about $n$.

My expectation is that will be enough to completely determine what $n$ ought to be, or at least narrow it down to a very small number of possibilities, at which point you can turn towards trying to prove that one of the possibilities is actually the value of $n$.

Since $p^4-1$ is relatively prime to $p$, we know that the common divisor will not have any large prime factors. Indeed, from your calculation, it will have to be a divisor of $2400=2^5*3*5^2$. However, you could make an even better guess by trying out a few more primes and then taking the greatest common divisor. However, that will get you a proof.

A reasonable thing to try is to factor the polynomial $p^4-1=(p^2+1)(p^2-1)=(p^2+1)(p+1)(p-1)$. There are various things you can see from this. For example, since $p$ is odd, $p\pm 1$ are both even, as is $p^2+1$, giving you at least three factors of $2$. Actually, one of $p\pm 1$ has to be multiple of $4$ (being two consecutive even numbers), and therefore you know that $16$ will divide $p^4-1$ for all odd $p$ (even if $p$ isn't prime). But you should gather more data to figure out exactly what you want to prove.