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.

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

This page as a plain text file.
%I A338741 #10 Nov 15 2020 12:55:08
%S A338741 0,1,2,4,6,8,10,3,12,5,14,7,16,9,11,13,15,17,18,20,22,24,26,28,30,32,
%T A338741 21,34,23,36,25,38,27,40,42,44,46,48,50,29,31,33,35,37,39,52,41,54,43,
%U A338741 56,45,58,47,60,62,64,66,68,70,49,51,53,55,57,59,72,61,74,63,76,65,78,67,80,82,84,86,88,90,69
%N A338741 When a(n) is odd, a(n) is the number of odd digits present so far in the sequence, a(n) included.
%C A338741 The even nonnegative integers are present in their natural order. Some odd natural integers will never appear (19 for instance).
%e A338741 The first odd term is a(2) = 1 and there is indeed 1 odd digit so far in the sequence (1 itself);
%e A338741 The next odd term is a(8) = 3 and there are now 3 odd digits so far (1, 1 and 3);
%e A338741 The next odd term is a(10) = 5 and there are now 5 odd digits so far (1, 1, 3, 1 and 5);
%e A338741 ...
%e A338741 The next odd term is a(18) = 17 and there are indeed 17 odd digits so far in the sequence (1, 1, 3, 1, 5, 1, 7, 1, 9, 1, 1, 1, 3, 1, 5, 1, 7); etc.
%t A338741 Block[{a = {0}, c = 0}, Do[Block[{k = 1, s}, While[If[OddQ[k], Nand[FreeQ[a, k], k == c + Set[s, Total@ DigitCount[k, 10, {1, 3, 5, 7, 9}]]], ! FreeQ[a, k]], k++]; If[OddQ[k], c += s, c += Total@ DigitCount[k, 10, {1, 3, 5, 7, 9}]]; AppendTo[a, k]], {i, 79}]; a] (* _Michael De Vlieger_, Nov 06 2020 *)
%Y A338741 Cf. A338742, A338743, A338744, A338745, A338746 (variants on the same idea), A196564.
%K A338741 base,nonn
%O A338741 1,3
%A A338741 _Eric Angelini_ and _Carole Dubois_, Nov 06 2020