OFFSET
1,1
COMMENTS
Apparently a(n>2)=A070667(n). Note the linear patterns in the graph.
REFERENCES
Dorin Andrica, Vlad Crişan, The smallest nontrivial solution to x^k == 1 (mod n) ..., Amer. Math. Monthly 126 (2019), 173-178.
LINKS
Zak Seidov, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = sqrt(1+n*A076942(n)).
EXAMPLE
a(1)=2, k=3; a(2)=3, k=4; a(3)=2, k=1; a(1000)=249, k=62.
MATHEMATICA
Flatten[{2, Table[Select[Range[2, 1000], PowerMod[#, 2, k]==1&, 1], {k, 2, 1000}]}] (*first 1000 terms*)
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Aug 19 2012
STATUS
approved