OFFSET
1,1
COMMENTS
a(22) / A006880(22) = 214188 / 201467286689315906290 =~ 10^-15. But out of the 2^22 candidates for primes, ~5% are.
MATHEMATICA
s = 0; Do[k = 0; While[k < 2^n, k++; If[p = FromDigits[ PadLeft[ IntegerDigits[k, 2], n] + 2]; PrimeQ[p], s++ ]]; Print[s], {n, 1, 22}]
With[{c=Select[Flatten[Table[FromDigits/@Tuples[{2, 3}, n], {n, 22}]], PrimeQ]}, Table[Count[c, _?(#<10^i&)], {i, 22}]] (* Harvey P. Dale, Mar 18 2016 *)
PROG
(Python)
from sympy import isprime
from itertools import count, islice, product
def agen(): # generator of terms
c = 2
for d in count(2):
yield c
for first in product("23", repeat=d-1):
t = int("".join(first) + "3")
if isprime(t): c += 1
print(list(islice(agen(), 20))) # Michael S. Branicky, May 23 2024
CROSSREFS
KEYWORD
base,nonn,more
AUTHOR
Robert G. Wilson v, Apr 22 2002
EXTENSIONS
a(23)-a(27) from Sean A. Irvine, May 17 2024
a(28)-a(34) from Michael S. Branicky, May 22 2024
STATUS
approved