OFFSET
1,3
COMMENTS
This is the lexicographically earliest sequence of distinct nonnegative terms with this property.
LINKS
Carole Dubois, Table of n, a(n) for n = 1..5000
EXAMPLE
a(1) = 0 as 0 is the sum of all even digits used so far:
a(2) = 1 as 1 is the smallest term not yet present in the sequence that doesn't lead to a contradiction;
a(3) = 2 as 2 is the sum of all even digits used so far (0 + 2);
a(4) = 3 as 3 is the smallest term not yet present in the sequence that doesn't lead to a contradiction;
...
a(17) = 10 as 10 is the sum of all even digits used so far (0 + 2 + 2 + 2 + 2 + 2 + 0);
a(18) = 12 as 12 is the sum of all even digits used so far (0 + 2 + 2 + 2 + 2 + 2 + 0 + 2);
a(19) = 29 as 29 is the smallest term not yet present in the sequence that doesn't lead to a contradiction; etc.
PROG
(PARI) my(v=[], S=0, p=1, n=1); while(n<100, c=0; for(q=S, p, if(!(q%2), m=0; for(i=1, #digits(q), if(!(digits(q)[i]%2), m+=digits(q)[i])); if(S+m==q&&!vecsearch(vecsort(v), q), v=concat(v, q); S+=m; c++; break))); if(c==0, for(j=1, #digits(p), if(!(digits(p)[j]%2), S+=digits(p)[j])); v=concat(v, p); p+=2); n++); v \\ Derek Orr, Nov 22 2020
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Nov 15 2020
STATUS
approved