OFFSET
1,2
COMMENTS
This is the lexicographically earliest sequence of distinct positive terms with this property. The prime digits are 2, 3, 5 and 7.
LINKS
Carole Dubois, Table of n, a(n) for n = 1..9999
EXAMPLE
a(1) = 1 as 1 (a nonprime term) is the smallest term not yet present in the sequence that doesn't lead to a contradiction;
a(2) = 2 as 2 (a prime term) is the sum of all prime digits used so far;
a(3) = 4 (a nonprime term) as a(3) = 3 (a prime) would be a contradiction and a(3) = 4 doesn't lead to a contradiction;
...
a(14) = 11 (a prime term) as 11 is the sum of all prime digits used so far (2 + 2 + 5 + 2);
a(15) = 21 (a nonprime term) as 21 is the smallest term not yet present in the sequence that doesn't lead to a contradiction;
...
a(18) = 19 (a prime term) as 19 is the sum of all prime digits used so far (2 + 2 + 5 + 2 + 2 + 2 + 2 + 2); etc.
PROG
(PARI) v=[1]; w=[]; n=1; p=2; while(n<100, for(q=vecsum(w), p, if(isprime(q), m=[]; m=select(isprime, digits(q)); c=0; if(vecsum(w)+vecsum(m)==q&&!vecsearch(vecsort(v), q), v=concat(v, q); w=concat(w, m); c++; break))); if(c==0, while(isprime(p), p++); w=concat(w, select(isprime, digits(p))); v=concat(v, p); p++); n++); v \\ Derek Orr, Nov 17 2020
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Nov 15 2020
STATUS
approved