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!)
A276707 Number of terms of A069090 with exactly n digits. 2
4, 12, 60, 381, 2522, 19094, 151286, 1237792, 10354144, 88407746, 766869330 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
MAPLE
A276707 := proc(n)
local a, k;
a := 0 ;
k := nextprime(10^(n-1)) ;
while k < 10^n do
if isA069090(k) then
a := a+1 ;
end if;
k := nextprime(k) ;
end do:
a ;
end proc: # R. J. Mathar, Dec 15 2016
PROG
(perl/tcsh) "bzcat A069090.b.txt.bz2 | perl -anle 'print length($F[1])' | sort | uniq -c" with https://github.com/barrycarter/bcapps/blob/master/QUORA/A069090.b.txt.bz2
(Python)
from sympy import primerange, isprime
def ok(p):
s = str(p)
if len(s) == 1: return True
return all(not isprime(int(s[:i])) for i in range(1, len(s)))
def a(n): return sum(ok(p) for p in primerange(10**(n-1), 10**n))
print([a(n) for n in range(1, 7)]) # Michael S. Branicky, Jul 03 2021
(Python) # faster version skipping bad prefixes
from sympy import isprime, nextprime
def a(n):
if n == 1: return 4
p, c = nextprime(10**(n-1)), 0
while p < 10**n:
s, fail = str(p), False
for i in range(1, n):
ti = int(s[:i])
if isprime(ti): fail = i; break
if fail: p = nextprime((ti+1)*10**(n-i))
else: p, c = nextprime(p), c+1
return c
print([a(n) for n in range(1, 8)]) # Michael S. Branicky, Jul 03 2021
CROSSREFS
Cf. A069090.
Sequence in context: A357711 A337291 A324693 * A350561 A083484 A088860
KEYWORD
nonn,base,more
AUTHOR
Barry Carter, Sep 15 2016
EXTENSIONS
a(9)-a(11) from Michael S. Branicky, Jul 03 2021
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 23 19:56 EDT 2024. Contains 371916 sequences. (Running on oeis4.)