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.

A046021 Least inverse of the Kempner function A002034.

Original entry on oeis.org

1, 2, 3, 4, 5, 9, 7, 32, 27, 25, 11, 243, 13, 49, 125, 4096, 17, 2187, 19, 625, 343, 121, 23, 59049, 3125, 169, 177147, 2401, 29, 78125, 31, 134217728, 1331, 289, 16807, 43046721, 37, 361, 2197, 1953125, 41, 117649, 43, 14641, 9765625, 529, 47
Offset: 1

Views

Author

Keywords

Comments

To compute the n-th term for n > 1: For each prime p that divides n, find the highest power p^E(p) that divides (n-1)!. Then a(n) is the smallest of the numbers p^(E(p)+1). - Jonathan Sondow, Mar 03 2004
p^(E(p)+1) is smallest when p = P(n), the largest prime dividing n (since E(p) is approximately p^((n-1)/(p-1)), which decreases as p increases). So a(n) = P(n)^(E(P(n))+1) = A006530(n)^A102048(n) for n>1. - Jonathan Sondow, Dec 26 2004

References

  • R. L. Graham, D. E. Knuth and O. Patashnik, "Factorial Factors" Sect. 4.4 in Concrete Mathematics: A Foundation for Computer Science, 2nd ed. Reading, MA: Addison-Wesley, pp. 111-115, 1994.

Crossrefs

Programs

  • Mathematica
    With[{p=First[Last[FactorInteger[n, FactorComplete->True]]]}, p^(1+Sum[Floor[(n-1)/p^k], {k, Floor[Log[n-1]/Log[p]]}])] (* Jonathan Sondow, Dec 26 2004 *)
  • PARI
    A046021(n,p=A006530(n))=p^A102048(n,p) \\ M. F. Hasler, Nov 27 2018
    
  • Python
    from sympy import primefactors, integer_log
    def A046021(n):
        if n == 1: return 1
        p = max(primefactors(n))
        return p**sum(((n-1)//p**k for k in range(1,integer_log(n-1,p)[0]+1)),start=1) # Chai Wah Wu, Oct 17 2024

Formula

a(n) = P^(1+Sum(k=1 to [log(n-1)/log(P)], [(n-1)/P^k])) for n>1, where P = A006530(n) is the largest prime dividing n. E.g. a(6) = 9 because 9 is the least integer m with A002034(m) = 6, that is, m divides 6!, but m does not divide k! for k < 6. - Jonathan Sondow, Dec 26 2004

Extensions

More terms from David W. Wilson and Christian G. Bower, independently.