|
|
A061217
|
|
Number of zeros in the concatenation n(n-1)(n-2)(n-3)...321.
|
|
7
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 11, 12, 13, 14
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,20
|
|
COMMENTS
|
The number of zeros necessary to write down all the numbers 1, 2, ..., n. Thus, the partial sums of A055641 are given by a(n)+1 (for n>=1). - Hieronymus Fischer, Jun 12 2012
|
|
LINKS
|
|
|
FORMULA
|
a(n) = (m+1)*(n+1) - (10^(m+1)-1)/9 + (1/2)*Sum_{j=1..m+1} (floor(n/10^j)*(2n + 2 - (1 + floor(n/10^j))*10^j) - floor(n/10^j + 9/10)*(2n + 2 + ((4/5 - floor(n/10^j + 9/10))*10^j)), where m=floor(log_10(n)).
a(n) = A117804(n+1) - (n+1)*A054640(n) + (1/2)*Sum_{j=1..m+1} ((floor(n/10^j + 9/10)^2 - floor(n/10^j)^2)*10^j - (4/5*floor(n/10^j + 9/10) + floor(n/10^j))*10^j), where m=floor(log_10(n)).
a(10^m-1) = m*10^(m-1) - (10^m-1)/9.
(This is the total number of zeros occurring in all the numbers 1..10^m-1 or numbers with <= m places excluding zero.)
G.f.: g(x) = (1/(1-x)^2)*Sum_{j>=0} (1-x^10^j)*x^10^(j+1)/(1-x^10^(j+1)). (End)
|
|
EXAMPLE
|
a(30) = 3 since number of zeros in 302928272625242322212019181716151413121110987654321 is 3. (This example implies offset = 1.)
|
|
MATHEMATICA
|
Table[Count[Flatten[IntegerDigits/@Table[x-n, {n, 0, x-1}]], 0], {x, 110}] (* Harvey P. Dale, Aug 10 2011 *)
|
|
PROG
|
(Haskell)
a061217 n = a061217_list !! (n-1)
a061217_list = scanl1 (+) $ map a055641 [1..]
(PARI) a(n) = my(m=logint(n, 10)); (m+1)*(n+1) - (10^(m+1)-1)/9 + (1/2) * sum(j=1, m+1, (n\10^j * (2*n+2 - (1 + n\10^j) * 10 ^ j) - floor(n/10^j+9/10) * (2*n+2 + ((4/5 - floor(n / 10^j + 9 / 10))*10^j)))) \\ adapted from formula by Hieronymus Fischer \\ David A. Corneth, Jan 23 2019
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|