OFFSET
1,2
COMMENTS
LINKS
Shreyansh Jaiswal, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Harvey P. Dale).
EXAMPLE
72 = 2*2*2*3*3, therefore a(72) = 3 - 3 + 2 - 2 + 2 = 2;
90 = 2*3*3*5, therefore a(90) = 5 - 3 + 3 - 2 = 3.
MATHEMATICA
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 *)
PROG
(Python)
from sympy import factorint
def c(n):
fs = factorint(n, multiple=True)
return sum(fs[::2])-sum(fs[1::2])
for n in range(1, 75):
print(abs(c(n)), end=", ") #Shreyansh Jaiswal, Apr 16 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, May 18 2002
STATUS
approved
