[go: up one dir, main page]

login
A175118
a(1)=2. a(n) = the smallest prime p > a(n-1) such that p-a(n-1)+1 is composite.
3
2, 5, 13, 37, 61, 109, 157, 181, 229, 263, 271, 347, 367, 401, 409, 433, 457, 491, 499, 523, 547, 571, 619, 643, 677, 691, 739, 773, 787, 811, 859, 883, 907, 941, 967, 991, 1039, 1063, 1087, 1151, 1171, 1289, 1297, 1321, 1439, 1447, 1471, 1613, 1621, 1669
OFFSET
1,1
COMMENTS
A175119(n) = a(n+1) - a(n) + 1.
MATHEMATICA
a = 2; s = {a}; c = 1; lim = 50; While[c < m, p = NextPrime[a]; While[PrimeQ[p - a + 1], p = NextPrime[p]]; a = p; AppendTo[s, a]; c++]; s (* Zak Seidov, Nov 19 2012 *)
PROG
(Haskell)
a175118 n = a175118_list !! (n-1)
a175118_list = 2 : f 2 a000040_list where
f x ps = g $ dropWhile (<= x) ps where
g (q:qs) | a010051' (q - x + 1) == 1 = g qs
| otherwise = q : f q qs
-- Reinhard Zumkeller, Nov 20 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Feb 14 2010
EXTENSIONS
Extended by Ray Chandler, Mar 10 2010
STATUS
approved