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
Antti Karttunen, Table of n, a(n) for n = 1..10000
FORMULA
PROG
(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