Does $(n^p-1)/(n-1)=m^2$ have any positive integer solutions for $p\ge 2$ prime

algebraic-number-theorydiophantine equationselementary-number-theorygalois-theorynumber theory

I was working on my partial answer to this question, which led me to consider the diophantine equation
$$
\frac{n^k-1}{n-1}=m^2
$$

with $k>1$ odd. It's not too hard to prove that if $(n,k)$ is a solution, then if $k$ is a perfect square, $(n,p^2)$ is a solution for all $p\mid k$, and otherwise $(n,p)$ is a solution for $p\mid k$ the largest prime factor of $k$ with $\operatorname{ord}_p(k)$ odd.

Therefore, it is natural to ask whether there are any solutions with $k=p$ prime.

I have absolutely no idea to start. Perhaps note that
$$(m^2)=\prod_{i=1}^{p-1}\left(n-\zeta_p^i\right)\subseteq\mathbb{Z}[\zeta_p],$$
and that all the ideals in this product are pairwise coprime. Therefore, they must all be squares of ideals in $\mathbb{Z}[\zeta_p]$. Also, if $q\mid m$ is prime, then $q\equiv 1\pmod p$ and the decomposition of $(q)$ in $\mathbb{Z}[\zeta_p]$ is
$$
(q) = \prod_{i=1}^{p-1}\left(q,n-\zeta_p^i\right),
$$

whence $\left(q,n-\zeta_p\right)^2\mid \left(n-\zeta_p\right)$. I have no idea to continue. Perhaps if the class group of $\mathbb{Q}(\zeta_p)/\mathbb{Q}$ has odd order, we can use that $(n-\zeta_p)$ must be the square of a principal ideal?


Descending solutions: Suppose $(n,k)$ is a solution and $p^2\mid k$ for some prime $p$, then
$$
\frac{n^k-1}{n^{k/p^2}-1}\cdot \frac{n^{k/p^2}-1}{n-1} = m^2.
$$

Let $q\mid n^{k/{p^2}}-1$ be prime, then $\frac{n^k-1}{n^{k/p^2}-1}=\sum_{j=0}^{p^2}(n^{k/p^2})^j\equiv p^2\pmod q$. Hence, the only prime that can possibly divide both $\frac{n^k-1}{n^{k/p^2}-1}$ and $\frac{n^{k/p^2}-1}{n-1}$ is $p$.

However, if $p$ divides both, let $t:=\operatorname{ord}_p(n^{k/p^2}-1)$ and let $g$ be a primitive root mod $p^{t+3}$. Write $n^{k/p^2}\equiv g^a\pmod {p^{t+3}}$, then $\operatorname{ord}_p(a)=t-1$, whence $\operatorname{ord}_p(p^2a)=t+1$, so $\operatorname{ord}_p(n^k-1)=t+2$. We conclude that $\frac{n^k-1}{n^{k/p^2}-1}$ and $\frac{n^{k/p^2}-1}{n-1}$ are both perfect squares.

In particular, $(n,k/p^2)$ is a solution. This way, we can remove the $p^2$ factors from $n$ one by one, until we're either left with an exponent which is itself a square of a prime (if $k$ is a perfect square) or with a square-free exponent.

Assume we end up with a solution $(n,k)$ with $k$ square-free. Let $p\mid k$ be the smallest prime factor of $k$. Note that the product of $(n^k-1)/(n^{k/p}-1)$ and $(n^{k/p}-1)/(n-1)$ is a perfect square, and that $p$ is the only prime that can possibly divide both. However, $(p-1,k/p)=1$, so if $p\mid n^{k/p}-1$ then $p\mid n-1$ and $p\nmid (n^{k/p}-1)/(n-1)$. Therefore, $(n^{k/p}-1)/(n-1)$ is a perfect square, and $(n,k/p)$ a new solution. This is how we can remove the primes from $k$ one by one, until only the largest remains.

Best Answer

The only solutions to $\frac{x^k-1}{x-1}=y^2$ correspond to the identities $$ \frac{3^5-1}{3-1}=11^2 \; \mbox{ and } \; \frac{7^4-1}{7-1}=20^2. $$ This was proved by Ljunggren in 1943 (the proof is in Norwegian which makes it arguably less accessible than desired). I'm embarrassed to admit that I haven't actually looked at the proof, but would suppose that it uses $p$-adic techniques along the lines of Skolem's method.

Related Question