cp's OEIS Frontend

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.

A071322 Alternating sum of all prime factors of n; primes nonincreasing, starting with the largest prime factor: A006530(n).

This page as a plain text file.
%I A071322 #20 Apr 23 2025 17:47:05
%S A071322 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,7,29,4,
%T A071322 31,2,8,15,2,0,37,17,10,3,41,6,43,11,5,21,47,3,0,2,14,13,53,1,6,5,16,
%U A071322 27,59,2,61,29,7,0,8,10,67,17,20,4,71,2,73,35
%N A071322 Alternating sum of all prime factors of n; primes nonincreasing, starting with the largest prime factor: A006530(n).
%C A071322 a(n) = 0 iff n square, a(A000290(n)) = 0;
%C A071322 a(n) = n iff n prime, a(A000040(n)) = A000040(n).
%H A071322 Shreyansh Jaiswal, <a href="/A071322/b071322.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from Harvey P. Dale).
%e A071322 72 = 2*2*2*3*3, therefore a(72) = 3 - 3 + 2 - 2 + 2 = 2;
%e A071322 90 = 2*3*3*5, therefore a(90) = 5 - 3 + 3 - 2 = 3.
%t A071322 aspf[n_]:=Total[Times@@@Partition[Riffle[Reverse[Flatten[Table[#[[1]],{#[[2]]}]&/@FactorInteger[n]]],{1,-1},{2,-1,2}],2]]; Join[{0}, Array[ aspf,80,2]] (* _Harvey P. Dale_, Apr 19 2015 *)
%o A071322 (Python)
%o A071322 from sympy import factorint
%o A071322 def c(n):
%o A071322     fs = factorint(n, multiple=True)
%o A071322     return sum(fs[::2])-sum(fs[1::2])
%o A071322 for n in range(1,75):
%o A071322     print(abs(c(n)), end=", ") #_Shreyansh Jaiswal_, Apr 16 2025
%Y A071322 Cf. A001414, A071324, a(n) = abs(A071321(n)).
%K A071322 nonn
%O A071322 1,2
%A A071322 _Reinhard Zumkeller_, May 18 2002