OFFSET
1,1
COMMENTS
All repunit primes (A004022) are terms. All other terms contain exactly one nonzero even digit. All non-repunit terms with k>2 digits must contain exactly k-1 copies of the digit 1, including final digit 1 and the remaining digit must be either 2, 4, or 6.
a(3330) has 1001 digits. - Michael S. Branicky, Dec 13 2023
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..3329
EXAMPLE
2111 is a term because it is prime and all sums of any two of its digits are 2+1 = 3 or 1+1 = 2, both of which are primes.
PROG
(Python)
from gmpy2 import is_prime
from itertools import count, islice
def agen(): # generator of terms
yield from [11, 23, 29, 41, 43, 47, 61, 67, 83, 89]
for k in count(3):
b = (10**k-1)//9
if is_prime(b): yield b
dlst = [j for j in [1, 3, 5] if (k+j)%3]
for i in range(1, k):
c = 10**i
for d in dlst:
if is_prime(b + c*d): yield b + c*d
print(list(islice(agen(), 32))) # Michael S. Branicky, Dec 13 2023
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Rick L. Shepherd, Feb 16 2004
STATUS
approved