login
A307908
a(n) is the least k such that p^k >= n for any prime factor p of n.
2
1, 1, 2, 1, 3, 1, 3, 2, 4, 1, 4, 1, 4, 3, 4, 1, 5, 1, 5, 3, 5, 1, 5, 2, 5, 3, 5, 1, 5, 1, 5, 4, 6, 3, 6, 1, 6, 4, 6, 1, 6, 1, 6, 4, 6, 1, 6, 2, 6, 4, 6, 1, 6, 3, 6, 4, 6, 1, 6, 1, 6, 4, 6, 3, 7, 1, 7, 4, 7, 1, 7, 1, 7, 4, 7, 3, 7, 1, 7, 4, 7, 1, 7, 3, 7, 5, 7
OFFSET
2,3
FORMULA
a(n) = ceiling(log(n)/log(A020639(n))).
a(p^k) = k for any prime number p and any k > 0.
0 <= k*a(n) - a(n^k) < k for any n > 1 and k > 0.
a(n) = 1 iff n is a prime number (A000040).
a(n) = 2 iff n is the square of a prime number (A001248).
EXAMPLE
For n = 12:
- the prime factors of 12 are 2 and 3,
- 3^4 > 2^4 >= 12 > 2^3,
- hence a(n) = 4.
MATHEMATICA
Array[If[PrimeQ@ #, 1, Ceiling@ Log[FactorInteger[#][[1, 1]], #]] &, 105, 2] (* Michael De Vlieger, May 08 2019 *)
PROG
(PARI) a(n) = my (f=factor(n)); logint(n, f[1, 1]) + if (#f~>1, 1, 0)
(Python)
from operator import sub
from sympy import integer_log, primefactors
def A307908(n): return 1+sub(*integer_log(n, min(primefactors(n)))) # Chai Wah Wu, Oct 12 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, May 05 2019
STATUS
approved