OFFSET
1,2
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.
LINKS
Charlie Neder, Table of n, a(n) for n = 1..1000
J. Sondow and E. W. Weisstein, MathWorld: Smarandache Function.
Eric Weisstein's World of Mathematics, Greatest Prime Factor.
Eric Weisstein's World of Mathematics, Factorial.
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
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
EXTENSIONS
More terms from David W. Wilson and Christian G. Bower, independently.
STATUS
approved