OFFSET
1,8
COMMENTS
Used for computing A208133.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
EXAMPLE
For n = 216 = 2^3 * 3^3, a(2^3) * a(3^3) = -2 * -2 = 4.
MATHEMATICA
f[p_, e_] := Switch[e, 2, 1, 3, -2, _, 0]; a[n_] := Times @@ f @@@ FactorInteger[n]; a[1] = 1; Array[a, 100] (* Amiram Eldar, Sep 05 2023 *)
PROG
(PARI) A300828(n) = { if(1==n, return(1)); my(val=1, v=factor(n), d=matsize(v)[1]); for(i=1, d, if(v[i, 2] < 2 || v[i, 2] > 3, return(0)); if (v[i, 2] == 3, val *= -2)); return(val); }; \\ R. J. Mathar, Antti Karttunen, Mar 21 2018
(Scheme, with memoization-macro definec)
CROSSREFS
KEYWORD
sign,easy,mult
AUTHOR
Antti Karttunen, Mar 21 2018
STATUS
approved