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.

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