OFFSET
1,2
COMMENTS
This is the lexicographically earliest sequence of distinct positive terms with this property.
LINKS
Carole Dubois, Table of n, a(n) for n = 1..5000
EXAMPLE
a(1) = 1 as the sum of all odd digits used so far is 1:
a(2) = 2 as 2 is the smallest term not yet present in the sequence that doesn't lead to a contradiction;
a(3) = 4 as a(3) = 3 would be a contradiction and a(3) = 4 doesn't lead to a contradiction;
...
a(17) = 11 as the sum of all odd digits used so far is 11 (1 + 1 + 1 + 1 + 1 + 1 + 3 + 1 + 1); etc.
PROG
(PARI) my(v=[], S=0, p=2, 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