login
A159477
a(n) = smallest prime >= n, if 1 is counted as a prime.
2
1, 2, 3, 5, 5, 7, 7, 11, 11, 11, 11, 13, 13, 17, 17, 17, 17, 19, 19, 23, 23, 23, 23, 29, 29, 29, 29, 29, 29, 31, 31, 37, 37, 37, 37, 37, 37, 41, 41, 41, 41, 43, 43, 47, 47, 47, 47, 53, 53, 53, 53, 53, 53, 59, 59, 59, 59
OFFSET
1,2
LINKS
FORMULA
For n >= 2, a(n) = A007918(n). a(p) = p, a(c) = a(c+1), for p = primes (A000040), c = composite numbers (A002808).
MATHEMATICA
Join[{1}, NextPrime[Range[60]]] (* Harvey P. Dale, Jan 04 2012 *)
PROG
(Haskell)
a159477 n = a159477_list !! (n-1)
a159477_list = 1 : concat
(zipWith (\p q -> replicate (fromInteger $ (q - p)) q)
a008578_list $ tail a008578_list)
-- Reinhard Zumkeller, Nov 09 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
Jaroslav Krizek, Apr 13 2009
STATUS
approved