OFFSET
1,2
COMMENTS
Conjecture: |{k^(k+1)+(k+1)^k (mod p): k = 0..p-1}| = (1-1/e)*p + O(p^(1/2)), where p denotes a prime.
LINKS
Robert Israel, Table of n, a(n) for n = 1..5000
Zhi-Wei Sun, Is it true that |{k^(k+1)+(k+1)^k (mod p): k = 0..p-1}| = (1-e^(-1))*p + O(sqrt(p))? Question 350784 at MathOverflow, Jan. 20, 2020.
EXAMPLE
a(2) = 3 since {0^1+1^0, 1^2+2^1, 2^3+3^2} = {1, 3, 17} is a complete system of residues modulo the second prime 3.
MAPLE
f:= proc(p) local S, k;
nops({seq(k &^ (k+1) + (k+1) &^ k mod p, k=0..p-1)})
end proc:
seq(f(ithprime(i)), i=1..100); # Robert Israel, Jan 22 2020
MATHEMATICA
p[n_]:=p[n]=Prime[n];
a[n_]:=a[n]=Length[Union[Table[Mod[PowerMod[k, k+1, p[n]]+PowerMod[k+1, k, p[n]], p[n]], {k, 0, p[n]-1}]]];
Table[a[n], {n, 1, 70}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Jan 19 2020
STATUS
approved