login
A286469
a(n) = maximum of {the index of least prime dividing n} and {the maximal gap between indices of the successive primes in the prime factorization of n}.
20
0, 1, 2, 1, 3, 1, 4, 1, 2, 2, 5, 1, 6, 3, 2, 1, 7, 1, 8, 2, 2, 4, 9, 1, 3, 5, 2, 3, 10, 1, 11, 1, 3, 6, 3, 1, 12, 7, 4, 2, 13, 2, 14, 4, 2, 8, 15, 1, 4, 2, 5, 5, 16, 1, 3, 3, 6, 9, 17, 1, 18, 10, 2, 1, 3, 3, 19, 6, 7, 2, 20, 1, 21, 11, 2, 7, 4, 4, 22, 2, 2, 12, 23, 2, 4, 13, 8, 4, 24, 1, 4, 8, 9, 14, 5, 1, 25, 3, 3, 2, 26, 5, 27, 5, 2, 15, 28, 1, 29, 2, 10, 3
OFFSET
1,3
COMMENTS
This gives the maximal gap between the indices of successive prime factors p_i <= p_j <= ... <= p_k of n = p_i * p_j * ... * p_k when the index of the least prime factor p_i (A055396) is considered as the initial gap from the "level zero".
LINKS
FORMULA
a(n) = max(A055396(n), A286470(n)).
a(n) = A051903(A122111(n)).
For all i, j: A286621(i) = A286621(j) => a(i) = a(j). [Because of the above formula.]
PROG
(Scheme) (define (A286469 n) (max (A055396 n) (A286470 n)))
(Python)
from sympy import primepi, isprime, primefactors, divisors
def a049084(n): return primepi(n)*(1*isprime(n))
def a055396(n): return 0 if n==1 else a049084(min(primefactors(n)))
def x(n): return 1 if n==1 else divisors(n)[-2]
def a286470(n): return 0 if n==1 or len(primefactors(n))==1 else max(a055396(x(n)) - a055396(n), a286470(x(n)))
def a(n): return max(a055396(n), a286470(n)) # Indranil Ghosh, May 17 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 14 2017, definition corrected May 17 2017.
STATUS
approved