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.

A248155 Expansion of (1 + x - x^2)/((1 + x)*(1 + 2*x)).

Original entry on oeis.org

1, -2, 3, -5, 9, -17, 33, -65, 129, -257, 513, -1025, 2049, -4097, 8193, -16385, 32769, -65537, 131073, -262145, 524289, -1048577, 2097153, -4194305, 8388609, -16777217, 33554433, -67108865, 134217729, -268435457, 536870913
Offset: 0

Views

Author

Wolfdieter Lang, Oct 04 2014

Keywords

Comments

Alternating row sums of A105810.
Riordan triangle ((1 + x - x^2)/(1 + x)^2, x/(1 + x)).

Crossrefs

Programs

  • Magma
    A248155:= func< n | n eq 0 select 1 else (-1)^n*(2^(n-1) + 1) >;
    [A248155(n): n in [0..50]]; // G. C. Greubel, May 30 2025
    
  • Mathematica
    Table[((-1)^n*(2^n+2) - Boole[n==0])/2, {n,0,50}] (* G. C. Greubel, May 30 2025 *)
  • PARI
    Vec((1 + x - x^2)/((1 + x)*(1 + 2*x)) + O (x^40)) \\ Michel Marcus, Oct 11 2014
    
  • Python
    def A248155(n): return ((-1)**n*(2 + 2**n) - int(n==0))//2
    print([A248155(n) for n in range(51)]) # G. C. Greubel, May 30 2025

Formula

O.g.f.: (1+x-x^2)/((1+x)*(1+2*x)).
a(n) = (3/2)*b(n) + (5/2)*b(n-1), n>=1, a(0) = 1, with b(n) = A225883(n+1).
a(n) = (-1)^n*(1 + 2^(n-1)), n>=1, a(0) = 1.
E.g.f.: 2*exp(-x)*(cosh(x/2))^2 - 1. - G. C. Greubel, May 30 2025