OFFSET
1,2
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = n * A308077(n).
If p is prime, a(p) = (-1)^(p-1) * p.
G.f. A(x) satisfies A(x) = x - Sum_{k>=2} (-1)^k * k * A(x^k).
MAPLE
b:= proc(n) option remember; `if`(n<2, n, add(b(n/d)*
(-1)^(d-1), d=numtheory[divisors](n) minus {1}))
end:
a:= n-> n*b(n):
seq(a(n), n=1..68); # Alois P. Heinz, Mar 30 2023
MATHEMATICA
a[1] = 1; a[n_] := a[n] = n * DivisorSum[n, (-1)^(n/# - 1) * a[#]/# &, # < n &]; Array[a, 100] (* Amiram Eldar, Jul 31 2023 *)
PROG
(PARI) a(n) = if (n==1, 1, n*sumdiv(n, d, if (d<n, (-1)^(n/d-1)*a(d)/d))); \\ Michel Marcus, Mar 30 2023
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Seiichi Manyama, Mar 30 2023
STATUS
approved