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.

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