A091939 Prime numbers with prime sum of any two digits.
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
Examples
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.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..3329
Crossrefs
Cf. A004022 (repunit primes).
Programs
-
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
Comments