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.

Previous Showing 11-19 of 19 results.

A137581 Number of inner zeros in decimal representation of n!.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jan 27 2008

Keywords

Crossrefs

Programs

  • Haskell
    a137581 = a055641 . a004154  -- Reinhard Zumkeller, Apr 01 2015
  • Maple
    A137581:= proc(n) uses StringTools;
    CountCharacterOccurrences(TrimRight(SubstituteAll(
        convert(n!,string),"0"," "))," ")
    end proc; # Robert Israel, May 07 2012
  • Mathematica
    f[n_] := f[n] = Block[{a = n!}, While[Mod[a, 10] == 0, a = a/10]; Count[ IntegerDigits@a, 0]]; Table[f@n, {n, 0, 98}] (* Robert G. Wilson v, Jan 28 2008 *)
    Table[DigitCount[n!/10^IntegerExponent[n!,10],10,0],{n,0,100}] (* Harvey P. Dale, Apr 10 2023 *)

Formula

a(n) = A027869(n) - A027868(n);
a(A137582(n)) = 0.
a(n) = A055641(A004154(n)). - Reinhard Zumkeller, Apr 01 2015

A356757 Omit zero digits from factorial numbers.

Original entry on oeis.org

1, 1, 2, 6, 24, 12, 72, 54, 432, 36288, 36288, 399168, 47916, 622728, 871782912, 137674368, 2922789888, 35568742896, 64237375728, 121645148832, 243292817664, 5199421717944, 11247277776768, 258521673888497664, 624484173323943936, 15511214333985984, 4329146112665635584
Offset: 0

Views

Author

Stefano Spezia, Aug 26 2022

Keywords

Examples

			a(12) = 47916 since 12! = 479001600.
		

Crossrefs

Cf. A027869 (number of omitted zero digits), A356758 (number of nonzero digits).

Programs

  • Mathematica
    Table[FromDigits[Select[IntegerDigits[n!],Positive]], {n,0,26}]
  • PARI
    a(n) = fromdigits(select(x->(x>0), digits(n!))); \\ Michel Marcus, Aug 26 2022
    
  • Python
    from math import factorial
    def a(n): return int(str(factorial(n)).replace("0", ""))
    print([a(n) for n in range(27)]) # Michael S. Branicky, Aug 26 2022

Formula

a(n) = A004719(A000142(n)).

A367799 Ordinal transform of the final nonzero digit of the factorial numbers.

Original entry on oeis.org

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

Views

Author

Alois P. Heinz, Dec 07 2023

Keywords

Comments

n is the a(n)-th nonnegative integer producing value A008904(n).

Examples

			a(11) = 3 because 11! = 39916800 is the third factorial with final nonzero digit 8 after 9! = 362880 and 10! = 3628800. A008904(k) = 8 for k = 9, 10, 11, ... .
		

Crossrefs

Programs

  • Python
    from functools import reduce
    from itertools import count, islice
    from collections import Counter
    from sympy.ntheory.factor_ import digits
    def A367799_gen(): # generator of terms
        c = Counter()
        for n in count(0):
            c[m:=reduce(lambda x,y:x*y%10,(((6,2,4,8,6,2,4,8,2,4,8,6,6,2,4,8,4,8,6,2)[(a<<2)|(i*a&3)] if i*a else (1,1,2,6,4)[a]) for i, a in enumerate(digits(n,5)[-1:0:-1])),6) if n>1 else 1]+=1
            yield c[m]
    A367799_list = list(islice(A367799_gen(),50)) # Chai Wah Wu, Dec 08 2023

Formula

Ordinal transform of A008904.
a(n) = |{ j in {0..n} : A008904(j) = A008904(n) }|.

A375348 a(n) is the mode of the digits of n! not counting trailing zeros (using -1 if multimodal).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Inspired by A356758.
If we were to count trailing zeros, then would have a(n) = 0 for all n >= 34. Therefore we only consider the decimal digits of A004154(n).
Conjecture: excluding -1, as n -> oo, all digits occur equally often.

Examples

			a(0) = a(1) = 1 because 0! = 1! = 1 and 1 is the only digit present;
a(4) = -1 since 4! = 24 and there are only two digits appearing with the same frequency, 2 and 4.
a(14) = -1 because 14! = 87178291200 and, not counting the two trailing 0's, there are two 1's, two 2's, two 7's, and two 8's.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := If[Length[c=Commonest[IntegerDigits[n! / 10^IntegerExponent[n!]]]] > 1, -1, c[[1]]]; Array[a, 86, 0]
  • Python
    from collections import Counter
    from sympy import factorial
    def A375348(n): return -1 if len(k:=Counter(str(factorial(n)).rstrip('0')).most_common(2)) > 1 and k[0][1]==k[1][1] else int(k[0][0]) # Chai Wah Wu, Sep 15 2024

A374015 Residue modulo 5 of n! divided by the highest power of 10 which divides n!.

Original entry on oeis.org

1, 1, 2, 1, 4, 2, 2, 4, 2, 3, 3, 3, 1, 3, 2, 3, 3, 1, 3, 2, 4, 4, 3, 4, 1, 4, 4, 3, 4, 1, 3, 3, 1, 3, 2, 2, 2, 4, 2, 3, 2, 2, 4, 2, 3, 1, 1, 2, 1, 4, 2, 2, 4, 2, 3, 4, 4, 3, 4, 1, 1, 1, 2, 1, 4, 1, 1, 2, 1, 4, 3, 3, 1, 3, 2, 4, 4, 3, 4, 1, 3, 3, 1, 3, 2, 2, 2, 4, 2, 3, 2, 2, 4, 2, 3, 1, 1, 2, 1, 4, 4, 4, 3, 4, 1, 3
Offset: 0

Views

Author

Cezary Glowacz, Jun 25 2024

Keywords

Comments

The sequence is not eventually periodic. This because by induction on k the eventual period must be a multiple of 5^k for every k.
a(5^k) = 2^k mod 5.
From Cezary Glowacz, Feb 07 2025: (Start)
The proportions p(m,s) of counts of pairs of consecutive terms s among a(1),...,a(m) converge to equidistribution (and as an immediate consequence, so do proportions of individual terms).
This can be seen, for example, by stating p(5^(4(n+1)+1)-1,s) as affine functions of p(5^(4n+1)-1,t) and examining the convergence of p(5^(4n+1)-1,u) to the equidistribution. Then, p(m,s) converges to the equidistribution because the maximum over s of the absolute values of deviations from 1/16 of p(m,s) for m>k*5^(4n+1)-1 is less than the corresponding maximum over t for p(5^(4n+1)-1,t) plus 2/(5^(4n+1)) + 1/k.
Consecutive terms 1,2,3 do not occur, so that triples do not have a similar equidistribution.
(End)
If n > 0 is not divisible by 5, a(n) == n * a(n-1) (mod 5). - Robert Israel, Jul 05 2024

Examples

			a(5) = 1*2*3*4*5/10 mod 5 = 2.
		

Crossrefs

Programs

  • Maple
    a:= n-> (f-> irem(f/10^padic[ordp](f, 10), 5))(n!):
    seq(a(n), n=0..105);  # Alois P. Heinz, Jun 25 2024
  • Mathematica
    a[n_]:=Mod[n!/10^IntegerExponent[n!, 10],5]; Array[a,106,0] (* Stefano Spezia, Jun 25 2024 *)
  • PARI
    a(n)=if(n>4, my(k=n\5); return(lift((n%5)!*a(k)*Mod(2,5)^k))); n!%5 \\ Charles R Greathouse IV, Jan 24 2025
  • Python
    v=[[((1,1,2,1,4)[j]*2**(i*j))%5 for j in range(5)] for i in range(4)]
    def a(n):
        c,p=0,1
        while n: c,n,p=(c+1)%4,n//5,(v[c][n%5]*p)%5
        return(p) # Cezary Glowacz, Feb 05 2025
    

Formula

a(n) = A010874(A004154(n)).

A375575 a(n) is the least frequent digit of n! not counting trailing zeros, or -1 if there is more than one least frequent digit.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Analogous to A375348.
If we were to count trailing zeros, then a(n) would never equal zero, for all n's >= 0. Therefore we only consider the decimal digits of A004154.
Conjecture: excluding -1, as n -> oo, the digits distribution is uniform as in A375348.

Examples

			a(0) = a(1) = 1 because 0! = 1! = 1 and 1 is the only digit present;
a(4) = -1 since 4! = 24 and there are two least frequent digits, 2 and 4.
a(14) = 9 because 14! = 87178291200 and, not counting the two trailing 0's, there are two 1's, two 2's, two 7's, two 8's but only one 9.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local L,j;
      L:= convert(n!,base,10);
      for j from 1 while L[j] = 0 do od:
      L:= Statistics:-Tally(L[j...-1]);
      L:= sort(L,(a,b) -> rhs(a) < rhs(b));
      if nops(L) >= 2 and rhs(L[2]) = rhs(L[1]) then -1 else lhs(L[1]) fi
    end proc:
    map(f, [$0..100]); # Robert Israel, Sep 02 2024
  • Mathematica
    Rarest[lst_] := MinimalBy[ Tally[lst], Last][[All, 1]]; a[n_] := If[ Length[c = Rarest[ IntegerDigits[n!/10^IntegerExponent[n!, 10]] ]] >1, -1, c[[1]]]; Array[a, 80, 0]
  • Python
    from collections import Counter
    from sympy import factorial
    def A375575(n): return -1 if len(k:=Counter(str(factorial(n)).rstrip('0')).most_common()) > 1 and k[-1][1]==k[-2][1] else int(k[-1][0]) # Chai Wah Wu, Sep 15 2024

A045647 Numbers k such that k! stripped of trailing zeros ends in k.

Original entry on oeis.org

1, 2, 4, 792, 51648, 53824, 95328, 6460672, 54468608, 59854592, 7236791296
Offset: 1

Views

Author

Keywords

Crossrefs

Extensions

a(8)-a(10) from Robert Gerbicz, May 08 2008
a(11) from Amiram Eldar, Aug 08 2025

A086654 Smallest number a(n) > n such that a(n)! contains n! as a substring.

Original entry on oeis.org

1, 5, 4, 9, 20, 14, 40, 28, 434, 10, 1337, 354, 5370, 6180, 179472
Offset: 0

Views

Author

Erich Friedman, Sep 11 2003

Keywords

Comments

From Michael S. Branicky, Apr 11 2025: (Start)
500000 < a(15..20), with lower values ruled out by exhaustive search;
a(16) <= 80377420, a(17) <= 5770007, a(18) <= 674238256, with upper bound k achieved where A004154(k) ends with A004154(n). (End)

Examples

			a[5]=14 since 14!= 8717829_120_0.
		

Crossrefs

Formula

a(10^m-1) = 10^m, m >= 0. - Michael S. Branicky, Apr 10 2025

Extensions

a(13)-a(14) from Michael S. Branicky, Apr 10 2025

A375489 Omit the trailing zeros from double factorial of even numbers (A000165).

Original entry on oeis.org

1, 2, 8, 48, 384, 384, 4608, 64512, 1032192, 18579456, 37158912, 817496064, 19619905536, 510117543936, 14283291230208, 42849873690624, 1371195958099968, 46620662575398912, 1678343852714360832, 63777066403145711616, 255108265612582846464, 10714547155728479551488
Offset: 0

Views

Author

Stefano Spezia, Aug 18 2024

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:=2^n*n!/10^IntegerExponent[n!,10]; Array[a,22,0]

Formula

a(n) = A000165(n)/10^A027868(n).
a(n) = a(n-1)*(2*n)/10^A122840(2*n) for n > 0.
Previous Showing 11-19 of 19 results.