OFFSET
1,2
COMMENTS
Similar to A338925, however this sequence does not include the nonprime digits of a(n) itself.
Each nonprime term is the sum of all nonprime digits of each previous term.
EXAMPLE
a(9) = 4 since the sum of the nonprime digits of the previous terms is 1+1+1+1 = 4 and 4 is less than the next prime, 19.
a(10) = 8 since the sum of nonprime digits of the previous terms is 1+1+1+1+4 = 8 and 8 is less than the next prime, 19.
a(11) = 16 since the sum of the nonprime digits of the previous terms is 1+1+1+1+4+8 = 16 and 16 is less than the next prime, 19.
Now, the sum of the nonprime digits of the previous terms is 1+1+1+1+4+8+1+6 = 23 (a prime number). So a(12) is the next prime number in that hasn't appeared, meaning a(12) = 19.
PROG
(PARI) my(v=[0], w=[0], n=1, p=1, m, c); while(n<125, q=vecsum(w); m=[]; p=nextprime(p); c=0; for(k=1, #digits(q), if(!isprime(digits(q)[k]), m=concat(m, digits(q)[k]))); if(!isprime(q)&&(q<p)&& !vecsearch(vecsort(v), q), v=concat(v, q); w=concat(w, m); c++); if(c==0, for(j=1, #digits(p), if(!isprime(digits(p)[j]), w=concat(w, digits(p)[j]))); v=concat(v, p); p++); n++); v
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Eric Angelini and Derek Orr, Nov 16 2020
STATUS
approved