OFFSET
1,3
COMMENTS
a(n) has the following properties :
If n is a power of 2 then a(n)= 1 ;
Except for n = 9 where a(9)=9, if a(n) is the square of a prime p, the sequence shows that n is of the form n = 2p.
The numbers m such that a(m) are square are : 1, 2, 4, 8, 9, 10, 16, 26, 32, 34, 58, 64, 74, 81, ...
LINKS
Zak Seidov, Table of n, a(n) for n = 1..1000
EXAMPLE
a(10) = 25 because the residues (mod 10) of x^10 are 0, 1, 4, 5, 6, 9 and the sum 25 is a square => a(10) = a(2*5)= 5^2.
MAPLE
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 proc:
for n from 1 to 100 do
printf("%d, ", sumDistRes(n));
end do: # (Program of R. J. Mathar - see A196546)
MATHEMATICA
Table[{m, Total[Union[Table[PowerMod[x, m, m], {x, m-1}]]]}, {m, 1000}] (* Zak Seidov, Oct 06 2011 *)
PROG
(PARI) a(n) = vecsum(Set(vector(n, k, lift(Mod(k-1, n)^n)))); \\ Michel Marcus, Jun 01 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Oct 05 2011
STATUS
approved