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.

A338744 When a(n) is even, 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 A338744 #9 Nov 15 2020 12:55:42
%S A338744 0,1,3,2,5,7,4,9,11,13,10,15,17,19,21,18,23,25,20,27,29,22,31,24,33,
%T A338744 26,35,28,37,39,41,34,43,36,45,38,47,49,40,51,42,53,44,55,46,57,48,59,
%U A338744 61,52,63,54,65,56,67,58,69,71,73,75,77,79,70,81,72,83,74,85,76,87,78,89,91,93,95,97,99,90,101
%N A338744 When a(n) is even, a(n) is the number of odd digits present so far in the sequence, a(n) included.
%C A338744 The odd nonnegative integers are present in their natural order. Some even natural integers will never appear (6 for instance).
%e A338744 The first even term is a(1) = 0 and there is indeed 0 odd digit so far in the sequence;
%e A338744 The next even term is a(4) = 2 and there are now 2 odd digits so far (1 and 3);
%e A338744 The next even term is a(7) = 4 and there are now 4 odd digits so far (1, 3, 5 and 7);
%e A338744 ...
%e A338744 The even term a(11) = 10 and there are indeed 10 odd digits in the sequence so far (1, 3, 5, 7, 9, 1, 1, 1, 3 and 1); etc.
%t A338744 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, {1, 3, 5, 7, 9}]]], ! FreeQ[a, k]], k++]; If[EvenQ[k], c += s, c += Total@ DigitCount[k, 10, {1, 3, 5, 7, 9}]]; AppendTo[a, k]], {i, 78}]; a] (* _Michael De Vlieger_, Nov 06 2020 *)
%Y A338744 Cf. A338741, A338742, A338743, A338745, A338746 (variants on the same idea), A196564.
%K A338744 base,nonn
%O A338744 1,3
%A A338744 _Eric Angelini_ and _Carole Dubois_, Nov 06 2020