This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A242411 #20 May 20 2017 10:22:39 %S A242411 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, %T A242411 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, %U A242411 7,1,0,1,0,11,1,7,1,4,0,2,0,12,0,2,4,13,8,4,0 %N 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)). %H A242411 Antti Karttunen, <a href="/A242411/b242411.txt">Table of n, a(n) for n = 1..10000</a> %H A242411 <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a> %F A242411 If A001221(n) = 1, then a(n) = 0, otherwise a(n) = A241919(n) = A061395(n) - A061395(A051119(n)). %o A242411 (Scheme) (define (A242411 n) (if (= 1 (A001221 n)) 0 (- (A061395 n) (A061395 (A051119 n))))) %o A242411 (Haskell) %o A242411 a242411 1 = 0 %o A242411 a242411 n = i - j where %o A242411 (i:j:_) = map a049084 $ ps ++ [p] %o A242411 ps@(p:_) = reverse $ a027748_row n %o A242411 -- _Reinhard Zumkeller_, May 15 2014 %o A242411 (Python) %o A242411 from sympy import factorint, primefactors, primepi %o A242411 def a061395(n): return 0 if n==1 else primepi(primefactors(n)[-1]) %o A242411 def a053585(n): %o A242411 if n==1: return 1 %o A242411 p = primefactors(n)[-1] %o A242411 return p**factorint(n)[p] %o A242411 def a051119(n): return n/a053585(n) %o A242411 def a(n): return 0 if n==1 or len(primefactors(n))==1 else a061395(n) - a061395(a051119(n)) # _Indranil Ghosh_, May 19 2017 %Y A242411 Cf. A000961 (positions of zeros). %Y A242411 Cf. A241917, A241919, A051119, A061395. %Y A242411 Cf. A049084, A027748. %K A242411 nonn %O A242411 1,10 %A A242411 _Antti Karttunen_, May 13 2014