login
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.
2
-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,12
COMMENTS
Other than a(0) = 0 the digit 1 is the most frequently seen digit in the concatenation of the integers from 0 to n. See A094798 for the exact number of times. This sequence is the difference between that number and the number of times the next most frequent digit appears. For almost all numbers the next most frequent digit is 2. That only changes to the digit 0 once per order of magnitude, after reaching the number consisting of two or more 1's followed by 0. The digit 0 keeps this record for the next number, a repunit, after which the number of appearances of 2 again either equals or surpasses the number of appearances of 0.
When concatenating the integers from 0 to 10^k, with k >= 2, this sequence reaches its maximum value of 10^(k-1) at n = 10^k/5-1.
LINKS
EXAMPLE
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.
CROSSREFS
Sequence in context: A073835 A334387 A051503 * A179622 A367617 A367366
KEYWORD
sign,base
AUTHOR
Scott R. Shannon, Jan 14 2020
EXTENSIONS
Deleted a conjectured but incorrect g.f. and recurrence. - N. J. A. Sloane, Jan 17 2020
STATUS
approved