login
A121889
Least m such that (prime(n) mod m) > (prime(n+1) mod m).
0
3, 4, 3, 5, 3, 5, 3, 5, 4, 3, 4, 5, 3, 5, 4, 7, 3, 7, 5, 3, 7, 5, 4, 3, 5, 3, 5, 3, 5, 3, 5, 4, 3, 4, 3, 4, 7, 5, 4, 7, 3, 7, 3, 5, 3, 5, 13, 5, 3, 5, 7, 3, 11, 4, 7, 4, 3, 4, 5, 3, 4, 3, 5, 3, 5, 3, 4, 11, 3, 5, 7, 3, 4, 7, 5, 4, 3, 5, 3, 11, 3, 11, 3, 7, 5, 4, 3, 5, 3, 5, 7, 3, 5, 3, 5, 4, 5, 3, 4, 7, 4, 7, 4
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
Sequence in context: A090739 A076400 A363194 * A332026 A205692 A342927
KEYWORD
nonn
AUTHOR
Zak Seidov, Aug 31 2006
STATUS
approved