cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A081295 a(n) = (-1)^(n+1) * coefficient of x^n in Sum_{k>=1} x^k/(1+2*x^k).

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Apr 20 2003

Keywords

Crossrefs

Programs

  • 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
    
  • 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 *)
  • 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))
    
  • 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

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