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 A316524 #25 May 06 2022 15:25:31 %S A316524 0,1,2,0,3,-1,4,1,0,-2,5,2,6,-3,-1,0,7,1,8,3,-2,-4,9,-1,0,-5,2,4,10,2, %T A316524 11,1,-3,-6,-1,0,12,-7,-4,-2,13,3,14,5,3,-8,15,2,0,1,-5,6,16,-1,-2,-3, %U A316524 -6,-9,17,-1,18,-10,4,0,-3,4,19,7,-7,2,20,1,21,-11,2,8,-1,5,22,3,0,-12,23,-2,-4,-13,-8,-4,24 %N A316524 Signed sum over the prime indices of n. %C A316524 If n = prime(x_1) * prime(x_2) * prime(x_3) * ... * prime(x_k) then a(n) = x_1 - x_2 + x_3 - ... + (-1)^(k-1) x_k, where the x_i are weakly increasing positive integers. %C A316524 The value of a(n) depends only on the squarefree part of n, A007913(n). - _Antti Karttunen_, May 06 2022 %H A316524 Antti Karttunen, <a href="/A316524/b316524.txt">Table of n, a(n) for n = 1..16384</a> %H A316524 <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a> %F A316524 a(n) = A344616(n) * A344617(n) = a(A007913(n)). - _Antti Karttunen_, May 06 2022 %t A316524 Table[Sum[Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]][[k]]*(-1)^(k-1),{k,PrimeOmega[n]}],{n,100}] %o A316524 (PARI) a(n) = {my(f = factor(n), vp = []); for (k=1, #f~, for( j=1, f[k,2], vp = concat (vp, primepi(f[k,1])));); sum(k=1, #vp, vp[k]*(-1)^(k+1));} \\ _Michel Marcus_, Jul 06 2018 %o A316524 (Python) %o A316524 from sympy import factorint, primepi %o A316524 def A316524(n): %o A316524 fs = [primepi(p) for p in factorint(n,multiple=True)] %o A316524 return sum(fs[::2])-sum(fs[1::2]) # _Chai Wah Wu_, Aug 23 2021 %Y A316524 Cf. A000040, A000607, A007913, A071321, A100118, A175352, A316313, A316523. %Y A316524 Cf. A027746, A112798, A119899 (positions of negative terms). %Y A316524 Cf. A344616 (absolute values), A344617 (signs). %K A316524 sign %O A316524 1,3 %A A316524 _Gus Wiseman_, Jul 05 2018 %E A316524 More terms from _Antti Karttunen_, May 06 2022