A307907 a(n) is the greatest k such that p^k <= n for any prime factor p of n.
1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 2, 1, 1, 1, 4, 1, 2, 1, 1, 1, 1, 1, 2, 2, 1, 3, 1, 1, 2, 1, 5, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 3, 2, 2, 1, 1, 1, 3, 1, 2, 1, 1, 1, 2, 1, 1, 2, 6, 1, 1, 1, 1, 1, 2, 1, 3, 1, 1, 2, 1, 1, 1, 1, 2, 4, 1, 1, 2, 1, 1, 1, 1
Offset: 2
Keywords
Examples
For n = 12: - the prime factors of 12 are 2 and 3, - 2^2 < 3^2 <= 12 < 3^3, - hence a(12) = 2.
Links
Programs
-
Mathematica
Array[If[PrimeQ@ #, 1, Floor@ Log[FactorInteger[#][[-1, 1]], #]] &, 105, 2] (* Michael De Vlieger, May 08 2019 *)
-
PARI
a(n) = my (f=factor(n)); logint(n, f[#f~, 1])
-
Python
from sympy import integer_log, primefactors def A307907(n): return integer_log(n,max(primefactors(n)))[0] # Chai Wah Wu, Oct 12 2024