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.

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

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