cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A061217 Number of zeros in the concatenation n(n-1)(n-2)(n-3)...321.

Original entry on oeis.org

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
Offset: 1

Views

Author

Amarnath Murthy, Apr 22 2001

Keywords

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

Examples

			a(30) = 3 since number of zeros in 302928272625242322212019181716151413121110987654321 is 3. (This example implies offset = 1.)
		

Crossrefs

Programs

  • Haskell
    a061217 n = a061217_list !! (n-1)
    a061217_list = scanl1 (+) $ map a055641 [1..]
    -- Reinhard Zumkeller, Oct 27 2013
    
  • Mathematica
    Table[Count[Flatten[IntegerDigits/@Table[x-n,{n,0,x-1}]],0],{x,110}] (* Harvey P. Dale, Aug 10 2011 *)
  • 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

Formula

From Hieronymus Fischer, Jun 12 2012: (Start)
a(n) = (m+1)*(n+1) - (10^(m+1)-1)/9 + (1/2)*Sum_{j=1..m+1} (floor(n/10^j)*(2*n + 2 - (1 + floor(n/10^j))*10^j) - floor(n/10^j + 9/10)*(2*n + 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)

Extensions

Corrected and extended by Patrick De Geest, Jun 05 2001
Offset changed to 1 by Hieronymus Fischer, Jun 12 2012