OFFSET
1,2
COMMENTS
The odd nonnegative integers are present in their natural order. Some even natural integers will never appear.
EXAMPLE
The first even term is a(12) = 2 and there are indeed 2 even digits so far in the sequence (the 2 from 21 and 2 itself);
The next even term is a(14) = 4 and there are now 4 even digits so far (2, 2, 2 and 4);
The next even term is a(16) = 6 and there are now 6 even digits so far (2, 2, 2, 4, 2 and 6); etc.
MATHEMATICA
Block[{a = {0}, c = 0}, Do[Block[{k = 1, s}, While[If[EvenQ[k], Nand[FreeQ[a, k], k == c + Set[s, Total@ DigitCount[k, 10, {0, 2, 4, 6, 8}]]], ! FreeQ[a, k]], k++]; If[EvenQ[k], c += s, c += Total@ DigitCount[k, 10, {0, 2, 4, 6, 8}]]; AppendTo[a, k]], {i, 79}]; a] (* Michael De Vlieger, Nov 06 2020 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Nov 06 2020
STATUS
approved