cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A338743 When a(n) is odd, a(n) is the number of even digits present so far in the sequence, a(n) included.

Original entry on oeis.org

0, 1, 2, 4, 3, 6, 8, 5, 10, 12, 7, 14, 16, 9, 18, 20, 22, 24, 26, 28, 21, 30, 23, 32, 25, 34, 27, 36, 29, 38, 40, 42, 44, 46, 48, 41, 50, 43, 52, 45, 54, 47, 56, 49, 58, 60, 62, 64, 66, 68, 61, 70, 63, 72, 65, 74, 67, 76, 69, 78, 80, 82, 84, 86, 88, 81, 90, 83, 92, 85, 94, 87, 96, 89, 98, 100, 102, 104
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Nov 06 2020

Keywords

Comments

The even nonnegative integers are present in their natural order. Some odd natural integers will never appear (11 for instance).

Examples

			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.
		

Crossrefs

Cf. A338741, A338742, A338744, A338745, A338746 (variants on the same idea), A196563.

Programs

  • 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 *)