OFFSET
1,1
EXAMPLE
a(100) = 7 because prime(100) = 541 == 2 mod 7, prime(101) = 547 == 1 mod 7 and 7 is least m such that 541 > 547 mod m.
MATHEMATICA
s={}; Do[pn=Prime[n]; pn1=Prime[n+1]; Do[If[Mod[pn, m]>Mod[pn1, m], AppendTo[s, {n, pn, pn1, m}]; Break[]], {m, 2, 200}], {n, 1, 130}]; Last/@s
lm[n_]:=Module[{m=2, pn0=Prime[n], pn1=Prime[n+1]}, While[Mod[pn0, m]<= Mod[ pn1, m], m++]; m]; Array[lm, 110] (* Harvey P. Dale, May 27 2014 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Aug 31 2006
STATUS
approved