A331375 a(n) is the number of times the digit 1 appears in the concatenation of integers from 0 to n, minus the number of times the next most frequent digit appears.
-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 9, 7, 6, 5, 4, 3, 2, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
Offset: 0
Examples
a(0) = -1 as after '0' the digit 0 has appeared once while 1 has not appeared, so a(0) = 0 - 1 = -1. a(10) = 0 as after '012345678910' the digits 0 and 1 have both appeared two times, so a(10) = 2 - 2 = 0. a(11) = 2 as after '01234567891011' the digit 1 has appeared four times and the digit 0 two times, so a(11) = 4 - 2 = 2.
Links
- Scott R. Shannon, Table of n, a(n) for n = 1..10000
Extensions
Deleted a conjectured but incorrect g.f. and recurrence. - N. J. A. Sloane, Jan 17 2020
Comments