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!)
A069677 Primes with either no internal digits or all internal digits are 2. 9
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 127, 223, 227, 229, 421, 521, 523, 727, 821, 823, 827, 829, 929, 1223, 1229, 2221, 3221, 3229, 4229, 5227, 6221, 6229, 7229, 8221, 9221, 9227, 12227, 22229, 42221 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..275 (1..80 from Harvey P. Dale, 81..178 from David A. Corneth, all terms with <= 1000 digits)
MATHEMATICA
Join[Prime[Range[25]], Select[Prime[Range[26, 4500]], Union[Most[ Rest[ IntegerDigits[ #]]]] =={2}&]] (* Harvey P. Dale, Aug 12 2021 *)
PROG
(PARI) uptoqdigits(n) = { my(ld = [1, 3, 7, 9]); n = max(n, 2); res = List(primes(primepi(97))); for(i = 1, n-2, twos = 20*(10^i\9); for(j = 1, 9, for(k = 1, #ld, c = j*10^(i+1) + twos + ld[k]; if(isprime(c), listput(res, c) ) ) ) ); Set(res) } \\ David A. Corneth, Aug 12 2021
(Python)
from sympy import isprime
def agen(maxdigits):
yield from [2, 3, 5, 7]
for d in range(2, maxdigits+1):
pow10, mid = 10**(d-1), 0 if d < 3 else 10*int('2'*(d-2))
cands = (a*pow10+mid+b for a in range(1, 10) for b in [1, 3, 7, 9])
yield from filter(isprime, cands)
print([an for an in agen(100)]) # Michael S. Branicky, Aug 12 2021
CROSSREFS
Sequence in context: A069676 A062353 A077390 * A069678 A069679 A069680
KEYWORD
nonn,base
AUTHOR
Amarnath Murthy, Apr 06 2002
EXTENSIONS
Corrected by Ray Chandler, Nov 24 2003
Offset corrected and name changed by Arkadiusz Wesolowski, Sep 07 2011
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 April 16 11:08 EDT 2024. Contains 371711 sequences. (Running on oeis4.)