[go: up one dir, main page]

login
A081295
a(n) = (-1)^(n+1) * coefficient of x^n in Sum_{k>=1} x^k/(1+2*x^k).
7
1, 1, 5, 9, 17, 29, 65, 137, 261, 497, 1025, 2085, 4097, 8129, 16405, 32905, 65537, 130845, 262145, 524793, 1048645, 2096129, 4194305, 8390821, 16777233, 33550337, 67109125, 134225865, 268435457, 536855053, 1073741825, 2147516553, 4294968325, 8589869057
OFFSET
1,3
LINKS
FORMULA
a(n) = (-1)^(n+1) * [x^n]( Sum_{k>=1} x^k/(1+2*x^k) ).
a(p) = 2^(p-1) - 1, for p prime.
a(n) = (-1)^(n+1) * Sum_{d|n} (-2)^(d-1). - Robert Israel, Jun 04 2018
a(n) = (-1)^(n-1)*Sum_{k=1..n} (-1)^(k-1)*A128315(n, k). - G. C. Greubel, Jun 22 2024
MAPLE
f:= n -> (-1)^(n+1)*add((-2)^(d-1), d=numtheory:-divisors(n)):
map(f, [$1..100]); # Robert Israel, Jun 04 2018
MATHEMATICA
A081295[n_]:= (-1)^(n+1)*DivisorSum[n, (-2)^(#-1) &];
Table[A081295[n], {n, 40}] (* G. C. Greubel, Jun 22 2024 *)
PROG
(PARI) a(n) =if(n<1, 0, (-1)^(n+1)*polcoeff(sum(k=1, n, x^k/(1+2*x^k), x*O(x^n)), n))
(Magma)
A081295:= func< n | (-1)^(n+1)*(&+[(-2)^(d-1): d in Divisors(n)]) >;
[A081295(n): n in [1..40]]; // G. C. Greubel, Jun 22 2024
(SageMath)
def A081295(n): return (-1)^(n+1)*sum((-2)^(k-1) for k in (1..n) if (k).divides(n))
[A081295(n) for n in range(1, 41)] # G. C. Greubel, Jun 22 2024
CROSSREFS
Sequence in context: A190806 A294774 A192746 * A180565 A233187 A160426
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Apr 20 2003
STATUS
approved