OFFSET
1,1
COMMENTS
Some values of m have multiple solutions.
For example, for m = 49, 25^25 == 26^26 (mod 49) and 37^37 == 38^38 (mod 49).
All terms are odd. - Robert Israel, Nov 25 2020
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
3 is a term because 1^1 == 2^2 (mod 3).
11 is a term because 8^8 == 9^9 (mod 11).
13 is a term because 8^8 == 9^9 (mod 13).
MAPLE
filter:= proc(n) local x, y, z;
y:= 1;
for x from 2 to n-1 do
z:= x &^ x mod n;
if z = y then return true fi;
y:= z
od;
false
end proc:
select(filter, [$2..1000]); # Robert Israel, Nov 25 2020
MATHEMATICA
seqQ[n_] := AnyTrue[Range[n - 1], PowerMod[#, #, n] == PowerMod[# + 1, # + 1, n] &]; Select[Range[240], seqQ] (* Amiram Eldar, Oct 28 2020 *)
PROG
(PARI) isok(m)=sum(i=1, m-1, Mod(i, m)^i == Mod((i+1), m)^(i+1)) \\ Andrew Howroyd, Oct 28 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Owen C. Keith, Oct 28 2020
STATUS
approved