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!)
A279766 Number of odd digits in the decimal expansions of integers 1 to n. 3
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, 24, 24, 25, 26, 28, 29, 31, 32, 34, 35, 37, 38, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 46, 48, 49, 51, 52, 54, 55, 57, 58, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
From Bernard Schott, Feb 19 2023: (Start)
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.
The similar sequence but with number of even digits is A358854. (End)
LINKS
United Kingdom Mathematics Trust, 2016/17 British Mathematical Olympiad Round 1, Problem 1.
FORMULA
a(n) = A196564(A007908(n)). - Michel Marcus, Dec 18 2016
a(n) = A117804(n+1) - A358854(n) (number of total digits - number of even digits). - Bernard Schott, Feb 19 2023
MAPLE
a:= proc(n) option remember; `if`(n=0, 0, a(n-1)+
nops(select(x-> x::odd, convert(n, base, 10))))
end:
seq(a(n), n=0..100); # Alois P. Heinz, Dec 22 2016
MATHEMATICA
Table[Count[Flatten@ IntegerDigits@ Range[0, n], d_ /; OddQ@ d], {n, 0, 68}] (* or *)
Accumulate@ Table[Count[IntegerDigits@ n, d_ /; OddQ@ d], {n, 0, 68}] (* Michael De Vlieger, Dec 22 2016 *)
CROSSREFS
Sequence in context: A029028 A240572 A029072 * A029027 A035448 A060969
KEYWORD
base,nonn
AUTHOR
Joseph Myers, Dec 18 2016
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 25 03:15 EDT 2024. Contains 371964 sequences. (Running on oeis4.)