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.

Previous Showing 11-11 of 11 results.

A303611 a(n) = (-1 - (-2)^(n-2)) mod 2^n.

Original entry on oeis.org

2, 1, 11, 7, 47, 31, 191, 127, 767, 511, 3071, 2047, 12287, 8191, 49151, 32767, 196607, 131071, 786431, 524287, 3145727, 2097151, 12582911, 8388607, 50331647, 33554431, 201326591, 134217727, 805306367, 536870911, 3221225471, 2147483647, 12884901887, 8589934591
Offset: 2

Views

Author

Vincenzo Librandi, May 07 2018

Keywords

Comments

A198693 and A083420 interleaved. From 11 onwards, apparently A283651 and A290195 contain the same terms. - Bruno Berselli, May 07 2018

Crossrefs

All terms belong to A052955 and A180516.

Programs

  • Magma
    [IsOdd(n) select 2^(n-2)-1 else 3*2^(n-2)-1: n in [2..40]];
    
  • Magma
    I:=[2,1,11]; [n le 3 select I[n] else Self(n-1)+4*Self(n-2)-4*Self(n-3): n in [1..35]];
    
  • Mathematica
    Table[If[OddQ[n], 2^(n - 2) - 1, 3 2^(n - 2) - 1], {n, 2, 80}]
    LinearRecurrence[{1, 4, -4}, {2, 1, 11}, 30]
  • PARI
    a(n) = if (n%2, 2^(n-2) - 1, 3*2^(n-2) - 1); \\ Michel Marcus, May 30 2018

Formula

a(n) = 2^(n-2) - 1 for odd n, otherwise a(n) = 3*2^(n-2) - 1, with n>1.
From Bruno Berselli, May 07 2018: (Start)
O.g.f.: x^2*(2 - x + 2*x^2)/((1 - x)*(1 - 2*x)*(1 + 2*x)).
E.g.f.: (1 + 2*x - 4*exp(x) + exp(-2*x) + 2*exp(2*x))/4.
a(n) = a(n-1) + 4*a(n-2) - 4*a(n-3).
a(n) = (2 + (-1)^n)*2^(n-2) - 1. (End)
Previous Showing 11-11 of 11 results.