OFFSET
1,3
COMMENTS
If n has a primitive root (i.e. if n is in A033948(n)) then a(n)=n-1, if not (i.e. if n is in A033949(n)), a(n)<n-1. E.g.: if n is of the form 4*A000961(m), then a(n)=n/2-1. Questions : for which n does the equation A070667(x)=x-n have at least one solution, does always A070667(x)=x-p have at least one solution when p is prime =>5? - Benoit Cloitre, May 12 2002
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
MAPLE
a:= proc(n) local k; for k from 2 do if 1=k*k mod n
then return k elif k>=n then return 1 fi od
end:
seq(a(n), n=1..100); # Alois P. Heinz, Oct 30 2016
MATHEMATICA
Join[{1, 1}, Flatten[Table[Select[Range[2, n-1], PowerMod[#, 2, n]==1&, 1], {n, 70}]]] (* Harvey P. Dale, May 01 2012 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, May 08 2002
STATUS
approved