Find the greatest common divisor of the numbers \[ 2^{561}-2, 3^{561}-3, \ldots, 561^{561}-561.\]
Problem
Source: Romanian TST 1 2008, Problem 5
Tags: number theory, greatest common divisor, modular arithmetic, algebra, polynomial, number theory unsolved
02.05.2008 00:53
We shall prove that the answer is $d = \prod_{(p-1) \mid 560} p = 2\cdot 3 \cdot 5 \cdot 11 \cdot 13 \cdot 17 \cdot 29 \cdot 41 \cdot 71 \cdot 281$. First of all, since $d\mid a(a^{560}-1)$, for $a = 2,\ldots,561$, it is clear that if $p\mid d$, and $p<561$, then $d\neq 0 \pmod {p^2}$. So let's try to first determine the prime divisors of $d$ (the common gcd of all the numbers) smaller than 561. Let $p$ be such a prime divisor. Let $a$ be a primitive root of $p$. Then $a^{560}\equiv 1 \pmod p$, so because $a$ is a primitive root, $p-1 \mid 560$. It is easy to check that if $p-1 \mid 560$, then $a^{560}\equiv 1$, so $p\mid d$. That explains the above result. Now let's suppose $d$ has a prime divisor greater than 561. Then consider the polynomial $f(x) = x^{560}-1$ in the field $\mathbb Z/p \mathbb Z$. This polynomial has 560 distinct roots, therefore it must be equal to $(x-2)(x-3)\cdots (x-561)$. Identifying coefficients, we need \[ \dfrac {561 \cdot 562 } 2 -1 \equiv 0 \pmod p \ \Rightarrow 561 \cdot 561 \cdot 281 \equiv 1 \pmod p,\]or \[ p \mid 2^5 \cdot 5 \cdot 7 \cdot 563.\]Therefore $p = 563$. However in this case $2^{562} \equiv 1 \pmod {563}$, therefore $2^{561}\equiv 282 \neq 2\pmod{563}$, and we are done.
02.05.2008 00:55
Note that while this might seem connected to this PEN problem, it is actually not that much. Also 561 being a Carmichael number doesn't help us here at all.
02.05.2008 05:21
What's with this 561? Are we celebrating something I'm not aware of? (maybe this: http://en.wikipedia.org/wiki/Huniade_Castle ) 2008 or even n would probably be better choices than 561, at least less confusing, and involving less computations. If p divides all those numbers, 0,1,...,n are roots of $ X^n - X$ mod p, so at least two of them have to be equal, which gives $ p\leq n$. It is then clear that no p can have multiplicity greater than one in the gcd, and it's also clear that p is a factor of the gcd iff $ X^p - X|X^n - X$ in $ \mathbb{Z}/p$ iff $ p - 1|n - 1$.
02.05.2008 10:46
Valentin Vornicu wrote: First of all, since $ d\mid a(a^{560} - 1)$, for $ a = 2,\ldots,561$, it is clear that if $ p\mid d$, and $ p < 561$, then $ d\neq 0 \pmod {p^2}$. Why is this true?
02.05.2008 12:00
Well take $ a=p$ since $ p<561$ $ d\mid p(p^{560}-1)$ and we're done.
02.05.2008 12:02
O, thank you.
02.05.2008 12:03
Here's a topic slightly connected with this one for those interested: http://www.mathlinks.ro/viewtopic.php?t=181757
14.07.2008 07:16
What's the mean of $ \mathbb Z/p \mathbb Z$? Thanks
14.07.2008 19:57
So, I'll generalize the problem: for $ n > 1$, \[ D_n : = \gcd\left(1^n - 1,2^n - 2,\dots,n^n - n\right) = \prod\limits_{p \textrm{ prime} \atop p - 1 \mid n - 1} p \,. \] To show that $ p \leq n$ implies $ p - 1 \mid n - 1$ is just like what Valentin Vornicu did. Also, the proof that $ p > n$ then $ p \nmid D_n$ is also similar to his proof, as follows: Suppose $ p > n$ and $ p \mid D_n$. Thus, the polynomial $ x^{n - 1} - 1$ has $ n$ roots in $ \mathbb{F}_p$, which are $ 1$, $ 2$, ..., $ n - 1$, and $ n$. This cannot happen since the degree of the polynomial is $ n - 1$. This proves the assertion. One more question: What would $ D^\prime_n : = \gcd\left(1^n - 1,2^n - 2,\dots,(n - 1)^n - (n - 1)\right)$, $ n > 2$, be? Answer: $ D^\prime_n = D_n$ if $ n > 2$. To show that a prime $ p \leq n - 1$ divides $ D^\prime_n$ implies $ p - 1 \mid n - 1$ is identical to the earlier work. Now, if $ n$ is a prime, then $ n$ divides $ D^\prime_n$ and $ n$ also occurs in the factorization of $ D_n$ (for $ n - 1 \mid n - 1$). Consequently, $ D^\prime_n$ is divisible by $ D_n$. Suppose that there exists a prime $ p > n$ such that $ p \mid D^\prime_n$. Thus, the polynomial $ x^{n - 1} - 1$ has $ n$ roots in $ \mathbb{F}_p$, which are $ 1$, $ 2$, ..., $ n - 2$, and $ n - 1$. Thus, $ x^{n - 1} - 1 = (x - 1)(x - 2)\cdots\left(x - (n - 1)\right)$. Therefore, the coefficient of $ x^{n - 2}$ is $ 0 = -1 - 2 - \dots - (n - 1)$ in $ \mathbb{F}_p$. Hence, $ \frac {n(n - 1)}{2} = 0$ in $ \mathbb{F}_p$. This implies that $ p \leq n$, which is a contradiction.
12.09.2012 15:05
Showing for all $n$ instead of $561$ .Let $p$ be a prime dividing all these numbers. If $p > n$, then $p|i^{n-1}-1$ for all $0<i<n+1$. Hence $1,2,....n$ are roots for the polynomial $x^{n-1}-1$ in $Z_p[x]$, therefore $x^{n - 1} - 1$ has $n$ roots in $Z_p$, which should imply this is the null polynomial, absurd. If $p\leq n$, then $p|i^n-i$ for all $0<i<n+1$ it follows that $p|a^{n - 1} - 1,$ where $a$ in ${I, 2,...,p - 1}$, hence $1, 2,.....,p-1$ are roots for the polynomial $x^{n - 1} - 1$ in $Z_p[x]$. But they are also the roots of the polynomial $x^{p - 1} - 1$, from Fermat's Theorem. Therefore, $x^{p - 1} - 1|x^{n - 1} - 1$, whence $p - 1|n - 1,$ since for $n - 1 = q(p - 1) + r$, with $0 <r < p - 1$, we have $x^{n - l} - 1 = x^r(x^{q(p-1)} - 1) + (x^r - 1)$, so $x^ {p - l} - 1 |x^r-1 - 1,$ ,So finally $r=0$ Conversely, for $p - 1|n - 1,$ it follows from Fermat's Theorem that $p|a^n - a$ for all $a$, hence $p$ divides all the numbers in the statement. Finally, since $p^2$ does not divide $p(p^{n-l} - 1)$, so $p^2$ cannot divide all numbers of the statement. Hence $gcd=\prod_{p-1|n-1} p$ as we got $gcd$ is square free.
12.09.2012 16:07
The reason $561 = 3\cdot 11\cdot 17$ has been chosen is because its factors are in the list of prime factors of that $\gcd$, meaning it divides all those terms; so solving this problem has as a byproduct the proof that $561$ is a Carmichael number
17.06.2015 15:45
My solution: Lemma: if $n\mid m$ if and if only $x^n-1\mid x^m-1$(it's well known) Let $d=\text{gcd}(2^{561}-2,3^{561}-3,\cdots ,561^{561}-561)$ consider two cases let $p$ be a prime number such that $p\mid d$ now consider two cases: 1)$p>561$ then $p\mid i^{560}-1$ for every $1\le i\le 561$ it mean's that polynomial $x^{560}-1$ has $561$ roots modulo $p$ which is absurd. 2)$p\le 561$ then p\mid $i^{560}-1$ for $1\le i\le p-1$ it means that $x^{560}-1$ has the roots $1,2,\cdots ,p-1$ modulo $p$ also they are the roots of $x^{p-1}-1$(remind ferma's theorem!!) so $x^{p-1}-1\mid x^{560}-1$ by converse of the lemma $p-1\mid 560$ since $p^2\nmid p^{561}-p$ number $d$ is equal to product of the prime numbers like $p$ such that $p-1\mid 560$ after checking we get that $d=2.3.5.11.17.29.41.71.113.281$ DONE
25.08.2021 19:39
Let's generalize We claim that $ D_n \stackrel{\text{def}}{=} \gcd\left(2^n - 2,\dots,n^n - n\right) = \prod\limits_{p \textrm{ prime} \atop p - 1 \mid n - 1} p \,. $ Now Claim: $p<n$ Proof: Consider the congruence $X^n \equiv (X-1)(X-2)(X-3)(X-4)........(X-n)$ in $[F_\mathbf{p}]$ By Lagrange's theorem,it has pairwise distinct solutions $X=1,2,3,4,5,.......,n$ in $[F_\mathbf{p}]$ which isn't possible,since if we choose a prime $P$ which is $\lfloor{\frac{n}{2}}\rfloor<P<2 \lfloor{\frac{n}{2}}\rfloor$ which divides only two terms so it can't divide $D_n$ which is a contradiction to the first line. Now since $p|a^n-a$ i.e $a^{n-1} \equiv 1 \pmod p$ for all $a$,so $p-1|n-1$(Corollary of Lagrange's theorem),proving the claim.
24.07.2023 06:38
quick little generalization Claim: For some positive integer $n$, we have $$\gcd(2^n-2,3^n-3,\cdots,n^n-n)=\prod_{p-1\mid d-1}p.$$Proof: Let $d=\gcd(2^n-2,3^n-3,\cdots,n^n-n)$ be our desired common factor, and let $p$ be some prime factor of $d$. We first prove that $p\le n$; suppose by contradiction that $p>n.$ As $p\mid d=\gcd(2^n-2,3^n-3,\cdots,n^n-n)$, we have that $p\mid k^n-k=k(k^{n-1}-1)$ for all $k\in\{2,3,\cdots,n\}.$ Thus, either $p\mid k$ or $p\mid k^{n-1}-1$ since $p$ is prime. If $p\mid k$, then $p\le k\le n$, a contradiction. Hence, we must have $p\mid k^{n-1}-1$ for all such $k,$ implying that $k^{n-1}\equiv1\pmod{p}.$ It follows that the polynomial $P(X)=X^{n-1}-1$ has roots $2,3,\cdots,n$ modulo $p$; since $P$ is monic and of degree $k$, we deduce that $$X^{n-1}-1\equiv(X-2)(X-3)\cdots(X-n)\pmod{p}.$$Applying Vieta's Formulas on the coefficient of the $n-2$th degree monomial gives \begin{align*} 0&\equiv2+3+\cdots+n\pmod{p}\\ &\equiv(1+2+\cdots+n)-1\pmod{p}\\ &\equiv\frac{(n+2)(n-1)}2\pmod{p}. \end{align*}Thus $p\mid (n+2)(n-1)$, so either $p\mid n+2$ or $p\mid n-1.$ Since we assumed that $p>n$, we cannot have $p\le n-1$ or $p\le\frac{n+2}2,$ forcing the equality $p=n+2.$ As a result, it follows that $$2^{n-1}\equiv1\pmod{n+2},$$or $$2^{n+1}\equiv 4\pmod{n+2}.$$Using Fermat's Little Theorem on $n+2=p$, the above becomes $1\equiv4\pmod{n+2}$, so that $n+2\mid 4-1=3$, giving $n=3-2=1$, in which case $d=\gcd(2-2,3-3,\cdots,n-n)=\gcd(0,0,\cdots,0)$, which is clearly absurd. Thus we may assume that $p\le n$ for all nontrivial $n\ge2.$ Since $p$ is prime, let $a$ be a primitive root modulo $p$. Then $1<a<p\le n$, implying that $p\mid d\mid a^n-a,$ so that $$a^n\equiv a\pmod{p}.$$Since $p$ is prime and $a<p$, we find that $a\nmid p$ and thus $$a^{n-1}\equiv1\pmod{p}.$$Due to a well-known property of orders, this implies by primitive roots that $p-1=\text{ord}_p(a)\mid n-1.$ Thus any prime factor of $d$ must be $1$ modulo $n-1.$ We show that $\nu_p(d)=1$ for such $p.$ First note that $p-1\mid n-1$, implying that $m=\frac{n-1}{k-1}\in\mathbb{Z}.$ Then Fermat's Little Theorem gives \begin{align*} k^n-k&\equiv k(k^{n-1}-1)\pmod{p}\\ &\equiv k((k^m)^{k-1}-1)\pmod{p}\\ &\equiv k(1-1)\pmod{p}\\ &\equiv0\pmod{p}, \end{align*}so our construction of $p$ works, giving $\nu_p(d)\ge1$ for all primes $p$ such that $p-1\mid n-1.$ It remains to prove that $\nu_p(d)<2.$ Note that $p\nmid p^{n-1}-1$ implies that $p^2\nmid p^n-p$. As a result, we conclude that $\nu_p(p^n-p)=1$; since $p\le n$, we have $p\in\{2,3,\cdots,n\}.$ Thus, using a well-known property of the $p$-adic numbers, we get \begin{align*} \nu_p(d)&=\min(\nu_p(2^n-2),\nu_p(3^n-3),\cdots,\nu_p(n^n-n))\\ &\le\nu_p(p^n-p)\\ &=1. \end{align*}Combining this with the fact that $\nu_p(d)\ge1$ for such $p$, it follows that $\nu_p(d)=1$. We therefore conclude that $\nu_p(d)=1$ for all primes $p-1\mid n-1$ and $\nu_p(d)=0$ otherwise. Hence $$d=\prod_{p-1\mid d-1}p.$$$\blacksquare$