login
A343370
a(1) = 1; a(n) = Sum_{d|n, d < n} (-1)^d * a(d).
3
1, -1, -1, -2, -1, -1, -1, -4, 0, -1, -1, -4, -1, -1, 1, -8, -1, -2, -1, -4, 1, -1, -1, -12, 0, -1, 0, -4, -1, -3, -1, -16, 1, -1, 1, -10, -1, -1, 1, -12, -1, -3, -1, -4, 0, -1, -1, -32, 0, -2, 1, -4, -1, -4, 1, -12, 1, -1, -1, -16, -1, -1, 0, -32, 1, -3, -1, -4, 1, -3, -1, -36, -1, -1, 0, -4, 1, -3, -1, -32, 0
OFFSET
1,4
FORMULA
G.f.: x + Sum_{n>=1} (-1)^n * a(n) * x^(2*n) / (1 - x^n).
MAPLE
a:= proc(n) option remember; `if`(n<2, 1,
add((-1)^d*a(d), d=numtheory[divisors](n) minus {n}))
end:
seq(a(n), n=1..70); # Alois P. Heinz, Apr 12 2021
MATHEMATICA
a[1] = 1; a[n_] := a[n] = Sum[If[d < n, (-1)^d a[d], 0], {d, Divisors[n]}]; Table[a[n], {n, 70}]
PROG
(PARI)
memoA343370 = Map();
A343370(n) = if(1==n, 1, my(v); if(mapisdefined(memoA343370, n, &v), v, v = sumdiv(n, d, if(d<n, ((-1)^d)*A343370(d), 0)); mapput(memoA343370, n, v); (v))); \\ Antti Karttunen, Jan 02 2023
CROSSREFS
Cf. A008683, A053850 (positions of 0's), A056913 (positions of 1's), A067856, A074206, A307778, A308077, A325144.
Sequence in context: A294616 A085384 A067856 * A160467 A353573 A345000
KEYWORD
sign
AUTHOR
Ilya Gutkovskiy, Apr 12 2021
EXTENSIONS
Data section extended up to a(81) by Antti Karttunen, Jan 02 2023
STATUS
approved