login
A102048
Exponent of A046021(n) (least inverse of Kempner function A002034) when written as a power of A006530(n) (largest prime dividing n), with a(1) = 1.
2
1, 1, 1, 2, 1, 2, 1, 5, 3, 2, 1, 5, 1, 2, 3, 12, 1, 7, 1, 4, 3, 2, 1, 10, 5, 2, 11, 4, 1, 7, 1, 27, 3, 2, 5, 16, 1, 2, 3, 9, 1, 6, 1, 4, 10, 2, 1, 22, 7, 11, 3, 4, 1, 24, 5, 9, 3, 2, 1, 14, 1, 2, 10, 58, 5, 6, 1, 4, 3, 11, 1, 33, 1, 2, 17, 4, 7, 6, 1, 19, 37, 2, 1, 13, 5, 2, 3, 8, 1, 21, 7, 4, 3, 2, 5
OFFSET
1,4
REFERENCES
R. L. Graham, D. E. Knuth and O. Patashnik, Factorial Factors, Section 4.4 in Concrete Mathematics, 2nd ed. Reading, MA: Addison-Wesley, pp. 111-115, 1994.
LINKS
Eric Weisstein's World of Mathematics, Greatest Prime Factor
Eric Weisstein's World of Mathematics, Factorial
FORMULA
a(n) = log(A046021(n))/log(A006530(n)) for n > 1.
a(n) = 1 + Sum_{k=1..floor(log(n-1)/log(P))} floor((n-1)/P^k) for n > 1, where P = A006530(n) is the greatest prime factor of n.
EXAMPLE
a(6) = 2 because A046021(6) = 9 = 3^2 = A006530(6)^2.
MATHEMATICA
With[{p=First[Last[FactorInteger[n, FactorComplete->True]]]}, 1+Sum[Floor[(n-1)/p^k], {k, Floor[Log[n-1]/Log[p]]}]]
PROG
(PARI) A102048(n, p=A006530(n))=1+if(n>1, sum(k=1, logint(n-=1, p), n\p^k)) \\ M. F. Hasler, Nov 27 2018
(Python)
from sympy import primefactors, integer_log
def A102048(n):
if n == 1: return 1
p = max(primefactors(n))
return 1+sum((n-1)//p**k for k in range(1, integer_log(n-1, p)[0]+1)) # Chai Wah Wu, Oct 17 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Jonathan Sondow, Dec 26 2004
STATUS
approved