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.

This page as a plain text file.
%I A004154 #49 Apr 11 2025 14:27:31
%S A004154 1,1,2,6,24,12,72,504,4032,36288,36288,399168,4790016,62270208,
%T A004154 871782912,1307674368,20922789888,355687428096,6402373705728,
%U A004154 121645100408832,243290200817664,5109094217170944,112400072777760768,2585201673888497664,62044840173323943936
%N A004154 a(n) = n! with trailing zeros omitted.
%H A004154 Reinhard Zumkeller, <a href="/A004154/b004154.txt">Table of n, a(n) for n = 0..250</a>
%H A004154 <a href="/index/Fa#factorial">Index entries for sequences related to factorial numbers</a>
%F A004154 a(n) = A000142(n) / 10^A027868(n). - _Reinhard Zumkeller_, Nov 24 2012
%F A004154 a(n+1) = A004151((n+1)*a(n)). - _Reinhard Zumkeller_, Nov 24 2012, corrected by _M. F. Hasler_, Oct 16 2014
%F A004154 a(n) = A004151(A000142(n)) = A000142(n)/A011557(A112765(n)), or A122840 instead of A112765. - _M. F. Hasler_, Oct 16 2014
%p A004154 a:= n-> (f-> f/10^padic[ordp](f,10))(n!):
%p A004154 seq(a(n), n=0..29);  # _Alois P. Heinz_, Dec 29 2021
%t A004154 Array[#!//.x_/;x~Mod~5==0:>x/10&,22]  (* _Giorgos Kalogeropoulos_, Aug 17 2020 *)
%t A004154 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 *)
%o A004154 (Haskell)
%o A004154 a004154 = a004151 . a000142
%o A004154 a004154_list = scanl (\u v -> a004151 $ u * v) 1 [1..]
%o A004154 -- _Reinhard Zumkeller_, Nov 24 2012
%o A004154 (PARI) a(n)=n!/10^valuation(n!,5) \\ _M. F. Hasler_, Oct 16 2014
%o A004154 (Magma) [Factorial(n)/10^Valuation(Factorial(n), 5): n in [0..30]]; // _Vincenzo Librandi_, Oct 16 2014
%o A004154 (Python)
%o A004154 from sympy import factorial
%o A004154 from sympy.ntheory.factor_ import digits
%o A004154 def A004154(n): return factorial(n)//10**(n-sum(digits(n,5)[1:])>>2) # _Chai Wah Wu_, Oct 18 2024
%o A004154 (Python)
%o A004154 from itertools import count, islice
%o A004154 def agen(): # generator of terms
%o A004154     f = 1
%o A004154     for n in count(1):
%o A004154         yield f
%o A004154         while n%10 == 0: n //= 10
%o A004154         f *= n
%o A004154         while f%10 == 0: f //= 10
%o A004154 print(list(islice(agen(), 25))) # _Michael S. Branicky_, Apr 11 2025
%Y A004154 Cf. A000142, A004151, A008904 (mod 10).
%K A004154 nonn,base
%O A004154 0,3
%A A004154 _N. J. A. Sloane_