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 21-23 of 23 results.

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

A332242 Numbers k such that k! has exactly k nonzero decimal digits.

Original entry on oeis.org

1, 48, 49, 53, 54, 57
Offset: 1

Views

Author

Chai Wah Wu, Feb 07 2020

Keywords

Comments

No other terms < 100000.
Conjecture: these 6 terms are the only terms of the sequence, i.e., there are no terms larger than 57.

Examples

			48! = 12413915592536072670862289047373375038521486354677760000000000 has 48 nonzero decimal digits, so 48 is a term.
		

Crossrefs

Programs

  • Maple
    q:= n-> nops(subs(0=NULL, convert(n!, base, 10)))=n:
    select(q, [$0..100])[];  # Alois P. Heinz, Feb 07 2020
  • PARI
    isok(k) = #select(x->(x != 0), digits(k!)) == k; \\ Michel Marcus, Feb 08 2020
  • Python
    A332242_list, i, n = [], 0, 1
    while i < 1000:
        s = str(n)
        if len(s) - s.count('0') == i:
            A332242_list.append(i)
        i += 1
        n *= i
    

Formula

{ k : A034886(k) - A027869(k) = k }.

A356739 a(n) is the smallest k such that k! has at least n consecutive zeros immediately after the leading digit in base 10.

Original entry on oeis.org

7, 153, 197, 7399, 24434, 24434, 9242360, 238861211, 238861211
Offset: 1

Views

Author

Christian Perfect, Aug 25 2022

Keywords

Examples

			a(1) = 7, because 7! = 5040 has one zero immediately after the leading digit, and there is no k<7 with that property.
		

Crossrefs

Programs

  • Python
    from itertools import count
    t = 1
    n = 1
    for k in count(1):
        t *= k
        while str(t)[1:1+n] == '0'*n:
            print(n,k)
            n += 1

Extensions

a(5)-a(6) from Amiram Eldar, Aug 25 2022
a(7)-a(9) from Jinyuan Wang, Aug 25 2022
Previous Showing 21-23 of 23 results.