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.

Previous Showing 11-20 of 72 results. Next

A102669 Number of digits >= 2 in decimal representation of n.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 1, 1, 1
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Comments

a(n) = 0 iff n is in A007088 (numbers in base 2). - Bernard Schott, Feb 19 2023

Crossrefs

Programs

  • Maple
    p:=proc(n) local b,ct,j: b:=convert(n,base,10): ct:=0: for j from 1 to nops(b) do if b[j]>=2 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(p(n),n=0..116); # Emeric Deutsch, Feb 23 2005
  • Mathematica
    Table[Total@ Take[DigitCount@ n, {2, 9}], {n, 0, 104}] (* Michael De Vlieger, Aug 17 2017 *)

Formula

Contribution from Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = Sum_{j=1..m+1} (floor(n/10^j + 4/5) - floor(n/10^j)), where m = floor(log_10(n)).
G.f.: g(x) = (1/(1-x))*Sum_{j>=0} (x^(2*10^j) - x^(10*10^j))/(1 - x^10^(j+1)).
General formulas for the number of digits >= d in the decimal representations of n, where 1 <= d <= 9:
a(n) = Sum_{j=1..m+1} (floor(n/10^j + (10-d)/10) - floor(n/10^j)), where m = floor(log_10(n)).
G.f.: g(x) = (1/(1-x))*Sum_{j>=0} (x^(d*10^j) - x^(10*10^j))/(1 - x^10^(j+1)). (End)

Extensions

More terms from Emeric Deutsch, Feb 23 2005

A102685 Partial sums of A055640.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Comments

The total number of nonzero digits occurring in all the numbers 0, 1, 2, ... n (in decimal representation). - Hieronymus Fischer, Jun 10 2012

Crossrefs

Formula

From Hieronymus Fischer, Jun 06 2012: (Start)
a(n) = (1/2)*Sum_{j=1..m+1} (floor((n/10^j)+0.9)*(2n + 2 + (0.8 - floor((n/10^j)+0.9))*10^j) - floor(n/10^j)*(2n + 2 - (floor(n/10^j)+1) * 10^j)), where m = floor(log_10(n)).
a(n) = (n+1)*A055640(n) + (1/2)*Sum_{j=1..m+1} ((8*floor((n/10^j)+0.9)/10 + floor(n/10^j))*10^j - (floor((n/10^j)+0.9)^2 - floor(n/10^j)^2)*10^j), where m = floor(log_10(n)).
a(10^m-1) = 9*m*10^(m-1). (This is the total number of nonzero digits occurring in all the numbers with <= m digits.)
G.f.: g(x) = (1/(1-x)^2) * Sum_{j>=0} (x^10^j - x^(10*10^j))/(1-x^10^(j+1)). (End)

A004152 Sum of digits of n!.

Original entry on oeis.org

1, 1, 2, 6, 6, 3, 9, 9, 9, 27, 27, 36, 27, 27, 45, 45, 63, 63, 54, 45, 54, 63, 72, 99, 81, 72, 81, 108, 90, 126, 117, 135, 108, 144, 144, 144, 171, 153, 108, 189, 189, 144, 189, 180, 216, 207, 216, 225, 234, 225, 216, 198, 279, 279, 261, 279, 333, 270, 288
Offset: 0

Views

Author

Keywords

Comments

If n > 5, then 9 divides a(n). - Enrique Pérez Herrero, Mar 01 2009

Examples

			a(5) = 3 because 5! = 120 and 1 + 2 + 0 = 3.
a(6) = 9 because 6! = 720 and 7 + 2 + 0 = 9.
		

Crossrefs

Cf. A000142 (factorial), A007953 (sum of digits), A079584 (same in base 2), A086358 (digital root of n!).
Cf. A066419 (k such that a(k) does not divide k!).

Programs

Formula

Luca shows that a(n) >> log n. In particular, a(n) > log_10 n - log_10 log_10 n. - Charles R Greathouse IV, Dec 27 2011
a(n) < floor(log_10(n)*9/2). - Carmine Suriano, Feb 20 2013
a(n) = A007953(A000142(n)). - Michel Marcus, Sep 18 2014
a(n) < 9*(A034886(n) - A027868(n)). - Enrique Pérez Herrero, Nov 16 2014
Sanna improved Luca's result to a(n) >> log n log log log n. - Charles R Greathouse IV, Jan 30 2015
a(n) = 9*A202708(n), n>=6. - R. J. Mathar, Jul 30 2021

A027869 Number of 0's in n!.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 2, 2, 1, 2, 2, 4, 4, 2, 4, 4, 4, 5, 6, 7, 7, 8, 5, 6, 9, 8, 9, 10, 7, 9, 7, 10, 8, 11, 9, 10, 12, 16, 12, 9, 15, 13, 13, 12, 13, 16, 11, 14, 14, 19, 18, 18, 17, 18, 18, 17, 20, 17, 19, 19, 26, 20, 21, 20, 20, 23, 22, 25, 21, 20, 25, 23, 35
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Count[IntegerDigits[n!], 0], {n, 0, 100}] (* T. D. Noe, Apr 10 2012 *)
    DigitCount[Range[0,80]!,10,0] (* Harvey P. Dale, Jul 08 2020 *)
  • PARI
    a(n)=my(d=digits(n!)); sum(i=1,#d,d[i]==0) \\ Charles R Greathouse IV, Jul 06 2017
    
  • Python
    from math import factorial
    def a(n): return str(factorial(n)).count('0')
    print([a(n) for n in range(74)]) # Michael S. Branicky, Jan 11 2022

Formula

a(n) = A034886(n) - (A079680(n) + A079714(n) + A079684(n) + A079688(n) + A079690(n) + A079691(n) + A079692(n) + A079693(n) + A079694(n)). - Reinhard Zumkeller, Jan 27 2008
A027868(n) <= a(n). - Reinhard Zumkeller, Jan 27 2008
Conjecture: a(n) ~ (9*A027868(n) + A034886(n))/10. This formula is based on the assumption that the digits other than trailing zeros are uniformly randomly distributed. - Nicolas Bělohoubek, Jan 11 2022

A102683 Number of digits 9 in decimal representation of n.

Original entry on oeis.org

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, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Crossrefs

Programs

  • Haskell
    a102683 =  length . filter (== '9') . show
    -- Reinhard Zumkeller, Dec 29 2011
  • Maple
    p:=proc(n) local b,ct,j: b:=convert(n,base,10): ct:=0: for j from 1 to nops(b) do if b[j]>=9 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(p(n),n=0..116); # Emeric Deutsch, Feb 23 2005
  • Mathematica
    a[n_] := DigitCount[n, 10, 9]; Array[a, 100, 0] (* Amiram Eldar, Jul 24 2023 *)

Formula

a(A007095(n)) = 0; a(A011539(n)) > 0. - Reinhard Zumkeller, Dec 29 2011
From Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = Sum_{j=1..m+1} (floor(n/10^j + 1/10) - floor(n/10^j)), where m=floor(log_10(n)).
G.f.: g(x) = (1/(1-x))*Sum_{j>=0} (x^(9*10^j) - x^(10*10^j))/(1-x^10^(j+1)). (End)
a(A235049(n)) = 0. - Reinhard Zumkeller, Apr 16 2014

Extensions

More terms from Emeric Deutsch, Feb 23 2005

A004154 a(n) = n! with trailing zeros omitted.

Original entry on oeis.org

1, 1, 2, 6, 24, 12, 72, 504, 4032, 36288, 36288, 399168, 4790016, 62270208, 871782912, 1307674368, 20922789888, 355687428096, 6402373705728, 121645100408832, 243290200817664, 5109094217170944, 112400072777760768, 2585201673888497664, 62044840173323943936
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A000142, A004151, A008904 (mod 10).

Programs

  • Haskell
    a004154 = a004151 . a000142
    a004154_list = scanl (\u v -> a004151 $ u * v) 1 [1..]
    -- Reinhard Zumkeller, Nov 24 2012
    
  • Magma
    [Factorial(n)/10^Valuation(Factorial(n), 5): n in [0..30]]; // Vincenzo Librandi, Oct 16 2014
    
  • Maple
    a:= n-> (f-> f/10^padic[ordp](f,10))(n!):
    seq(a(n), n=0..29);  # Alois P. Heinz, Dec 29 2021
  • Mathematica
    Array[#!//.x_/;x~Mod~5==0:>x/10&,22]  (* Giorgos Kalogeropoulos, Aug 17 2020 *)
    Join[{1,1,2,6,24},Table[FromDigits[Flatten[Most[Split[IntegerDigits[n!]]]]],{n,5,30}]] (* or *) Table[n!/10^IntegerExponent[n!,10],{n,0,30}] (* Harvey P. Dale, Feb 13 2024 *)
  • PARI
    a(n)=n!/10^valuation(n!,5) \\ M. F. Hasler, Oct 16 2014
    
  • Python
    from sympy import factorial
    from sympy.ntheory.factor_ import digits
    def A004154(n): return factorial(n)//10**(n-sum(digits(n,5)[1:])>>2) # Chai Wah Wu, Oct 18 2024
    
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        f = 1
        for n in count(1):
            yield f
            while n%10 == 0: n //= 10
            f *= n
            while f%10 == 0: f //= 10
    print(list(islice(agen(), 25))) # Michael S. Branicky, Apr 11 2025

Formula

a(n) = A000142(n) / 10^A027868(n). - Reinhard Zumkeller, Nov 24 2012
a(n+1) = A004151((n+1)*a(n)). - Reinhard Zumkeller, Nov 24 2012, corrected by M. F. Hasler, Oct 16 2014
a(n) = A004151(A000142(n)) = A000142(n)/A011557(A112765(n)), or A122840 instead of A112765. - M. F. Hasler, Oct 16 2014

A090622 Square array read by antidiagonals of highest power of k dividing n! (with n,k>1).

Original entry on oeis.org

1, 0, 1, 0, 1, 3, 0, 0, 1, 3, 0, 0, 1, 1, 4, 0, 1, 0, 1, 2, 4, 0, 0, 1, 1, 2, 2, 7, 0, 0, 0, 1, 1, 2, 2, 7, 0, 0, 1, 0, 2, 1, 3, 4, 8, 0, 0, 0, 1, 0, 2, 1, 3, 4, 8, 0, 0, 0, 0, 1, 1, 2, 1, 4, 4, 10, 0, 0, 0, 1, 1, 1, 1, 4, 2, 4, 5, 10, 0, 0, 1, 0, 1, 1, 2, 1, 4, 2, 5, 5, 11, 0, 0, 0, 1, 0, 1, 1, 2, 1, 4, 2, 5, 5, 11
Offset: 2

Views

Author

Henry Bottomley, Dec 06 2003

Keywords

Examples

			Square array starts:
1, 0, 0, 0, 0, 0, 0, ...
1, 1, 0, 0, 1, 0, 0, ...
3, 1, 1, 0, 1, 0, 1, ...
3, 1, 1, 1, 1, 0, 1, ...
4, 2, 2, 1, 2, 0, 1, ...
4, 2, 2, 1, 2, 1, 1, ...
7, 2, 3, 1, 2, 1, 2, ...
		

Crossrefs

Programs

  • Maple
    f:= proc(n, p) local c, k; c, k:= 0, p;
           while n>=k do c:= c+iquo(n, k); k:= k*p od; c
        end:
    T:= (n, k)-> min(seq(iquo(f(n, i[1]), i[2]), i=ifactors(k)[2])):
    seq(seq(T(n, 2+d-n), n=2..d), d=2..20);  # Alois P. Heinz, Oct 04 2012
  • Mathematica
    f[n_, p_] := Module[{c = 0, k = p}, While[n >= k , c = c + Quotient[n, k]; k = k*p ]; c ]; t[n_, k_] := Min[ Table[ Quotient[f[n, i[[1]]], i[[2]]], {i, FactorInteger[k]}]]; Table[ Table[t[n, 2 + d - n], {n, 2, d}], {d, 2, 20}] // Flatten (* Jean-François Alcover, Oct 03 2013, translated from Alois P. Heinz's Maple program *)

Formula

For k=p prime: T(n,p) = [n/p] + [n/p^2] + [n/p^3] + .... For k = p^m a prime power: T(n,p^m) = [T(n,p)/m]. For k = b*c with b and c coprime: T(n,a*b) = min(T(n,a), T(n,b)). T(n,k) is close to, but below, n/A090624(k).

A000966 n! never ends in this many 0's.

Original entry on oeis.org

5, 11, 17, 23, 29, 30, 36, 42, 48, 54, 60, 61, 67, 73, 79, 85, 91, 92, 98, 104, 110, 116, 122, 123, 129, 135, 141, 147, 153, 154, 155, 161, 167, 173, 179, 185, 186, 192, 198, 204, 210, 216, 217, 223, 229, 235, 241, 247, 248, 254, 260, 266, 272, 278, 279, 285
Offset: 1

Views

Author

Keywords

Comments

This sequence also holds for bases 5, 15, 20, 30, 40, 60 and 120. These bases (together with 10) are the proper divisors of 5! that are divisible by 5. - Carl R. White, Jan 21 2008
The g.f. conjectured by Simon Plouffe in 1992 dissertation is not correct; the first discrepancy is a(31) = 155, his g.f. gives 160. In fact, the g.f. for this sequence is not rational; the first differences are bounded but not periodic. - Franklin T. Adams-Watters, Jul 03 2009
a(n+1) - a(n) = 1 or 6: Let k be the smallest number such that (5*k)! ends in at least a(n)+1 zeros, then k is a multiple of 5, otherwise (5*(k-1))! would end in at least a(n) zeros, either contradicting with the minimality of k or with the fact that a(n) is a term. If (5*k)! ends in exactly a(n)+1 zeros, then the next term after a(n) is a(n)+6, otherwise it is a(n)+1. - Jianing Song, Apr 13 2022
The positions of 1 in the sequence of first differences (A080066) is, itself, a(n), so the sequence is "self-generating", starting from a(1) = 5. - Paul C Abbott, May 12 2025

Examples

			17 is in the sequence because on passing from 74! to 75!, the number of end zeros jumps from 16 to 18, skipping 17.
More generally, we have:
  n, n!
  -----
  0, 1
  1, 1
  2, 2
  3, 6
  4, 24
  5, 120
  6, 720
  7, 5040
  8, 40320
  9, 362880
 10, 3628800
 11, 39916800
 12, 479001600
 13, 6227020800
 14, 87178291200
 15, 1307674368000
 16, 20922789888000
 17, 355687428096000
 18, 6402373705728000
 19, 121645100408832000
 20, 2432902008176640000
 21, 51090942171709440000
 22, 1124000727777607680000
 23, 25852016738884976640000
 24, 620448401733239439360000
 25, 15511210043330985984000000 <- jump from 4 to 6 trailing 0's, so 5 is a term
 26, 403291461126605635584000000
 27, 10888869450418352160768000000
 28, 304888344611713860501504000000
 29, 8841761993739701954543616000000
 30, 265252859812191058636308480000000
 ...
		

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers (Rev. ed. 1997), p. 42

Crossrefs

Cf. A000142, A027868, A080066 (first differences), A191610 (complement), A096346 (same for base 3), A055938 (same for base 2), A136767-A136774.

Programs

  • Maple
    read(transforms); e:=n->(5^n-1)/4; f:=n->(1-x^(e(n)-1))/(1-x^e(n-1)); t:=n->x^(e(n)-6); A[2]:=1; for n from 3 to 8 do A[n]:=f(n)*A[n-1]+t(n); od: POWERS(series(x^5*A[8],x,5005),x,5005); # N. J. A. Sloane, Feb 02 2007
  • Mathematica
    u=Union@Accumulate@IntegerExponent[Range[1000],5]; Complement[Range[Last@u], u] (* T. D. Noe, Feb 02 2007, and Paul C Abbott, May 12 2025 *)
    zOF[n_Integer?Positive]:=Module[{maxpow=0},While[5^maxpow<=n,maxpow++];Plus@@Table[Quotient[n,5^i],{i,maxpow-1}]]; Attributes[ zOF] = {Listable}; nmz[n_]:=Module[{zs=zOF[Range[n]]},Complement[ Range[ Max[zs]],zs]]; nmz[2000] (* Harvey P. Dale, Mar 05 2017 *)
    a[1]=5; d[n_]:=a[n+1]=a[n]+1; a[n_]:=a[n]=a[n-1]+6; (n|->d[a[n]])/@Range[40];a/@Range[a[40]+ 1] (* Paul C Abbott, May 12 2025 *)
  • PARI
    valp(n,p)=my(s); while(n\=p, s+=n); s
    is(n)=my(t=(4*n-1)\5*5+5, s=valp(t,5)-n); while(s<0, s+=valuation(t+=5, 5)); s>0 \\ Charles R Greathouse IV, Sep 22 2016
    
  • Python
    from itertools import count, islice
    def val(n, p):
        e = 0
        while n%p == 0: n //= p; e += 1
        return e
    def agen(): # generator of terms
        fi, nz, z = 1, 0, 0
        for i in count(1):
            fi *= 2**val(i, 2) * 5**val(i, 5)
            z = val(fi, 10)
            for k in range(nz+1, nz+z): yield k
            nz += z
            fi //= 10**z
    print(list(islice(agen(), 56))) # Michael S. Branicky, Apr 13 2022

Formula

The simplest way to obtain this sequence is by constructing a power series A(x) = Sum_{k >= 1} x^a(k) whose exponents give the terms of the sequence. Define e(n) = (5^n-1)/4, f(n) = (1-x^(e(n)-1))/(1-x^e(n-1)), t(n) = x^(e(n)-6).
Now use the recurrence A[2] = 1 and for n >= 3, A[n] = f(n)*A[n-1]+t(n); then A = limit_{n->infinity} x^5*A[n]. This follows easily from the explicit formula for A027868(n). Here is the beginning of A: x^5 + x^11 + x^17 + x^23 + x^29 + x^30 + x^36 + x^42 + x^48 + ... - N. J. A. Sloane, Feb 02 2007
Formula from C. W. Trigg (see the Moser reference): All terms can be described as follows: for k = 1, 2, 3, ..., the number 6k-1 + floor(k/5) + floor(k/5^2) + floor(k/5^3) + ... is a term together with A112765(k) preceding numbers. [corrected and simplified by Gerald Hillier and Andrey Zabolotskiy, Sep 13 2017]

Extensions

More terms from Mark Hudson (mrmarkhudson(AT)hotmail.com), Jan 24 2003
Corrected by Sascha Kurz, Jan 27 2003

A090616 Exponent of highest power of 4 dividing n!.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5, 7, 7, 8, 8, 9, 9, 9, 9, 11, 11, 11, 11, 12, 12, 13, 13, 15, 15, 16, 16, 17, 17, 17, 17, 19, 19, 19, 19, 20, 20, 21, 21, 23, 23, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 28, 28, 31, 31, 32, 32, 33, 33, 33, 33, 35, 35, 35, 35, 36
Offset: 0

Views

Author

Henry Bottomley, Dec 06 2003

Keywords

Examples

			a(6)=2 since 6! = 720 = 4^2 * 45.
		

Crossrefs

Programs

  • Mathematica
    IntegerExponent[Range[0, 100]!, 4] (* Vincenzo Librandi, Mar 10 2013 *)
  • PARI
    a(n) = valuation( n!, 4 ); /* Joerg Arndt, Mar 10 2013 */
    (Python 3.10+)
    def A090616(n): return (n-n.bit_count())>>1 # Chai Wah Wu, Jul 09 2022

Formula

a(n) = A090622(n, 4) = floor(A011371(n)/2) = floor((floor(n/2) + floor(n/4) + floor(n/8) + floor(n/16) + ...)/2).
a(n) = A235127(n!). - R. J. Mathar, Jul 08 2021

A191610 Possible number of trailing zeros in k!.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 55, 56, 57, 58, 59, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84, 86, 87, 88, 89, 90, 93, 94, 95, 96, 97, 99, 100, 101, 102, 103, 105, 106, 107, 108, 109, 111, 112, 113, 114, 115, 117, 118, 119, 120, 121, 124, 125, 126, 127, 128, 130, 131, 132, 133, 134, 136
Offset: 1

Views

Author

Keywords

Comments

Equivalently, possible values of 10-adic valuation of k!. - Joerg Arndt, Sep 21 2020

Examples

			3 is a term because 15! = 1307674368000 has 3 trailing 0's.
5 is not a term because 24! has 4 trailing 0's, but 25! has 6 trailing 0's.
		

Crossrefs

Cf. A027868, A000351, A055457 (first differences).
Complement of A000966.

Programs

  • Haskell
    a191610 1 = 0
    a191610 n = sum $ takeWhile (> 0) $ map ((n - 1) `div`) a000351_list
    -- Reinhard Zumkeller, Oct 31 2012
    
  • Mathematica
    zOF[n_Integer?Positive]:=Module[{maxpow=0},While[5^maxpow<=n,maxpow++];Plus@@Table[ Quotient[n,5^i],{i,maxpow-1}]]; Attributes[zOF]={Listable}; zOF[Range[1000]]//Union (* Harvey P. Dale, Dec 06 2023 *)
    Table[Sum[Floor[(n - 1)/5^k], {k, 0, Floor[Log[5, n]]}], {n, 1, 200}] (* Clark Kimberling, Feb 17 2025 *)
  • Python
    # requires Python 3.2 and higher
    from itertools import accumulate
    from sympy import multiplicity
    A191610 = [0]+list(accumulate(multiplicity(5,n) for n in range(5,10**3,5)))
    # Chai Wah Wu, Sep 05 2014

Formula

a(n) ~ 5*n/4. - Vaclav Kotesovec, Sep 21 2020
G.f.: 1/(1-x) * Sum_{k>=0} x^(5^k)/(1-x^5^k). - Joerg Arndt, Sep 21 2020
a(n) = Sum_{k>=0} floor((n-1)/5^k). - Clark Kimberling, Feb 17 2025
Previous Showing 11-20 of 72 results. Next