login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A079062 a(1) = 2; for n>1, a(n) = smallest prime p such that p - a(n-1) = a^b for some positive integers a,b > 1. 2
2, 11, 19, 23, 31, 47, 79, 83, 211, 227, 263, 271, 307, 311, 347, 379, 383, 419, 547, 563, 571, 587, 619, 683, 691, 727, 743, 751, 787, 823, 827, 859, 863, 991, 1091, 1123, 1187, 1223, 1231, 1427, 1459, 1523, 1531, 1567, 1571, 1579, 1583, 1619, 1627, 1663, 1667 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
Start with 2. 2 + 3^2 = 11 is a prime and there is no smaller such prime, so 11 is the next number. 11 + 2^3 = 19 is a prime and there is no smaller such prime, so 19 comes next, etc.
MATHEMATICA
a[1] = 2; a[n_] := a[n] = Catch[ For[p = NextPrime[a[n-1]], True, p = NextPrime[p], q = p - a[n-1]; test = Catch[ Do[ If[q == a^b, Throw[True]], {a, 2, Ceiling[Sqrt[q]]}, {b, 2, Ceiling[Log[2, q]]}]]; If[test === True, Throw[p]]]]; Table[a[n], {n, 1, 35}] (* Jean-François Alcover, Jul 13 2012 *)
PROG
(Haskell)
a079062 n = a079062_list !! (n-1)
a079062_list = 2 : f 2 (tail a000040_list) where
f x ps = q : f q qs where
(q:qs) = dropWhile (\p -> a075802 (p - x) == 0 || p - x == 1) ps
-- Reinhard Zumkeller, Jun 14 2013
CROSSREFS
Sequence in context: A018443 A163058 A161504 * A038930 A019375 A078784
KEYWORD
nice,nonn
AUTHOR
Fabian Rothelius, Feb 02 2003
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 17 04:30 EDT 2024. Contains 375198 sequences. (Running on oeis4.)