login
A345109
a(n) = Sum_{k=1..n} (-2)^(n - floor(n/k)).
2
1, -1, 9, -11, 41, -87, 241, -367, 1185, -2207, 5441, -10431, 24961, -46207, 124161, -218879, 503297, -1028607, 2319361, -4275199, 10434561, -19826687, 43847681, -85651455, 191225857, -365699071, 849625089, -1588051967, 3444539393, -7070580735, 15214903297
OFFSET
1,3
LINKS
FORMULA
G.f.: (1/(1 + 2*x)) * Sum_{k>=1} (-2)^(k-1)*x^k * (1 - (-2*x)^k)/(1 - (-2)^(k-1)*x^k).
MATHEMATICA
a[n_] := Sum[(-2)^(n - Floor[n/k]), {k, 1, n}]; Array[a, 30] (* Amiram Eldar, Jun 08 2021 *)
PROG
(PARI) a(n) = sum(k=1, n, (-2)^(n-n\k));
(PARI) my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, (-2)^(k-1)*x^k*(1-(-2*x)^k)/(1-(-2)^(k-1)*x^k))/(1+2*x))
CROSSREFS
Sequence in context: A153697 A129399 A145790 * A143465 A201999 A195309
KEYWORD
sign
AUTHOR
Seiichi Manyama, Jun 08 2021
STATUS
approved