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.

Showing 1-8 of 8 results.

A048573 a(n) = a(n-1) + 2*a(n-2), a(0)=2, a(1)=3.

Original entry on oeis.org

2, 3, 7, 13, 27, 53, 107, 213, 427, 853, 1707, 3413, 6827, 13653, 27307, 54613, 109227, 218453, 436907, 873813, 1747627, 3495253, 6990507, 13981013, 27962027, 55924053, 111848107, 223696213, 447392427, 894784853, 1789569707, 3579139413, 7158278827, 14316557653
Offset: 0

Views

Author

Michael Somos, Jun 17 1999

Keywords

Comments

Number of positive integers requiring exactly n signed bits in the modified non-adjacent form representation. - Ralf Stephan, Aug 02 2003
The n-th entry (n>1) of the sequence is equal to the 1,1-entry of the n-th power of the unnormalized 4 X 4 Haar matrix: [1 1 1 0 / 1 1 -1 0 / 1 1 0 1 / 1 1 0 -1]. - Simone Severini, Oct 27 2004
Pisano period lengths: 1, 1, 6, 2, 2, 6, 6, 2, 18, 2, 10, 6, 12, 6, 6, 2, 8, 18, 18, 2, ... - R. J. Mathar, Aug 10 2012
For n >= 1, a(n) is the number of ways to tile a strip of length n+2 with blue squares and blue and red dominos, with the restriction that the first two tiles must be the same color. - Guanji Chen and Greg Dresden, Jul 15 2024

Examples

			G.f. = 2 + 3*x + 7*x^2 + 13*x^3 + 27*x^4 + 53*x^5 + 107*x^6 + 213*x^7 + 427*x^8 + ...
		

Crossrefs

Programs

  • Magma
    [(5*2^n+(-1)^n)/3: n in [0..35]]; // Vincenzo Librandi, Jul 05 2011
    
  • Mathematica
    LinearRecurrence[{1,2},{2,3},40] (* Harvey P. Dale, Dec 11 2017 *)
  • PARI
    {a(n) = if( n<0, 0, (5*2^n + (-1)^n) / 3)};
    
  • PARI
    {a(n) = if (n<0 ,0, if( n<2, n+2, a(n-1) + 2*a(n-2)))};
    
  • Sage
    [(5*2^n+(-1)^n)/3 for n in range(35)] # G. C. Greubel, Apr 10 2019

Formula

G.f.: (2 + x) / (1 - x - 2*x^2).
a(n) = (5*2^n + (-1)^n) / 3.
a(n) = 2^(n+1) - A001045(n).
a(n) = A084170(n)+1 = abs(A083581(n)-3) = A081254(n+1) - A081254(n) = A084214(n+2)/2.
a(n) = 2*A001045(n+1) + A001045(n) (note that 2 is the limit of A001045(n+1)/A001045(n)). - Paul Barry, Sep 14 2009
Let A be the Hessenberg matrix of order n, defined by: A[1,j]=1, A[i,i]:=-3, A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n>=1, a(n-1)=-charpoly(A,-1). - Milan Janjic, Jan 27 2010
Equivalently, with different offset, a(n) = b(n+1) with b(0)=1 and b(n) = Sum_{i=0..n-1} (-1)^i (1 + (-1)^i b(i)). - Olivier Gérard, Jul 30 2012
a(n) = A000975(n-2)*10 + 5 + 2*(-1)^(n-2), a(0)=2, a(1)=3. - Yuchun Ji, Mar 18 2019
a(n+1) = Sum_{i=0..n} a(i) + 1 + (1-(-1)^n)/2, a(0)=2. - Yuchun Ji, Apr 10 2019
a(n) = 2^n + J(n+1) = J(n+2) + J(n+1) - J(n), where J is A001045. - Yuchun Ji, Apr 10 2019
a(n) = A001045(n+2) + A078008(n) = A062510(n+1) - A078008(n+1) = (A001045(n+2) + A062510(n+1))/2 = A014551(n) + 2*A001045(n). - Paul Curtz, Jul 14 2021
From Thomas Scheuerle, Jul 14 2021: (Start)
a(n) = A083322(n) + A024493(n).
a(n) = A127978(n) - A102713(n).
a(n) = A130755(n) - A166249(n).
a(n) = A007679(n) + A139763(n).
a(n) = A168642(n) XOR A007283(n).
a(n) = A290604(n) + A083944(n). (End)
From Paul Curtz, Jul 21 2021: (Start)
a(n) = 5*A001045(n) - A280560(n+1) = abs(A140360(n+1)) - A280560(n+1).
a(n) = 2^n + A001045(n+1) = A001045(n+3) - A000079(n).
a(n) = A001045(n+4) - A340627(n). (End)
a(n) = A001045(n+5) - A005010(n).
a(n+1) + a(n) = a(n+2) - a(n) = 5*2^n. - Michael Somos, Feb 22 2023
a(n) = A135318(2*n) + A135318(2*n+1) = A112387(2*n) + A112387(2*n+1). - Paul Curtz, Jun 26 2024
E.g.f.: (cosh(x) + 5*cosh(2*x) - sinh(x) + 5*sinh(2*x))/3. - Stefano Spezia, May 18 2025

Extensions

Formula of Milan Janjic moved here from wrong sequence by Paul D. Hanna, May 29 2010

A127979 a(n) = (5*n/18 + 19/54)*2^n - (-1)^(n-1)*(3*n + 4)/27.

Original entry on oeis.org

1, 4, 9, 24, 55, 130, 293, 660, 1459, 3206, 6977, 15096, 32463, 69482, 148061, 314332, 665067, 1402958, 2951545, 6194368, 12971271, 27107634, 56545429, 117751204, 244823075, 508287510, 1053857713, 2182280840, 4513692479, 9325646586
Offset: 1

Views

Author

Artur Jasinski, Feb 09 2007

Keywords

Crossrefs

Programs

  • Magma
    [(5*n/18 +19/54)*2^n -(-1)^(n-1)*(3*n+4)/27: n in [1..50]]; // G. C. Greubel, May 08 2018
  • Mathematica
    Table[(5n/18 + 19/54)2^(n) - ((-1)^(n - 1) )(3n + 4)/27, {n, 1, 100}]
    LinearRecurrence[{2,3,-4,-4}, {1,4,9,24}, 50] (* G. C. Greubel, May 08 2018 *)
  • PARI
    for(n=1, 50, print1((5*n/18 +19/54)*2^n -(-1)^(n-1)*(3*n+4)/27, ", ")) \\ G. C. Greubel, May 08 2018
    

Formula

G.f.: x*(1+2*x-2*x^2-2*x^3)/((1+x)^2*(1-2x)^2). - Bruno Berselli, Apr 02 2012
a(n) = 2*a(n-1)+3*a(n-2)-4*a(n-3)-4*a(n-4). - Wesley Ivan Hurt, May 07 2021

A127980 a(n) = (n + 2/3)*2^(n-1) - 1/2 - (-1)^(n-1)*(1/6).

Original entry on oeis.org

1, 5, 14, 37, 90, 213, 490, 1109, 2474, 5461, 11946, 25941, 55978, 120149, 256682, 546133, 1157802, 2446677, 5155498, 10835285, 22719146, 47535445, 99265194, 206918997, 430615210, 894784853, 1856678570, 3847574869, 7963585194
Offset: 1

Views

Author

Artur Jasinski, Feb 09 2007

Keywords

Crossrefs

Programs

  • Magma
    I:=[1,5,14,37]; [n le 4 select I[n] else 4*Self(n-1)-3*Self(n-2)-4*Self(n-3)+4*Self(n-4): n in [1..30]]; // G. C. Greubel, May 08 2018
  • Mathematica
    Table[(n+2/3)2^(n-1) - 1/2 -(-1)^(n-1)*(1/6), {n, 1, 50}]
    LinearRecurrence[{4,-3,-4,4}, {1,5,14,37}, 50] (* G. C. Greubel, May 08 2018 *)
  • PARI
    x='x+O('x^30); Vec(x*(1+x-3*x^2)/((1-x)*(1+x)*(1-2*x)^2)) \\ G. C. Greubel, May 08 2018
    

Formula

G.f.: x*(1+x-3*x^2)/((1-x)*(1+x)*(1-2*x)^2). - Colin Barker, Apr 02 2012
E.g.f.: ((1 + 3*x)*cosh(2*x) - 2*sinh(x) + cosh(x)*((2 + 6*x)*sinh(x) - 1))/3. - Stefano Spezia, May 25 2023

A127984 a(n) = (n/3 + 7/9)*2^(n - 1) + (-1)^n/9.

Original entry on oeis.org

1, 3, 7, 17, 39, 89, 199, 441, 967, 2105, 4551, 9785, 20935, 44601, 94663, 200249, 422343, 888377, 1864135, 3903033, 8155591, 17010233, 35418567, 73633337, 152859079, 316902969, 656175559, 1357090361, 2803659207, 5786275385, 11930464711, 24576757305
Offset: 1

Views

Author

Artur Jasinski, Feb 09 2007

Keywords

Comments

a(n) is the number of runs of strictly increasing parts in all compositions of n. a(3) = 7: (1)(1)(1), (12), (2)(1), (3). - Alois P. Heinz, Apr 30 2017
From Hugo Pfoertner, Feb 19 2020: (Start)
a(n)/2^(n-2) apparently is the expected number of flips of a fair coin to completion of a game where the player advances by 1 for heads and by 2 for tails, starting at position 0 and repeating to flip until the target n+1 is exactly reached. If the position n (1 below the target) is reached, the player stays at this position and continues to flip the coin and count the flips until he can advance by 1.
The expected number of flips for targets 1, 2, 3,... , found by inversion of the corresponding Markov matrices, is 2, 2, 3, 7/2, 17/4, 39/8, 89/16, 199/32, 441/64, ...
Target 1 needs an expected number of 2 flips and would require a(0) = 1/2.
n=1, target n+1 = 2: 1 / 2^(1-2) = 2;
n=2, target n+1 = 3: 3 / 2^(2-2) = 3;
n=3, target n+1 = 4: 7 / 2^(3-2) = 7/2.
(End)

Crossrefs

Programs

  • Magma
    [(n/3+7/9)*2^(n-1)+(-1)^n/9: n in [1..35]]; // Vincenzo Librandi, Jun 15 2017
  • Maple
    A127984:=n->(n/3 + 7/9)*2^(n - 1) + (-1)^n/9; seq(A127984(n), n=1..50); # Wesley Ivan Hurt, Mar 14 2014
  • Mathematica
    Table[(n/3 + 7/9)2^(n - 1) + (-1)^n/9, {n, 50}] (* Artur Jasinski *)
    CoefficientList[Series[(1 - 2 x^2) / ((-1 + 2 x)^2 (1 + x)), {x, 0, 40}], x] (* Vincenzo Librandi, Jun 15 2017 *)

Formula

a(n) = (n/3 + 7/9)*2^(n - 1) + (-1)^n/9.
From R. J. Mathar, Apr 04 2008: (Start)
O.g.f.: -x*(-1+2x^2)/((-1+2x)^2*(1+x)).
a(n) = 3*a(n-1) - 4*a(n-3). (End)
a(n) + a(n+1) = A087447(n+1). - R. J. Mathar, Feb 21 2009
A172481(n) = a(n) + 2^(n-1). Application: Problem 11623, AMM 119 (2012) 161. - Stephen J. Herschkorn, Feb 11 2012
From Wolfdieter Lang, Jun 14 2017: (Start)
a(n) = f(n+1)*2^(n-1), where f(n) is a rational Fibonacci type sequence based on fuse(a,b) = (a+b+1)/2 with f(0) = 0, f(1) = 1 and f(n) = fuse(f(n-1),f(n-2)), for n >= 2. For fuse(a,b) see the Jeff Erickson link under A188545. Proof: f(n) = (3*n+4 - (-1)^n/2^(n-2))/9, n >= 0, by induction.
a(n) = a(n-1) + a(n-2) + 2^(n-2), n >= 1, with inputs a(-1) = 0, a(0) = 1/2.
(End)
E.g.f.: (2*exp(-x) + exp(2*x)*(7 + 6*x) - 9)/18. - Stefano Spezia, Feb 19 2020

A127981 a(n) = (n + 1/3)*2^(n-1) - 1/2 + (-1)^(n-1)*(1/6).

Original entry on oeis.org

1, 4, 13, 34, 85, 202, 469, 1066, 2389, 5290, 11605, 25258, 54613, 117418, 251221, 535210, 1135957, 2402986, 5068117, 10660522, 22369621, 46836394, 97867093, 204122794, 425022805, 883600042, 1834308949, 3802835626, 7874106709
Offset: 1

Views

Author

Artur Jasinski, Feb 09 2007

Keywords

Crossrefs

Programs

  • Magma
    [(n+1/3)*2^(n-1) -1/2 +(-1)^(n-1)*(1/6): n in [1..50]]; // G. C. Greubel, May 08 2018
  • Mathematica
    Table[(n+1/3)*2^(n-1) -1/2 +(-1)^(n-1)*(1/6), {n, 1, 50}]
    LinearRecurrence[{4,-3,-4,4}, {1,4,13,34}, 50] (* G. C. Greubel, May 08 2018 *)
  • PARI
    for(n=1,50, print1((n+1/3)*2^(n-1) -1/2 +(-1)^(n-1)*(1/6), ", ")) \\ G. C. Greubel, May 08 2018
    

Formula

G.f.: x*(1-2*x^3)/((1-x)*(1+x)*(1-2*x)^2). - Colin Barker, Apr 02 2012

A127982 a(n) = (n - 1/3)*2^n - n/2 + 1/4 + (-1)^n/12.

Original entry on oeis.org

1, 6, 20, 57, 147, 360, 850, 1959, 4433, 9894, 21840, 47781, 103759, 223908, 480590, 1026723, 2184525, 4631202, 9786700, 20621985, 43341131, 90876576, 190141770, 397060767, 827675977, 1722460830, 3579139400, 7426714269, 15390299463
Offset: 1

Views

Author

Artur Jasinski, Feb 09 2007

Keywords

Crossrefs

Programs

  • Magma
    [(n-1/3)*2^n -n/2 +1/4 +(-1)^n/12: n in [1..50]]; // G. C. Greubel, May 08 2018
  • Mathematica
    Table[(n-1/3)*2^n -n/2 +1/4 +(-1)^n/12, {n, 1, 50}]
    LinearRecurrence[{5,-7,-1,8,-4}, {1,6,20,57,147}, 50] (* G. C. Greubel, May 08 2018 *)
  • PARI
    a(n) = (n-1/3)*2^n -n/2 +1/4 +(-1)^n/12 \\ G. C. Greubel, May 08 2018
    

Formula

a(n) = (n - 1/3)*2^n - n/2 + 1/4 + (-1)^n/12.
G.f.: -x*(3*x^2-x-1)/((1+x)*(2*x-1)^2*(x-1)^2). - Maksym Voznyy (voznyy(AT)mail.ru), Aug 14 2009 [checked and corrected by R. J. Mathar, Sep 16 2009]

A127983 a(n) = (n - 2/3)*2^n - n/2 + 3/4 - (-1)^n/12.

Original entry on oeis.org

1, 5, 18, 52, 137, 339, 808, 1874, 4263, 9553, 21158, 46416, 101029, 218447, 469668, 1004878, 2140835, 4543821, 9611938, 20272460, 42642081, 89478475, 187345568, 391468362, 816491167, 1700091209, 3534400158, 7337235784, 15211342493
Offset: 1

Views

Author

Artur Jasinski, Feb 09 2007

Keywords

Crossrefs

Programs

  • Magma
    [(n-2/3)*2^n -n/2 +3/4 -(-1)^n/12: n in [1..50]]; // G. C. Greubel, May 08 2018
  • Mathematica
    Table[(n-2/3)*2^n -n/2 +3/4 -(-1)^n/12, {n, 1, 50}]
    LinearRecurrence[{5,-7,-1,8,-4}, {1,5,18,52,137}, 50] (* G. C. Greubel, May 08 2018 *)
  • PARI
    a(n) = (n-2/3)*2^n -n/2 +3/4 -(-1)^n/12 \\ G. C. Greubel, May 08 2018
    

Formula

a(n) = (n - 2/3)*2^n - n/2 + 3/4 - (-1)^n/12.
G.f.: x*(1-2*x^3)/(1+x)/((2*x-1)^2*(x-1)^2). - Maksym Voznyy (voznyy(AT)mail.ru), Aug 14 2009 [checked and corrected by R. J. Mathar, Sep 16 2009]

A127985 a(n) = floor(2^n*(n/3 + 4/9)).

Original entry on oeis.org

0, 1, 4, 11, 28, 67, 156, 355, 796, 1763, 3868, 8419, 18204, 39139, 83740, 178403, 378652, 800995, 1689372, 3553507, 7456540, 15612131, 32622364, 68040931, 141674268, 294533347, 611436316, 1267611875, 2624702236, 5428361443
Offset: 0

Views

Author

Artur Jasinski, Feb 09 2007

Keywords

Crossrefs

Programs

  • Magma
    [(n/3 + 4/9)*2^n - 1/2 + (-1)^n/18: n in [1..40]]; // Vincenzo Librandi, May 26 2011
    
  • Mathematica
    Table[(n/3 + 4/9) 2^n - 1/2 + (-1)^n/18, {n, 1, 50}]
    LinearRecurrence[{4,-3,-4,4},{1,4,11,28},50] (* Harvey P. Dale, May 15 2011 *)
  • PARI
    a(n)=(n*3+4)<M. F. Hasler, Oct 07 2014

Formula

a(n) = (n/3 + 4/9)*2^n - 1/2 + (-1)^n/18.
a(1)=1, a(2)=4, a(3)=11, a(4)=28, a(n) = 4*a(n-1)-3*a(n-2)-4*a(n-3)+4*a(n-4). - Harvey P. Dale, May 15 2011
G.f.: x*(1-2*x^2)/((1-2*x)^2*(1-x^2)). - Harvey P. Dale, May 15 2011
E.g.f.: ((4 + 6*x)*cosh(2*x) - 5*sinh(x) + 4*cosh(x)*((2 + 3*x)*sinh(x) - 1))/9. - Stefano Spezia, May 25 2023

Extensions

Definition simplified by M. F. Hasler, Oct 07 2014
Sequence extended to a(0)=0 by M. F. Hasler, Oct 08 2014
Showing 1-8 of 8 results.