cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A159477 a(n) = smallest prime >= n, if 1 is counted as a prime.

This page as a plain text file.
%I A159477 #16 May 30 2025 14:57:53
%S A159477 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,
%T A159477 29,29,29,29,31,31,37,37,37,37,37,37,41,41,41,41,43,43,47,47,47,47,53,
%U A159477 53,53,53,53,53,59,59,59,59
%N A159477 a(n) = smallest prime >= n, if 1 is counted as a prime.
%H A159477 Reinhard Zumkeller, <a href="/A159477/b159477.txt">Table of n, a(n) for n = 1..1000</a>
%F A159477 For n >= 2, a(n) = A007918(n). a(p) = p, a(c) = a(c+1), for p = primes (A000040), c = composite numbers (A002808).
%t A159477 Join[{1},NextPrime[Range[60]]] (* _Harvey P. Dale_, Jan 04 2012 *)
%o A159477 (Haskell)
%o A159477 a159477 n = a159477_list !! (n-1)
%o A159477 a159477_list = 1 : concat
%o A159477    (zipWith (\p q -> replicate (fromInteger $ (q - p)) q)
%o A159477             a008578_list $ tail a008578_list)
%o A159477 -- _Reinhard Zumkeller_, Nov 09 2011
%Y A159477 Cf. A000040, A002808.
%Y A159477 Cf. A008578.
%Y A159477 Essentially the same as A066169 and A007918.
%K A159477 nonn
%O A159477 1,2
%A A159477 _Jaroslav Krizek_, Apr 13 2009