119

On my number theory exam yesterday, we had the following interesting problem related to Fermat's last theorem:

Suppose $p>2$ is a prime. Show that $x^p+y^p=z^p$ has a solution in $\mathbb{Z}_p^{\times}$ if and only if there exists an integer $a$ such that $p\not\mid a(a+1)$ and $$(a+1)^p=a^p+1\pmod{p^2}.$$ (I wil not show this here, it's a good exercise in Hensel's lemma)

Now I'm interested for which primes this last property holds true. This is what I found so far:

Proposition: for every prime $p\equiv 1\pmod{3}$ there exists an $a\in\mathbb{Z}$ such that $p\not\mid a(a+1)$ and $p^2\mid(a+1)^p-a^p-1$.
Sketch of proof: We will often use the fact that if $p\mid a-b$ then $p^2\mid a^p-b^p$ for $a,b,p\in\mathbb{Z}$. There exists some $n\in\mathbb{Z}$ such that $p \mid n^2+n+1$. We will show that we can take $a=n$ (it is clear that $p\not \mid n(n+1)$). If $n\equiv 1\pmod{p}$, we are done because $(n+1)^p\equiv 2\equiv n^p+1\pmod{p^2}$. So we may assume that the order of $n$ mod $p$ is 3.

We see that $n^{3p}\equiv 1\pmod{p^2}$, hence $p^2\mid \frac{n^{3p}-1}{n^p-1}=n^{2p}+n^p+1$ and therefore $(n+1)^p\equiv -n^{2p}\equiv n^p+1\pmod{p^2}$. $\blacksquare$

What can we say about primes $p\equiv 2\pmod{3}$? Say a prime is bad if it satisfies the above property. It is easy to see that for $p$ to be good we only have to check that for all $1\le a \le (p-1)/2$ we have $p^2\not\mid (a+1)^p-a^p-1$.
Numerical data suggests that infinitely many primes $p\equiv 2\pmod{3}$ are good and infinitely many are bad. I'd like to find a proof of this.
My numerical data furthermore suggests that there is no easy divisibility criterion to judge badness for primes, and that that there are a lot more good primes than bad ones, in terms of asymptotics.

I welcome all comments/ideas/references.


Edit: Here are some observations. I've listed the first bad primes, together with the set of$a\in\mathbb{Z}$ such that $1\le a \le (p-1)/2$ and $(a+1)^p\equiv a^p+1\pmod{p^2}$:

$59\qquad [3, 4, 11, 14, 15, 20] \\ 83\qquad [8, 30, 36] \\ 179\qquad [2, 59, 88] \\ 227\qquad [36, 82, 92] \\ 419\qquad[80, 110, 150] \\ 443\qquad [108, 125, 201] \\ 701\qquad [23, 61, 132, 146, 153, 252] \\ 857\qquad [6, 143, 244] \\ 887\qquad [20, 132, 168] \\ 911\qquad [14, 64, 242] \\ 929 \qquad[234, 253, 266] \\ 971 \qquad[9, 97, 108] \\ 977 \qquad[102, 182, 331] \\ 1091\qquad [64, 234, 358] \\ 1109 \qquad[176, 400, 523] \\ 1193\qquad [224, 227, 473] \\ 1217\qquad [186, 228, 410] \\ 1223\qquad [304, 349, 409] \\ 1259\qquad [19, 62, 264] \\ 1283\qquad [19, 134, 449] \\ 1289\qquad [412, 535, 593] \\ 1439\qquad [93, 199, 294] \\ 1487\qquad [167, 416, 649] \\ 1493 \qquad[141, 179, 367] \\ 1613 \qquad[227, 473, 739] \\ 1637 \qquad[76, 279, 574] \\ 1811 \qquad[39, 123, 498, 628, 691, 743] \\ 1847\qquad [172, 362, 698] \\ 1901\qquad [3, 475, 634] \\ 1997\qquad [125, 671, 840] \\ 2003 \qquad[31, 312, 840] \\ 2087 \qquad[31, 202, 586] \\ 2243 \qquad[252, 593, 1077] \\ 2423\qquad [353, 704, 857] \\ 2477\qquad [17, 688, 1020] \\ 2579 \qquad[294, 576, 693] \\ 2591 \qquad[322, 345, 368] \\ 2729\qquad [1024, 1049, 1089] \\ 2777\qquad [488, 1078, 1269] \\ 2969\qquad [341, 789, 1158] \\ 3089\qquad [677, 1015, 1053]\\ 3137\qquad [1227, 1308, 1427]\\ 3191\qquad [776, 916, 1383]\\ 3203\qquad [1214, 1305, 1587]\\ 3251\qquad [164, 337, 1260]$

I also found this sequence on OEIS, along with more numerical data, where it is claimed (but not proved) that the density of bad primes is roughly $\frac 16$.

My numerical data also suggests that the number of $a\in\mathbb{Z}$ satisfying $1\le a \le (p-1)/2$ and $p^2\mid (a+1)^p-a^p-1$ is always either $3$ or $6$, but I think that's rather a bold statement. (edit: indeed, 20123 is a counterexample with $9$ solutions, found by Michael Stocker. The weaker statement that the number of such solutions is divisible by $3$ is true, however: see here.)


Edit: Someone showed me these slides, where the above criterion for solvability of $x^p+y^p=z^p$ in the $p$-adic units is stated. (There is a remark that it can be proven with eisenstein reciprocity that for all non-Wieferich primes the first case of FLT holds true - maybe there is some way to use this for some (partial) result on our problem? I'm really curious.)

Tian Vlasic
  • 1,436
ArtW
  • 3,582
  • 4
    Very curious! $p=59$ is very bad in the sense that there are consecutive bad $a$s. For example $3^{59}+1\equiv4^{59}$ and $4^{59}+1\equiv5^{59}$ (both obviously modulo $59^2$). There are other such triples like $(3,4,5)$, but I guess the symmetries of the subgroup $(\Bbb{Z}_{59^2}^*)^{59}$ explain some of those. – Jyrki Lahtonen Jun 16 '16 at 10:24
  • 1
    @JyrkiLahtonen interesting observation! Maybe this is the unique very bad number: haven't found any others yet... – ArtW Jun 16 '16 at 12:36
  • 4
    Another way of looking at your proposition is to observe that as $6\mid (p-1)$, the cyclic group $G=\Bbb{Z}_{p^2}^*$ has a unique subgroup $H$ of order six. If $\omega\in H$ is of order three, then $$H={\pm1,\pm\omega,\pm\omega^2}.$$ As we have $\omega^2+\omega+1=0$ in the ring, we see that $\omega^2+1=-\omega$ so $H$ contains cosets of integers differing from each other by one. But, because $G$ is cyclic, all the elements of $H$ are $p$th powers in $G$. The conclusion of your proposition follows. – Jyrki Lahtonen Jun 16 '16 at 13:09
  • 2
    I observed that (vaguely related) fact when cooking up homework/exam problems about subgroups of $\Bbb{Z}_p^*$ of order six. It does not really shed additional light to your question. I just noticed that the argument can be extended to cover the prime powers as well, and felt like sharing. – Jyrki Lahtonen Jun 16 '16 at 13:12
  • 5
    "My numerical data also suggests that the number of a∈Z satisfying 1≤a≤(p−1)/2 and p2∣(a+1)p−ap−1 is always either 3 or 6, but I think that's rather a bold statement." this is false. I found 20123 [39, 516, 3515, 4069, 6293, 6539, 6616, 7010, 9406] – Michael Stocker Jun 21 '16 at 08:42
  • 1
    Thanks for the nice counterexample @MichaelStocker ! (I didn't check up that far). Maybe we can still conjecture instead this weaker statement that the number of such solutions is divisible by 3.. – ArtW Jun 21 '16 at 10:05
  • 8
    I just read in your link http://www.mathpages.com/home/kmath411.htm that the number of solutions is indeed a multiple of 3. Starting from "The reason that these roots occur in sets of 3 is easier to see if we consider the whole range of residues from 1 to p-2..." they offer a prove. – Michael Stocker Jun 21 '16 at 12:59
  • 2
    @ArtW Regarding Wieferich primes, I should think they are all bad since $a=1$ satisfies the condition (but both known examples are 1 mod 3). But since you have found many primes of both types, I presume Cohen's statement about the sufficiency of $a=1$ refers only to the truth of FLT1 as a global statement, rather than describing the $p$-adic feasibility. – Erick Wong Jun 21 '16 at 13:57
  • 1
    @ArtW, Is not this related to Germain theorem that states: If p is prime and $q=2p+1$ is also prime then equation ($x^p+y^p+z^p=0$ ) has no integer solution such that p does not divide x, y and z? – sirous Feb 24 '19 at 02:43
  • 5
    Not sure if this helps, but for $p\equiv 2\pmod{3}$, it seems like $$\frac{(x+1)^p-x^p-1}{px(x+1)(x^2+x+1)}\in\mathbb{Z}[x]$$ is irreducible – ArtW May 18 '21 at 15:55
  • 1
    Moreover upon reducing that last polynomial modulo p, all its roots in $\mathbb{F}_p$ seem to have multiplicity 2 – ArtW May 18 '21 at 16:02
  • 3
    apparently, the aforementioned polynomial is a particular case of a classically known Cauchy-Liouville-Mirimanoff polynomial, and its irreducibility seems to be open as of today. Reference: P. Tzermias, On Cauchy–Liouville–Mirimanoff Polynomials, Canad. Math. Bull. Vol. 50 (2), 2007 pp. 313–320 – ArtW May 18 '21 at 20:16
  • 2
    I know this is an old question and my comment is tangential to the main question, but I don't understand why you consider the case of $n \equiv 1 \pmod p$ in the case of $p \equiv 1 \pmod 3$. This does not actually occur and your proof of that seems to suggest $2^p \equiv 2 \pmod{p^2}$, which is not always true. – arbashn Jul 02 '21 at 16:24
  • 2
    @ArtW Do take a look at this, and a follow up. – Jyrki Lahtonen Jan 10 '23 at 10:33

1 Answers1

1

Generating solutions for Fermat's Last Theorem modulo $p^2$ for prime $59$:

Assume:

$$x^p=y^p+z^p$$ $$p \not \| xyz$$ $$gcd(x,y,z)=1$$ $$x^{p-1} \equiv y^{p-1} \equiv z^{p-1} \equiv 1 \pmod{p^2}$$

We generate solutions for:

$$(y+z)^p \equiv y^p+z^p \pmod{p^2}$$

Note:

$$\frac{x^{p+1}-y^{p+1}}{x-y} \equiv (p+1)y^p + a(x-y) \equiv x+y \pmod{p^2}$$ $$\frac{x^{p+1}-z^{p+1}}{x-z} \equiv (p+1)z^p + b(x-z) \equiv x+z \pmod{p^2}$$

$ \implies $

$$az \equiv x-py \pmod{p^2}$$ $$by \equiv x-pz \pmod{p^2}$$

$ \implies $

$$z(a-1) \equiv y(1-p) \pmod{p^2}$$ $$y(b-1) \equiv z(1-p) \pmod{p^2}$$ $$z(a-p) \equiv y(b-p) \equiv x(1-p) \equiv (y+z)(1-p) \pmod{p^2}$$

$ \implies $

$$(a-1)^{p-1} \equiv (b-1)^{p-1} \equiv (a-p)^{p-1} \equiv (b-p)^{p-1} \equiv 1+p \pmod{p^2}$$

Note:

$$(a-1)(b-1) \equiv (1-p)^2 \equiv 1-2p \pmod{p^2}$$

$ \implies $

$$ab \equiv a+b-2p \pmod{p^2}$$

To generate our solutions modulo 59^2 we first find solutions for $a$ in:

$$(a-1)^{p-1} \equiv (a-p)^{p-1} \equiv 1+p \pmod{59^2}$$

$$\{64,122, 1428,1491,1496,1549,1992,2045,2050,2113,3419,3477\}$$

For out exapmle we take $a=64$.

We find $b$ by calculating:

$$ab \equiv a+b-2p \pmod{p^2}$$

$$a=64$$ $$b=1491$$

We take $r=2$ in $x \equiv r^{59} \equiv 2^{59} \equiv 946 \pmod{p^2}$

We now use $a,b,x$ to solve $y,z$ in:

$$z(a-p) \equiv y(b-p) \equiv x(1-p) \pmod{p^2}$$

$$y \equiv 2869 \pmod{p^2}$$ $$z \equiv 1558 \pmod{p^2}$$

We now have $x,y,z$ with:

$$x^{p-1} \equiv y^{p-1} \equiv z^{p-1} \equiv 1 \pmod{p^2}$$

and:

$$x^p \equiv (y+z)^p \equiv y^p + z^p \equiv (2869 + 1558)^{59} \equiv 4427^{59} \equiv 2869^{59} + 1558^{59} \pmod{59^2}$$

Running $r$ through $1..58$ generates $58$ solutions.

Note:

$$\frac{\frac{x^{p+1}-y^{p+1}}{x-y} - (p+1)y^p}{x-y} \equiv \frac{\frac{946^{59}-2869^{59}}{946-2869}-60(2869)^{59}}{946-2869} \equiv a \equiv 64 \pmod{p^2}$$ $$\frac{\frac{x^{p+1}-z^{p+1}}{x-z} - (p+1)z^p}{x-z} \equiv \frac{\frac{946^{59}-1558^{59}}{946-1558}-60(1558)^{59}}{946-1558} \equiv b \equiv 1491 \pmod{p^2}$$