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