login
A121890
Least m such that (n mod m) > (n^2 mod m).
0
3, 4, 5, 3, 4, 4, 3, 5, 4, 3, 7, 7, 3, 4, 9, 3, 4, 4, 3, 8, 4, 3, 5, 7, 3, 4, 8, 3, 4, 4, 3, 7, 4, 3, 8, 8, 3, 4, 7, 3, 4, 4, 3, 7, 4, 3, 7, 5, 3, 4, 7, 3, 4, 4, 3, 9, 4, 3, 7, 7, 3, 4, 5, 3, 4, 4, 3, 5, 4, 3, 11, 7, 3, 4, 7, 3, 4, 4, 3, 7, 4, 3, 5, 8, 3, 4, 7, 3, 4, 4, 3, 8, 4, 3, 7, 7, 3, 4, 8, 3, 4, 4, 3, 9, 4
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
Sequence in context: A165565 A033706 A354597 * A330740 A178231 A343262
KEYWORD
nonn
AUTHOR
Zak Seidov, Aug 31 2006
STATUS
approved