login
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

%I #18 May 17 2017 17:54:23

%S 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,

%T 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,

%U 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

%N 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}.

%C 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".

%H Antti Karttunen, <a href="/A286469/b286469.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = max(A055396(n), A286470(n)).

%F a(n) = A051903(A122111(n)).

%F For all i, j: A286621(i) = A286621(j) => a(i) = a(j). [Because of the above formula.]

%o (Scheme) (define (A286469 n) (max (A055396 n) (A286470 n)))

%o (Python)

%o from sympy import primepi, isprime, primefactors, divisors

%o def a049084(n): return primepi(n)*(1*isprime(n))

%o def a055396(n): return 0 if n==1 else a049084(min(primefactors(n)))

%o def x(n): return 1 if n==1 else divisors(n)[-2]

%o def a286470(n): return 0 if n==1 or len(primefactors(n))==1 else max(a055396(x(n)) - a055396(n), a286470(x(n)))

%o def a(n): return max(a055396(n), a286470(n)) # _Indranil Ghosh_, May 17 2017

%Y Cf. A051903, A055396, A122111, A286470, A286621.

%K nonn

%O 1,3

%A _Antti Karttunen_, May 14 2017, definition corrected May 17 2017.