OFFSET
1,5
COMMENTS
Indices of nonzero terms are listed in A126949 (in this sense the present sequence can be seen as characteristic function of A126949), indices of zeros (except for n=1) are given in A178751. Without the restriction x < n-1, one would have a(n) = n-1 instead of the zeros, since (n-1)^3 = (-1)^3 = -1 (mod n) for all n.
PROG
(PARI) A274021(n)={for(x=2, n-2, gcd(x, n)>1&&next; my(t=Mod(x, n)); while(abs(centerlift(t))>1, t*=x); t==-1&&return(x))}
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Jun 07 2016
STATUS
approved