login
A345034
a(n) = Sum_{k=1..n} (-2)^(floor(n/k) - 1).
4
1, -1, 6, -8, 17, -27, 70, -136, 255, -491, 1046, -2082, 4063, -8131, 16476, -32882, 65423, -130845, 262372, -524818, 1048149, -2096045, 4195412, -8390820, 16775029, -33550477, 67113210, -134225588, 268427597, -536854983, 1073757754, -2147517076
OFFSET
1,3
LINKS
FORMULA
G.f.: (1/(1 - x)) * Sum_{k>=1} x^k * (1 - x^k)/(1 + 2*x^k).
MATHEMATICA
a[n_] := Sum[(-2)^(Floor[n/k] - 1), {k, 1, n}]; Array[a, 30] (* Amiram Eldar, Jun 06 2021 *)
PROG
(PARI) a(n) = sum(k=1, n, (-2)^(n\k-1));
(PARI) my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, x^k*(1-x^k)/(1+2*x^k))/(1-x))
CROSSREFS
Column k=2 of A345033.
Sequence in context: A025081 A162951 A032411 * A058098 A112158 A270046
KEYWORD
sign
AUTHOR
Seiichi Manyama, Jun 06 2021
STATUS
approved