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.

A279766 Number of odd digits in the decimal expansions of integers 1 to n.

This page as a plain text file.
%I A279766 #27 Feb 20 2023 07:52:30
%S A279766 0,1,1,2,2,3,3,4,4,5,6,8,9,11,12,14,15,17,18,20,20,21,21,22,22,23,23,
%T A279766 24,24,25,26,28,29,31,32,34,35,37,38,40,40,41,41,42,42,43,43,44,44,45,
%U A279766 46,48,49,51,52,54,55,57,58,60,60,61,61,62,62,63,63,64,64
%N A279766 Number of odd digits in the decimal expansions of integers 1 to n.
%C A279766 From _Bernard Schott_, Feb 19 2023: (Start)
%C A279766 Problem 1 of the British Mathematical Olympiad, round 1, in 2016/2017 asked: when the integers 1, 2, 3, ..., 2016 are written down in base 10, how many of the digits in the list are odd? The answer is a(2016) = 4015.
%C A279766 The similar sequence but with number of even digits is A358854. (End)
%H A279766 Joseph Myers, <a href="/A279766/b279766.txt">Table of n, a(n) for n = 0..1000</a>
%H A279766 United Kingdom Mathematics Trust, <a href="https://bmos.ukmt.org.uk/home/bmo1-2017.pdf">2016/17 British Mathematical Olympiad Round 1</a>, Problem 1.
%H A279766 <a href="/index/O#Olympiads">Index to sequences related to Olympiads</a>.
%F A279766 a(n) = A196564(A007908(n)). - _Michel Marcus_, Dec 18 2016
%F A279766 a(n) = A117804(n+1) - A358854(n) (number of total digits - number of even digits). - _Bernard Schott_, Feb 19 2023
%p A279766 a:= proc(n) option remember; `if`(n=0, 0, a(n-1)+
%p A279766       nops(select(x-> x::odd, convert(n,base,10))))
%p A279766     end:
%p A279766 seq(a(n), n=0..100);  # _Alois P. Heinz_, Dec 22 2016
%t A279766 Table[Count[Flatten@ IntegerDigits@ Range[0, n], d_ /; OddQ@ d], {n, 0, 68}] (* or *)
%t A279766 Accumulate@ Table[Count[IntegerDigits@ n, d_ /; OddQ@ d], {n, 0, 68}] (* _Michael De Vlieger_, Dec 22 2016 *)
%Y A279766 Cf. A007908, A058183, A117804, A196564, A358854.
%K A279766 base,nonn
%O A279766 0,4
%A A279766 _Joseph Myers_, Dec 18 2016