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.

A318725 a(n) is the smallest number k such that k! is pandigital in base n.

Original entry on oeis.org

2, 8, 5, 11, 17, 14, 15, 23, 23, 24, 36, 30, 35, 46, 50, 43, 50, 40, 59, 62, 54, 69, 75, 70, 65, 79, 83, 68, 97, 99, 86, 89, 93, 97, 118, 94, 106, 126, 128, 116, 145, 127, 134, 151, 143, 124, 141, 124, 141, 170, 194, 169, 190, 183, 181, 180, 195, 195, 210, 163
Offset: 2

Views

Author

Jon E. Schoenfield, Sep 02 2018

Keywords

Examples

			a(2) = 2! = 2_10 = 10_2;
a(3) = 8! = 40320_10 = 2001022100_3;
a(4) = 5! = 120_10 = 1320_4.
a(5) = 11! = 39916800_10 = 4020431420_5;
a(6) = 17! = 355687428096000_10 = 3300252314304000000_6.
		

Crossrefs

Cf. A049363 (smallest pandigital number in base n), A185122 (smallest pandigital prime in base n), A260182 (smallest square that is pandigital in base n), A260117 (smallest triangular number that is pandigital in base n).

Programs

  • PARI
    a(n) = {my(k=1); while (#Set(digits(k!, n)) != n, k++); k;} \\ Michel Marcus, Sep 02 2018
    
  • Python
    from itertools import count
    from sympy.ntheory import digits
    def A318725(n):
        c, flag = 1, False
        for k in count(1):
            m = k
            if flag:
                a, b = divmod(m,n)
                while not b:
                    m = a
                    a, b = divmod(m,n)
            c *= m
            if len(set(digits(c,n)[1:]))==n:
                return k
            if not (flag or c%n):
                flag = True # Chai Wah Wu, Mar 13 2024