OFFSET
1,1
COMMENTS
Only values in range {-2, -1, 0, +1, +2} occur.
LINKS
FORMULA
PROG
(PARI)
A000265(n) = (n>>valuation(n, 2));
A064989(n) = { my(f=factor(A000265(n))); for(i=1, #f~, f[i, 1] = precprime(f[i, 1]-1)); factorback(f); };
memoA353457 = Map();
A353457(n) = if(1==n, 1, my(v); if(mapisdefined(memoA353457, n, &v), v, v = -sumdiv(n, d, if(d<n, A353457(A064989(n/d))*A353457(d), 0)); mapput(memoA353457, n, v); (v)));
(Python)
from math import prod
from sympy import factorint, primepi
def A353459(n):
f = [(primepi(p)&1, -int(e==1)) for p, e in factorint(n).items()]
return prod(e for p, e in f if not p)+prod(e for p, e in f if p) # Chai Wah Wu, Jan 05 2023
CROSSREFS
KEYWORD
sign
AUTHOR
Antti Karttunen, Apr 21 2022
STATUS
approved