OFFSET
1,2
COMMENTS
The number of digits necessary to write down all the numbers 0, 1, 2, ..., n-1. Thus, the partial sums of A055642 are given by a(n+1). - Hieronymus Fischer, Jun 08 2012
From Daniel Forgues, Mar 21 2013: (Start)
From n = 10^0 + 1 to 10^1: a(n) - a(n-1) = 1 (9 * 10^0 terms);
From n = 10^1 + 1 to 10^2: a(n) - a(n-1) = 2 (9 * 10^1 terms);
From n = 10^2 + 1 to 10^3: a(n) - a(n-1) = 3 (9 * 10^2 terms);
...
From n = 10^k + 1 to 10^(k+1): a(n) - a(n-1) = k+1 (9 * 10^k terms). (End)
By the "number of digits" definition, a(n) = 1 + A058183(n-1) for n > 1. - David Fifield, Jun 02 2019
LINKS
Hieronymus Fischer, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = d*n + 1 - (10^d - 1)/9 where d is the number of decimal digits in n, i.e., d = floor(log_10(n)) + 1.
From Hieronymus Fischer, Jun 08 2012: (Start)
a(n) = Sum_{j=0..n-1} A055642(j).
a(10^n) = (9*n-1)*(10^n-1)/9 + n + 1. (This is the total number of digits necessary to write down all the numbers with <= n places.)
G.f.: g(x) = x/(1-x) + (x/(1-x)^2)*Sum_{j>=0} x^10^j; corrected by Ilya Gutkovskiy, Jan 09 2017 (End)
EXAMPLE
12 begins at the 14th place in 12345678910111213... (we are ignoring "early bird" occurrences here, cf. A116700), so a(12) = 14.
From Daniel Forgues, Mar 21 2013: (Start)
a(10^1) = 10. (1*10^1 - 0)
a(10^2) = 190. (2*10^2 - 10)
a(10^3) = 2890. (3*10^3 - 110)
a(10^4) = 38890. (4*10^4 - 1110)
a(10^5) = 488890. (5*10^5 - 11110)
a(10^6) = 5888890. (6*10^6 - 111110)
...
a(10^k) = k*10^k - R_k + 1, R_k := k-th repunit (cf. A002275)
(the number of digits necessary to write down the numbers 0..10^k-1). (End)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Warut Roonguthai, Jul 23 2007
STATUS
approved