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}.
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
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..10000
Programs
-
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
-
Scheme
(define (A286469 n) (max (A055396 n) (A286470 n)))
Formula
Extensions
Definition corrected May 17 2017
Comments