OFFSET
2,1
EXAMPLE
n=100: a(100) = 8 because n=100 == 2 mod 8, n^2=100000 == 0 mod 8 and 8 is the least m such that 100 > 100000 mod m.
MATHEMATICA
s={}; Do[n1=n; n2=n^2; Do[If[Mod[n1, m]>Mod[n2, m], AppendTo[s, {n, n1, n2, m}]; Break[]], {m, 2, 200}], {n, 2, 120}]; Last/@s
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Aug 31 2006
STATUS
approved