login
A091939
Prime numbers with prime sum of any two digits.
5
11, 23, 29, 41, 43, 47, 61, 67, 83, 89, 211, 2111, 4111, 11161, 11411, 16111, 111121, 111211, 111611, 112111, 611111, 1111211, 1114111, 11111141, 11111161, 11141111, 61111111, 1111111121, 1111111411, 1111211111, 1111411111, 1121111111
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
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
Cf. A004022 (repunit primes).
Sequence in context: A088136 A164932 A086244 * A072185 A105898 A247228
KEYWORD
base,nonn
AUTHOR
Rick L. Shepherd, Feb 16 2004
STATUS
approved