|
|
A349789
|
|
a(1) = 1; a(n) = -Sum_{d|n, d < n} gpf(n/d) * a(d).
|
|
2
|
|
|
1, -2, -3, 2, -5, 9, -7, -2, 6, 15, -11, -15, -13, 21, 25, 2, -17, -27, -19, -25, 35, 33, -23, 21, 20, 39, -12, -35, -29, -105, -31, -2, 55, 51, 63, 66, -37, 57, 65, 35, -41, -147, -43, -55, -80, 69, -47, -27, 42, -85, 85, -65, -53, 72, 99, 49, 95, 87, -59, 245
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
|
|
LINKS
|
|
|
FORMULA
|
a(n) = -n iff n is prime.
a(2^k) = (-1)^k * 2 for k > 0. (End)
|
|
MATHEMATICA
|
a[1] = 1; a[n_] := a[n] = -Sum[(FactorInteger[n/d][[-1, 1]]) a[d], {d, Most @ Divisors[n]}]; Table[a[n], {n, 1, 60}]
|
|
PROG
|
(PARI)
A006530(n) = if(1==n, n, my(f=factor(n)); f[#f~, 1]);
memoA349789 = Map();
A349789(n) = if(1==n, 1, my(v); if(mapisdefined(memoA349789, n, &v), v, v = -sumdiv(n, d, if(d<n, A006530(n/d)*A349789(d), 0)); mapput(memoA349789, n, v); (v))); \\ Antti Karttunen, Dec 05 2021
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|