OFFSET
1,1
COMMENTS
The sequence is maximal in the sense that a nonempty set of primes cannot be added consistently.
EXAMPLE
2 is a term because it is a prime with prime digits only and its digit sum 2 is also a term.
227 is not a term because the digit sum is 11 which is not a term because it has nonprime digits.
27527 is a term: it is a prime, each digit (2,5,7) is also a prime, and the sum of the digits (2+7+5+2+7 = 23) is also in the sequence.
MAPLE
R:= {2, 3, 5, 7}: count:= 4:
S:= [2, 3, 5, 7];
for d from 2 to 11 do
S:= map(t -> (10*t+2, 10*t+3, 10*t+5, 10*t+7), S);
for x in S do
if member(convert(convert(x, base, 10), `+`), R) and isprime(x) then
R:= R union {x}; count:= count+1;
fi
od;
od:
sort(convert(R, list)); # Robert Israel, Mar 02 2023
PROG
(Python)
from sympy import isprime
seq = [2, 3, 5, 7]
for i in range(9, 10**6, 2):
s = str(i)
if set(s) <= set("2357") and sum(map(int, s)) in seq and isprime(i):
seq.append(i)
print(seq)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Hongwei Jin, Feb 09 2023
STATUS
approved