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!)
A045708 Primes with first digit 2. 24

%I #27 Sep 08 2022 08:44:56

%S 2,23,29,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,

%T 293,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,

%U 2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221

%N Primes with first digit 2.

%H Reinhard Zumkeller, <a href="/A045708/b045708.txt">Table of n, a(n) for n = 1..10000</a>

%F See A045707 for comments on density of these sequences.

%t Select[Table[Prime[n], {n, 3000}], First[IntegerDigits[#]]==2 &] (* _Vincenzo Librandi_, Aug 08 2014 *)

%o (Haskell)

%o a045708 n = a045708_list !! (n-1)

%o a045708_list = filter ((== 2) . a000030) a000040_list

%o -- _Reinhard Zumkeller_, Mar 16 2012

%o (Magma) [p: p in PrimesUpTo(2300) | Intseq(p)[#Intseq(p)] eq 2]; // _Vincenzo Librandi_, Aug 08 2014

%o (Python)

%o from sympy import isprime

%o def agen(limit=float('inf')):

%o yield 2

%o digits, adder = 1, 20

%o while True:

%o for i in range(1, 10**digits, 2):

%o test = adder + i

%o if test > limit: return

%o if isprime(test): yield test

%o digits, adder = digits+1, adder*10

%o agento = lambda lim: agen(limit=lim)

%o print(list(agento(2222))) # _Michael S. Branicky_, Feb 23 2021

%Y Cf. A000040.

%Y For primes with initial digit d (1 <= d <= 9) see A045707, A045708, A045709, A045710, A045711, A045712, A045713, A045714, A045715; A073517, A073516, A073515, A073514, A073513, A073512, A073511, A073510, A073509

%Y Cf. A000030, subsequence of A208272.

%Y Column k=2 of A262369.

%K nonn,base,easy

%O 1,1

%A _Felice Russo_

%E More terms from _Erich Friedman_.

%E Offset fixed by _Reinhard Zumkeller_, Mar 15 2012

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 March 28 16:58 EDT 2024. Contains 371254 sequences. (Running on oeis4.)