A166920 a(n) = 2^n - (1 + (-1)^n)/2.
0, 2, 3, 8, 15, 32, 63, 128, 255, 512, 1023, 2048, 4095, 8192, 16383, 32768, 65535, 131072, 262143, 524288, 1048575, 2097152, 4194303, 8388608, 16777215, 33554432, 67108863, 134217728, 268435455, 536870912, 1073741823, 2147483648, 4294967295
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..200
- Index entries for linear recurrences with constant coefficients, signature (2,1,-2).
Programs
-
Haskell
a166920 n = a166920_list !! n a166920_list = scanl (+) 0 a014551_list -- Reinhard Zumkeller, Jan 02 2013
-
Magma
[2^n -(1+(-1)^n)/2: n in [0..30]]; // Vincenzo Librandi, May 16 2011
-
Maple
A166920:=n->2^n-(1+(-1)^n)/2; seq(A166920(n), n=0..50); # Wesley Ivan Hurt, Nov 15 2013
-
Mathematica
LinearRecurrence[{2,1,-2},{0,2,3},40] (* Harvey P. Dale, Oct 16 2012 *)
-
PARI
a(n)=2^n-(1+(-1)^n)/2 \\ Charles R Greathouse IV, Oct 07 2015
Formula
G.f.: x*(2-x)/((1-x)*(1-2*x)*(1+x)).
a(n) = 2^n - (1+(-1)^n)/2.
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3).
a(n+1) - 2*a(n) = A168361(n).
E.g.f.: exp(2*x) - cosh(x). - G. C. Greubel, May 28 2016
a(n) = Sum_{k=1..n+1} Sum_{i=0..n+1} C(n-k,i). - Wesley Ivan Hurt, Sep 22 2017
Extensions
Edited and extended by R. J. Mathar, Mar 02 2010
Comments