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 A071321 #24 Aug 23 2021 13:40:30 %S A071321 0,2,3,0,5,-1,7,2,0,-3,11,3,13,-5,-2,0,17,2,19,5,-4,-9,23,-1,0,-11,3, %T A071321 7,29,4,31,2,-8,-15,-2,0,37,-17,-10,-3,41,6,43,11,5,-21,47,3,0,2,-14, %U A071321 13,53,-1,-6,-5,-16,-27,59,-2,61,-29,7,0,-8 %N A071321 Alternating sum of all prime factors of n; primes nondecreasing, starting with the least prime factor: A020639(n). %C A071321 a(n) = 0 iff n square, a(A000290(n)) = 0; %C A071321 a(n) <= 0 iff A001222(n) is even; %C A071321 a(n) = n iff n prime, a(A000040(n)) = A000040(n). %C A071321 a(2n) = -a(n) + 2. - _Ralf Stephan_ %H A071321 Reinhard Zumkeller, <a href="/A071321/b071321.txt">Table of n, a(n) for n = 1..10000</a> %F A071321 a(n) = -A071322(n)*A008836(n). - _Franklin T. Adams-Watters_, Oct 18 2006 %e A071321 72 = 2*2*2*3*3, therefore a(72) = 2 - 2 + 2 - 3 + 3 = 2; %e A071321 90 = 2*3*3*5, therefore a(90) = 2 - 3 + 3 - 5 = -3. %t A071321 Join[{0},Table[Total[Times@@@Partition[Riffle[Flatten[Table[#[[1]],{#[[2]]}]&/@ FactorInteger[n]],{1,-1},{2,-1,2}],2]],{n,2,100}]] (* _Harvey P. Dale_, Sep 23 2015 *) %o A071321 (Haskell) %o A071321 a071321 1 = 0 %o A071321 a071321 n = sum $ zipWith (*) a033999_list $ a027746_row n %o A071321 -- _Reinhard Zumkeller_, Jun 01 2013 %o A071321 (Python) %o A071321 from sympy import factorint %o A071321 def A071321(n): %o A071321 fs = factorint(n,multiple=True) %o A071321 return sum(fs[::2])-sum(fs[1::2]) # _Chai Wah Wu_, Aug 23 2021 %Y A071321 Cf. A001414, A020639, A071322, A071323. %Y A071321 Cf. A008836. %Y A071321 Cf. A027746, A033999. %K A071321 sign %O A071321 1,2 %A A071321 _Reinhard Zumkeller_, May 18 2002