OFFSET
1,6
COMMENTS
if n = 2^m, a(n) = 1 ;
if n is odd, a(n) = 0 ;
if a(n) is prime > 2, then a(n) = n/2, for example a(10) = a(2*5) = 5 ;
There exists composite numbers k such that a(k)=k/2, for example a(44)= a(2*22)=22.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..16384
Antti Karttunen, Data supplement: n, a(n) computed for n = 1..65537
FORMULA
a(n) = A195812(n) (mod n).
EXAMPLE
a(10) = 5 because the residues (mod 10) of x^10 are 0, 1, 4, 5, 6, 9 and the sum 25 ==5 (mod 10).
MAPLE
with(numtheory):sumDistRes := proc(n) local re, x, r ; re := {} ; for x from 0 to n-1 do re := re union { modp(x^n, n) } ; end do: add(r, r=re) ; end : for n from 1 to 150 do ; z:=irem(sumDistRes(n), n) ; printf("%d, ", z); end do: #
PROG
(PARI) A196777(n) = (vecsum(Set(vector(n, k, lift(Mod(k-1, n)^n))))%n); \\ (After code in A195812) - Antti Karttunen, May 19 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Oct 06 2011
STATUS
approved