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.

A069677 Primes with either no internal digits or all internal digits are 2.

This page as a plain text file.
%I A069677 #31 Aug 28 2021 03:16:20
%S A069677 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,
%T A069677 97,127,223,227,229,421,521,523,727,821,823,827,829,929,1223,1229,
%U A069677 2221,3221,3229,4229,5227,6221,6229,7229,8221,9221,9227,12227,22229,42221
%N A069677 Primes with either no internal digits or all internal digits are 2.
%H A069677 Michael S. Branicky, <a href="/A069677/b069677.txt">Table of n, a(n) for n = 1..275</a> (1..80 from Harvey P. Dale, 81..178 from David A. Corneth, all terms with <= 1000 digits)
%t A069677 Join[Prime[Range[25]],Select[Prime[Range[26,4500]],Union[Most[ Rest[ IntegerDigits[ #]]]] =={2}&]] (* _Harvey P. Dale_, Aug 12 2021 *)
%o A069677 (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
%o A069677 (Python)
%o A069677 from sympy import isprime
%o A069677 def agen(maxdigits):
%o A069677     yield from [2, 3, 5, 7]
%o A069677     for d in range(2, maxdigits+1):
%o A069677         pow10, mid = 10**(d-1), 0 if d < 3 else 10*int('2'*(d-2))
%o A069677         cands = (a*pow10+mid+b for a in range(1, 10) for b in [1, 3, 7, 9])
%o A069677         yield from filter(isprime, cands)
%o A069677 print([an for an in agen(100)]) # _Michael S. Branicky_, Aug 12 2021
%Y A069677 Cf. A069675, A069676, A069678, A069679, A069680, A069681, A069682, A069683, A069684.
%K A069677 nonn,base
%O A069677 1,1
%A A069677 _Amarnath Murthy_, Apr 06 2002
%E A069677 Corrected by _Ray Chandler_, Nov 24 2003
%E A069677 Offset corrected and name changed by _Arkadiusz Wesolowski_, Sep 07 2011