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.
%I A000966 M3808 N1557 #110 May 17 2025 22:46:38 %S A000966 5,11,17,23,29,30,36,42,48,54,60,61,67,73,79,85,91,92,98,104,110,116, %T A000966 122,123,129,135,141,147,153,154,155,161,167,173,179,185,186,192,198, %U A000966 204,210,216,217,223,229,235,241,247,248,254,260,266,272,278,279,285 %N A000966 n! never ends in this many 0's. %C A000966 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 %C A000966 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 %C A000966 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 %C A000966 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 %D A000966 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence). %D A000966 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %D A000966 David Wells, The Penguin Dictionary of Curious and Interesting Numbers (Rev. ed. 1997), p. 42 %H A000966 Michael S. Branicky, <a href="/A000966/b000966.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from T. D. Noe) %H A000966 Gerald Hillier, <a href="http://www.hpmuseum.org/forum/thread-9190.html">Program for HP 49G calculator</a>, MoHPC: The Museum of HP Calculators, Sep 29 2017. %H A000966 L. Moser, <a href="http://www.jstor.org/stable/3029408">Problem 158</a>, Math. Mag., 27 (1953), 54-55. Solution by C. W. Trigg. %H A000966 L. Moser and C. W. Trigg, <a href="/A000966/a000966.pdf">Problem 158</a> (annotated and scanned copy) %H A000966 A. M. Oller-Marcen and J. Maria Grau, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL14/Oller/oller3.html">On the Base-b Expansion of the Number of Trailing Zeros of b^k!</a>, J. Int. Seq. 14 (2011) 11.6.8. %H A000966 Simon Plouffe, <a href="https://arxiv.org/abs/0911.4975">Approximations de séries génératrices et quelques conjectures</a>, Dissertation, Université du Québec à Montréal, 1992; arXiv:0911.4975 [math.NT], 2009. %H A000966 Simon Plouffe, <a href="/A000051/a000051_2.pdf">1031 Generating Functions</a>, Appendix to Thesis, Montreal, 1992. %H A000966 N. J. A. Sloane, <a href="/transforms.txt">Transforms</a> %H A000966 <a href="/index/Fa#factorial">Index entries for sequences related to factorial numbers</a> %F A000966 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). %F A000966 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 %F A000966 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] %e A000966 17 is in the sequence because on passing from 74! to 75!, the number of end zeros jumps from 16 to 18, skipping 17. %e A000966 More generally, we have: %e A000966 n, n! %e A000966 ----- %e A000966 0, 1 %e A000966 1, 1 %e A000966 2, 2 %e A000966 3, 6 %e A000966 4, 24 %e A000966 5, 120 %e A000966 6, 720 %e A000966 7, 5040 %e A000966 8, 40320 %e A000966 9, 362880 %e A000966 10, 3628800 %e A000966 11, 39916800 %e A000966 12, 479001600 %e A000966 13, 6227020800 %e A000966 14, 87178291200 %e A000966 15, 1307674368000 %e A000966 16, 20922789888000 %e A000966 17, 355687428096000 %e A000966 18, 6402373705728000 %e A000966 19, 121645100408832000 %e A000966 20, 2432902008176640000 %e A000966 21, 51090942171709440000 %e A000966 22, 1124000727777607680000 %e A000966 23, 25852016738884976640000 %e A000966 24, 620448401733239439360000 %e A000966 25, 15511210043330985984000000 <- jump from 4 to 6 trailing 0's, so 5 is a term %e A000966 26, 403291461126605635584000000 %e A000966 27, 10888869450418352160768000000 %e A000966 28, 304888344611713860501504000000 %e A000966 29, 8841761993739701954543616000000 %e A000966 30, 265252859812191058636308480000000 %e A000966 ... %p A000966 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 %t A000966 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 *) %t A000966 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 *) %t A000966 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 *) %o A000966 (PARI) valp(n,p)=my(s); while(n\=p, s+=n); s %o A000966 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 %o A000966 (Python) %o A000966 from itertools import count, islice %o A000966 def val(n, p): %o A000966 e = 0 %o A000966 while n%p == 0: n //= p; e += 1 %o A000966 return e %o A000966 def agen(): # generator of terms %o A000966 fi, nz, z = 1, 0, 0 %o A000966 for i in count(1): %o A000966 fi *= 2**val(i, 2) * 5**val(i, 5) %o A000966 z = val(fi, 10) %o A000966 for k in range(nz+1, nz+z): yield k %o A000966 nz += z %o A000966 fi //= 10**z %o A000966 print(list(islice(agen(), 56))) # _Michael S. Branicky_, Apr 13 2022 %Y A000966 Cf. A000142, A027868, A080066 (first differences), A191610 (complement), A096346 (same for base 3), A055938 (same for base 2), A136767-A136774. %K A000966 nonn,base,nice %O A000966 1,1 %A A000966 _N. J. A. Sloane_, _Robert G. Wilson v_ %E A000966 More terms from Mark Hudson (mrmarkhudson(AT)hotmail.com), Jan 24 2003 %E A000966 Corrected by _Sascha Kurz_, Jan 27 2003