login
Number of solutions to (x+1)^p - x^p == 1 (mod p^2) in the range 1 <= x <= p - 2, p = prime(n).
3

%I #18 Mar 19 2024 13:45:29

%S 0,0,0,2,0,2,0,2,0,0,2,2,0,2,0,0,12,2,2,0,2,8,6,0,2,0,2,0,2,0,2,0,0,2,

%T 0,2,2,2,0,0,6,2,0,8,0,2,2,2,6,2,0,0,2,0,0,0,0,2,2,0,2,0,2,0,2,0,2,8,

%U 0,2,0,0,2,2,2,0,0,2,0,2,6,8,0,2,2,6,0

%N Number of solutions to (x+1)^p - x^p == 1 (mod p^2) in the range 1 <= x <= p - 2, p = prime(n).

%C For primes p > 2, (x+1)^p - x^p == 1 (mod p^2) has trivial solutions x == 0, -1 (mod p) so they are excluded.

%C Equivalently, a(n) is the number of solutions to x^(p-1) == (x+1)^(p-1) == 1 (mod p^2) in the range 1 <= x <= p^2 - 2, p = prime(n), that is, number of x such that both x and x + 1 occurs in the n-th row of A143548.

%C All terms shown here are even. The first odd terms are a(183) = 17 and a(490) = 5, with corresponding primes prime(183) = 1093 and prime(490) = 3511. a(n) is odd iff prime(n) is in A001220.

%C Let g be a primitive root modulo p^2, then (x+1)^p - x^p == 1 (mod p^2) has nontrivial solutions x == g^((p-1)/3) or g^(2*(p-1)/3) (mod p), and x^(p-1) == (x+1)^(p-1) == 1 (mod p^2) has nontrivial solutions x == g^(p*(p-1)/3) or g^(2*p*(p-1)/3) (mod p^2). As a result, if prime(n) == 1 (mod 6) then a(n) > 0. Primes p == 5 (mod 6) such that the equations have nontrivial solutions are listed in A068209.

%C a(17) = 12 is surprisingly large comparing with its nearby terms. Among the first 1000 terms there are only 7 that are larger than 12. They are a(183) = 17 and a(385) = a(552) = a(582) = a(593) = a(739) = a(922) = 14 (the corresponding primes are 1093, 2659, 4003, 4243, 4339, 5623 and 7213).

%H Robert Israel, <a href="/A320535/b320535.txt">Table of n, a(n) for n = 1..2500</a>

%e The nontrivial solutions to (x+1)^7 - x^7 == 1 (mod 49) are x == 2, 4 (mod 7); the solutions to x^6 == (x+1)^6 == 1 (mod 49) are x == 18, 30 (mod 49), so a(4) = 2.

%p f:= proc(n) local p; p:= ithprime(n);

%p nops(select(t -> (t+1)^p - t^p mod p^2 = 1, [$1 .. p - 2]))

%p end proc:

%p map(f, [$1..100]); # _Robert Israel_, Mar 18 2024

%o (PARI) a(n) = my(p=prime(n)); sum(x=1, p-2, Mod(x+1, p^2)^p-Mod(x, p^2)^p==1);

%Y Cf. A001220, A068209, A143548.

%K nonn

%O 1,4

%A _Jianing Song_, Oct 15 2018

%E Name corrected by _Robert Israel_, Mar 18 2024