OFFSET
1,5
COMMENTS
It seems that the size of a(n) as compared to its surrounding elements is dependent on whether or not n is in A088232. If n is in A088232 the sequence assumes "big" values, otherwise the values will be "small". - Stefan Steinerberger, Nov 24 2007
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = Card{p = k^3 mod n, for primes p and for all integers k}.
EXAMPLE
a(10) = 4 because the cubes mod 10 repeat 0, 1, 8, 7, 4, 5, 6, 3, 2, 9, 0, 1, 8, 7, 4, 5, ... of which the 4 distinct primes are {2, 3, 5, 7}.
MAPLE
f:= proc(n)
if numtheory:-phi(n) mod 3 = 0 then nops(select(isprime, {seq(i^3 mod n, i=0..n-1)}))
else numtheory:-pi(n-1) - nops(select(t -> t[2]>1, ifactors(n)[2]))
fi
end proc:
map(f, [$1..100]); # Robert Israel, Jun 28 2018
MATHEMATICA
Table[Length[Select[Union[Table[Mod[i^3, n], {i, 0, n}], Table[Mod[i^3, n], {i, 0, n}]], PrimeQ[ # ] &]], {n, 1, 70}] (* Stefan Steinerberger, Nov 12 2007 *)
CROSSREFS
KEYWORD
AUTHOR
Jonathan Vos Post, Nov 07 2007
EXTENSIONS
More terms from Stefan Steinerberger, Nov 12 2007
Spelling/notation corrections by Charles R Greathouse IV, Mar 18 2010
STATUS
approved