login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A338743 When a(n) is odd, a(n) is the number of even digits present so far in the sequence, a(n) included. 6
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
The even nonnegative integers are present in their natural order. Some odd natural integers will never appear (11 for instance).
LINKS
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
Cf. A338741, A338742, A338744, A338745, A338746 (variants on the same idea), A196563.
Sequence in context: A233342 A120233 A265667 * A358267 A280866 A280864
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Nov 06 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 10:29 EDT 2024. Contains 371905 sequences. (Running on oeis4.)