login
A358276
a(1) = 1; a(n) = n * Sum_{d|n, d < n} (-1)^(n/d - 1) * a(d) / d.
2
1, -2, 3, 0, 5, -18, 7, 0, 18, -30, 11, 24, 13, -42, 45, 0, 17, -144, 19, 40, 63, -66, 23, 0, 50, -78, 108, 56, 29, -390, 31, 0, 99, -102, 105, 360, 37, -114, 117, 0, 41, -546, 43, 88, 360, -138, 47, 0, 98, -400, 153, 104, 53, -1080, 165, 0, 171, -174, 59, 1080, 61, -186, 504, 0, 195, -858, 67, 136
OFFSET
1,2
LINKS
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