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.
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
Keywords
Examples
a(6) = 2 because A046021(6) = 9 = 3^2 = A006530(6)^2.
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
- Index entries for sequences related to factorial numbers.
Programs
-
Mathematica
With[{p=First[Last[FactorInteger[n, FactorComplete->True]]]}, 1+Sum[Floor[(n-1)/p^k], {k, Floor[Log[n-1]/Log[p]]}]]
-
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
Comments