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.

Showing 1-10 of 16 results. Next

A080066 First differences of A000966 (number of zeros that n! will never end in).

Original entry on oeis.org

6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 1, 1, 6, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 1, 1, 6, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 1, 1, 6, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 1, 6
Offset: 1

Views

Author

Mark Hudson (mrmarkhudson(AT)hotmail.com), Jan 24 2003

Keywords

Comments

All terms in this sequence are either 1 or 6. - Charles R Greathouse IV, Jan 30 2023
The positions of 1 in this sequence are A000966, the sequence from which the differences were obtained. - Paul C Abbott, May 12 2025

Examples

			E.g. A000966(5)=29, A000966(4)=23, so a(4)=29-23=6.
		

Crossrefs

Formula

a(n) = A000966(n+1) - A000966(n).

Extensions

More terms from Sascha Kurz, Jan 27 2003

A027868 Number of trailing zeros in n!; highest power of 5 dividing n!.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 18, 18, 18, 18, 18, 19
Offset: 0

Views

Author

Keywords

Comments

Also the highest power of 10 dividing n! (different from A054899). - Hieronymus Fischer, Jun 18 2007
Alternatively, a(n) equals the expansion of the base-5 representation A007091(n) of n (i.e., where successive positions from right to left stand for 5^n or A000351(n)) under a scale of notation whose successive positions from right to left stand for (5^n - 1)/4 or A003463(n); for instance, n = 7392 has base-5 expression 2*5^5 + 1*5^4 + 4*5^3 + 0*5^2 + 3*5^1 + 2*5^0, so that a(7392) = 2*781 + 1*156 + 4*31 + 0*6 + 3*1 + 2*0 = 1845. - Lekraj Beedassy, Nov 03 2010
Partial sums of A112765. - Hieronymus Fischer, Jun 06 2012
Also the number of trailing zeros in A000165(n) = (2*n)!!. - Stefano Spezia, Aug 18 2024

Examples

			a(100)  = 24.
a(10^3) = 249.
a(10^4) = 2499.
a(10^5) = 24999.
a(10^6) = 249998.
a(10^7) = 2499999.
a(10^8) = 24999999.
a(10^9) = 249999998.
a(10^n) = 10^n/4 - 3 for 10 <= n <= 15 except for a(10^14) = 10^14/4 - 2. - _M. F. Hasler_, Dec 27 2019
		

References

  • M. Gardner, "Factorial Oddities." Ch. 4 in Mathematical Magic Show: More Puzzles, Games, Diversions, Illusions and Other Mathematical Sleight-of-Mind from Scientific American. New York: Vintage, 1978, pp. 50-65.

Crossrefs

See A000966 for the missing numbers. See A011371 and A054861 for analogs involving powers of 2 and 3.
Cf. also A000142, A004154.

Programs

  • Haskell
    a027868 n = sum $ takeWhile (> 0) $ map (n `div`) $ tail a000351_list
    -- Reinhard Zumkeller, Oct 31 2012
    
  • Magma
    [Valuation(Factorial(n), 5): n in [0..80]]; // Bruno Berselli, Oct 11 2021
  • Maple
    0, seq(add(floor(n/5^i),i=1..floor(log[5](n))), n=1..100); # Robert Israel, Nov 13 2014
  • Mathematica
    Table[t = 0; p = 5; While[s = Floor[n/p]; t = t + s; s > 0, p *= 5]; t, {n, 0, 100} ]
    Table[ IntegerExponent[n!], {n, 0, 80}] (* Robert G. Wilson v *)
    zOF[n_Integer?Positive]:=Module[{maxpow=0},While[5^maxpow<=n,maxpow++];Plus@@Table[Quotient[n,5^i],{i,maxpow-1}]]; Attributes[zOF]={Listable}; Join[{0},zOF[ Range[100]]] (* Harvey P. Dale, Apr 11 2022 *)
  • PARI
    a(n)={my(s);while(n\=5,s+=n);s} \\ Charles R Greathouse IV, Nov 08 2012, edited by M. F. Hasler, Dec 27 2019
    
  • PARI
    a(n)=valuation(n!,5) \\ Charles R Greathouse IV, Nov 08 2012
    
  • PARI
    apply( A027868(n)=(n-sumdigits(n,5))\4, [0..99]) \\ M. F. Hasler, Dec 27 2019
    
  • Python
    from sympy import multiplicity
    A027868, p5 = [0,0,0,0,0], 0
    for n in range(5,10**3,5):
        p5 += multiplicity(5,n)
        A027868.extend([p5]*5) # Chai Wah Wu, Sep 05 2014
    
  • Python
    def A027868(n): return 0 if n<5 else n//5 + A027868(n//5) # David Radcliffe, Jun 26 2016
    
  • Python
    from sympy.ntheory.factor_ import digits
    def A027868(n): return n-sum(digits(n,5)[1:])>>2 # Chai Wah Wu, Oct 18 2024
    

Formula

a(n) = Sum_{i>=1} floor(n/5^i).
a(n) = (n - A053824(n))/4.
From Hieronymus Fischer, Jun 25 2007 and Aug 13 2007, edited by M. F. Hasler, Dec 27 2019: (Start)
G.f.: g(x) = Sum_{k>0} x^(5^k)/(1-x^(5^k))/(1-x).
a(n) = Sum_{k=5..n} Sum_{j|k, j>=5} (floor(log_5(j)) - floor(log_5(j-1))).
G.f.: g(x) = L[b(k)](x)/(1-x) where L[b(k)](x) = Sum_{k>=0} b(k)*x^k/(1-x^k) is a Lambert series with b(k) = 1, if k>1 is a power of 5, else b(k) = 0.
G.f.: g(x) = Sum_{k>0} c(k)*x^k/(1-x), where c(k) = Sum_{j>1, j|k} floor(log_5(j)) - floor(log_5(j - 1)).
Recurrence:
a(n) = floor(n/5) + a(floor(n/5));
a(5*n) = n + a(n);
a(n*5^m) = n*(5^m-1)/4 + a(n).
a(k*5^m) = k*(5^m-1)/4, for 0 <= k < 5, m >= 0.
Asymptotic behavior:
a(n) = n/4 + O(log(n)),
a(n+1) - a(n) = O(log(n)), which follows from the inequalities below.
a(n) <= (n-1)/4; equality holds for powers of 5.
a(n) >= n/4 - 1 - floor(log_5(n)); equality holds for n = 5^m-1, m > 0.
lim inf (n/4 - a(n)) = 1/4, for n -> oo.
lim sup (n/4 - log_5(n) - a(n)) = 0, for n -> oo.
lim sup (a(n+1) - a(n) - log_5(n)) = 0, for n -> oo.
(End)
a(n) <= A027869(n). - Reinhard Zumkeller, Jan 27 2008
10^a(n) = A000142(n) / A004154(n). - Reinhard Zumkeller, Nov 24 2012
a(n) = Sum_{k=1..floor(n/2)} floor(log_5(n/k)). - Ammar Khatab, Feb 01 2025

Extensions

Examples added by Hieronymus Fischer, Jun 06 2012

A008905 Leading digit of n!.

Original entry on oeis.org

1, 1, 2, 6, 2, 1, 7, 5, 4, 3, 3, 3, 4, 6, 8, 1, 2, 3, 6, 1, 2, 5, 1, 2, 6, 1, 4, 1, 3, 8, 2, 8, 2, 8, 2, 1, 3, 1, 5, 2, 8, 3, 1, 6, 2, 1, 5, 2, 1, 6, 3, 1, 8, 4, 2, 1, 7, 4, 2, 1, 8, 5, 3, 1, 1, 8, 5, 3, 2, 1, 1, 8, 6, 4, 3, 2, 1, 1, 1, 8, 7, 5, 4, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 1
Offset: 0

Views

Author

Keywords

Comments

Kunoff proved that the distribution of terms of this sequence follows Benford's law, i.e., the asymptotic density of terms with value d (between 1 and 9) is log_10(1+1/d). - Amiram Eldar, Sep 23 2019

Crossrefs

Cf. A000966, A000142, A018799, A202021 (leading digit of (10^n)!), A213201.

Programs

  • Haskell
    a008905 = a000030 . a000142  -- Reinhard Zumkeller, Apr 08 2012
  • Mathematica
    f[n_] := Quotient[n!, 10^Floor@ Log[10, n!]]; Array[f, 105, 0]

Formula

a(n) = A000030(A000142(n)). - Reinhard Zumkeller, Apr 08 2012

Extensions

Two less-efficient Mathematica codings removed by Robert G. Wilson v, Nov 05 2010

A136774 n! never ends in this many 0's in base 16.

Original entry on oeis.org

62, 94, 110, 118, 126, 158, 174, 182, 190, 206, 214, 222, 230, 238, 254, 286, 302, 310, 318, 334, 342, 350, 358, 366, 382, 398, 406, 414, 422, 430, 446, 454, 462, 478, 510, 542, 558, 566, 574, 590, 598, 606, 614, 622, 638, 654, 662, 670, 678, 686, 702, 710
Offset: 1

Views

Author

Carl R. White, Jan 21 2008

Keywords

Crossrefs

Programs

  • PARI
    is(n)=my(t=4*n+2,s=1-hammingweight(n)); while(s<0, s+=valuation(t+=2,2)); s>3 \\ Charles R Greathouse IV, Sep 22 2016

Formula

Conjecture: a(n) ~ 16n. This holds with probability 1 in a random model. - Charles R Greathouse IV, Sep 22 2016

A136767 n! never ends in this many 0's in base 4.

Original entry on oeis.org

6, 10, 14, 18, 22, 29, 30, 34, 38, 45, 46, 53, 57, 61, 62, 66, 70, 77, 78, 85, 89, 93, 94, 101, 105, 109, 113, 117, 124, 125, 126, 130, 134, 141, 142, 149, 153, 157, 158, 165, 169, 173, 177, 181, 188, 189, 190, 197, 201, 205, 209, 213, 220, 221, 225, 229, 236
Offset: 1

Views

Author

Carl R. White, Jan 21 2008

Keywords

Crossrefs

A136773 n! never ends in this many 0's in base 13.

Original entry on oeis.org

13, 27, 41, 55, 69, 83, 97, 111, 125, 139, 153, 167, 181, 182, 196, 210, 224, 238, 252, 266, 280, 294, 308, 322, 336, 350, 364, 365, 379, 393, 407, 421, 435, 449, 463, 477, 491, 505, 519, 533, 547, 548, 562, 576, 590, 604, 618, 632, 646, 660, 674, 688, 702
Offset: 1

Views

Author

Carl R. White, Jan 21 2008

Keywords

Crossrefs

Programs

  • PARI
    valp(n, p)=my(s); while(n\=p, s+=n); s
    is(n)=my(t=(12*n-1)\13*13+13,s=valp(t,13)-n); while(s<0, s+=valuation(t+=13, 13)); s>0 \\ Charles R Greathouse IV, Oct 19 2016

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

A136768 n! never ends in this many 0's in base 7.

Original entry on oeis.org

7, 15, 23, 31, 39, 47, 55, 56, 64, 72, 80, 88, 96, 104, 112, 113, 121, 129, 137, 145, 153, 161, 169, 170, 178, 186, 194, 202, 210, 218, 226, 227, 235, 243, 251, 259, 267, 275, 283, 284, 292, 300, 308, 316, 324, 332, 340, 341, 349, 357, 365, 373, 381, 389, 397
Offset: 1

Views

Author

Carl R. White, Jan 21 2008

Keywords

Comments

Also: n! never ends in this many 0's in base 14, 21, 28 and all other 7-divisible proper factors of 7!

Crossrefs

A136769 n! never ends in this many 0's in base 8.

Original entry on oeis.org

4, 9, 20, 25, 30, 41, 62, 83, 84, 89, 94, 105, 110, 115, 126, 147, 168, 169, 190, 211, 222, 227, 232, 243, 248, 253, 254, 275, 296, 307, 312, 317, 328, 333, 338, 339, 340, 345, 350, 361, 366, 371, 382, 403, 424, 425, 430, 435, 446, 451, 456, 467, 488, 509, 510
Offset: 1

Views

Author

Carl R. White, Jan 21 2008

Keywords

Crossrefs

A136770 n! never ends in this many 0's in base 9.

Original entry on oeis.org

12, 19, 32, 39, 52, 59, 66, 79, 86, 99, 106, 119, 120, 133, 140, 153, 160, 173, 180, 181, 194, 201, 214, 221, 234, 241, 248, 261, 268, 281, 288, 301, 302, 315, 322, 335, 342, 355, 362, 363, 376, 383, 396, 403, 416, 423, 430, 443, 450, 463, 470, 483, 484, 497
Offset: 1

Views

Author

Carl R. White, Jan 21 2008

Keywords

Crossrefs

Programs

  • Mathematica
    Module[{nn=5000,zd},zd=Union[Table[Length[Last[Split[IntegerDigits[n!,9]]]],{n,nn}]];Complement[ Range[Max[zd]],zd]] (* Harvey P. Dale, Dec 26 2023 *)
Showing 1-10 of 16 results. Next