login
A242411
If n is a prime power, p_i^e, a(n) = 0, otherwise difference (i-j) of the indices of the two largest distinct primes p_i, p_j, i > j in the prime factorization of n: a(n) = A061395(n) - A061395(A051119(n)).
9
0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 1, 0, 3, 1, 0, 0, 1, 0, 2, 2, 4, 0, 1, 0, 5, 0, 3, 0, 1, 0, 0, 3, 6, 1, 1, 0, 7, 4, 2, 0, 2, 0, 4, 1, 8, 0, 1, 0, 2, 5, 5, 0, 1, 2, 3, 6, 9, 0, 1, 0, 10, 2, 0, 3, 3, 0, 6, 7, 1, 0, 1, 0, 11, 1, 7, 1, 4, 0, 2, 0, 12, 0, 2, 4, 13, 8, 4, 0
OFFSET
1,10
FORMULA
If A001221(n) = 1, then a(n) = 0, otherwise a(n) = A241919(n) = A061395(n) - A061395(A051119(n)).
PROG
(Scheme) (define (A242411 n) (if (= 1 (A001221 n)) 0 (- (A061395 n) (A061395 (A051119 n)))))
(Haskell)
a242411 1 = 0
a242411 n = i - j where
(i:j:_) = map a049084 $ ps ++ [p]
ps@(p:_) = reverse $ a027748_row n
-- Reinhard Zumkeller, May 15 2014
(Python)
from sympy import factorint, primefactors, primepi
def a061395(n): return 0 if n==1 else primepi(primefactors(n)[-1])
def a053585(n):
if n==1: return 1
p = primefactors(n)[-1]
return p**factorint(n)[p]
def a051119(n): return n/a053585(n)
def a(n): return 0 if n==1 or len(primefactors(n))==1 else a061395(n) - a061395(a051119(n)) # Indranil Ghosh, May 19 2017
CROSSREFS
Cf. A000961 (positions of zeros).
Sequence in context: A349395 A087073 A297173 * A286470 A243055 A359358
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 13 2014
STATUS
approved