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-4 of 4 results.

A052531 If n is even then 2^n+1 otherwise 2^n.

Original entry on oeis.org

2, 2, 5, 8, 17, 32, 65, 128, 257, 512, 1025, 2048, 4097, 8192, 16385, 32768, 65537, 131072, 262145, 524288, 1048577, 2097152, 4194305, 8388608, 16777217, 33554432, 67108865, 134217728, 268435457, 536870912, 1073741825, 2147483648
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Crossrefs

Programs

  • GAP
    a:=[2,2,5];; for n in [4..40] do a[n]:=2*a[n-1]+a[n-2]-2*a[n-3]; od; a; # G. C. Greubel, May 09 2019
  • Magma
    [2^n + (1+(-1)^n)/2: n in [0..30]]; // G. C. Greubel, May 09 2019
    
  • Maple
    spec:= [S,{S=Union(Sequence(Union(Z,Z)),Sequence(Prod(Z,Z)))},unlabeled]: seq(combstruct[count](spec,size=n), n=0..20);
    seq(2^n + (1+(-1)^n)/2, n=0..30); # G. C. Greubel, Oct 17 2019
  • Mathematica
    2^# + (1 - Mod[#, 2]) & /@ Range[0, 40] (* Peter Pein, Jan 11 2008 *)
    Table[If[EvenQ[n], 2^n + 1, 2^n], {n, 0, 40}] (* Vladimir Joseph Stephan Orlovsky, Feb 07 2010, modified by G. C. Greubel, May 09 2019 *)
    Table[2^n + Boole[EvenQ[n]], {n, 0, 31}] (* Alonso del Arte, May 09 2019 *)
  • PARI
    my(x='x+O('x^40)); Vec((2-2*x-x^2)/((1-x^2)*(1-2*x))) \\ G. C. Greubel, May 09 2019
    
  • PARI
    a(n) = 1<David A. Corneth, Oct 18 2019
    
  • Sage
    [2^n + (1+(-1)^n)/2 for n in (0..30)] # G. C. Greubel, May 09 2019
    

Formula

G.f.: (2 - 2*x - x^2)/( (1-x^2)*(1-2*x) ).
a(n) = a(n-1) + 2*a(n-2) - 1, with a(0) = 2, a(1) = 2, a(2) = 5.
a(n) = 2^n + Sum_{alpha = RootOf(-1+x^2)} alpha^(-n)/2.
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3), with a(0) = 2, a(1) = 2, a(2) = 5. - G. C. Greubel, May 09 2019
a(n) = 2^n + (1 + (-1)^n)/2. - G. C. Greubel, Oct 17 2019
E.g.f.: exp(2*x) + cosh(x). - Stefano Spezia, Oct 18 2019

Extensions

More terms from James Sellers, Jun 05 2000
Better definition from Peter Pein (petsie(AT)dordos.net), Jan 11 2008

A137241 Number triples (k,3-k,2-2k), concatenated for k=0, 1, 2, 3,...

Original entry on oeis.org

0, 3, 2, 1, 2, 0, 2, 1, -2, 3, 0, -4, 4, -1, -6, 5, -2, -8, 6, -3, -10, 7, -4, -12, 8, -5, -14, 9, -6, -16, 10, -7, -18, 11, -8, -20, 12, -9, -22, 13, -10, -24, 14, -11, -26, 15, -12, -28, 16, -13, -30, 17, -14, -32, 18, -15, -34, 19, -16, -36, 20, -17, -38, 21, -18, -40
Offset: 0

Views

Author

Paul Curtz, Mar 09 2008

Keywords

Comments

The entries are the coefficients in a family of Jacobsthal recurrences: a(n)=k*a(n-1)+(3-k)*a(n-2)+(2-2k)*a(n-3).
Examples for k=0 are in A001045 and A113954. Examples for k=1 are A001045, A078008.
Examples for k=2 are A000975, A087288, A084639, A000012 and A001045.
Examples for k=3 are A045883, A059570. Examples for k=4 are A094705 and A015518.

Examples

			The triples (k,3-k,2-2k) are (0,3,2), (1,2,0), (2,1,-2), (3,0,-4),...
		

Programs

  • Mathematica
    CoefficientList[Series[x*(3 + 2*x + x^2 - 4*x^3 - 4*x^4)/((x - 1)^2*(1 + x + x^2)^2), {x, 0, 50}], x] (* G. C. Greubel, Sep 28 2017 *)
    Table[{n,3-n,2-2n},{n,0,30}]//Flatten (* or *) LinearRecurrence[ {0,0,2,0,0,-1},{0,3,2,1,2,0},100] (* Harvey P. Dale, Jun 23 2019 *)
  • PARI
    x='x+O('x^50); Vec(x*(3+2*x+x^2-4*x^3-4*x^4)/((x-1)^2*(1+x +x^2 )^2)) \\ G. C. Greubel, Sep 28 2017

Formula

From R. J. Mathar, Feb 25 2009: (Start)
a(n) = 2*a(n-3) - a(n-6).
G.f.: x*(3+2*x+x^2-4*x^3-4*x^4)/((x-1)^2*(1+x+x^2)^2). (End)

Extensions

Edited by R. J. Mathar, Jun 28 2008

A283070 Sierpinski tetrahedron or tetrix numbers: a(n) = 2*4^n + 2.

Original entry on oeis.org

4, 10, 34, 130, 514, 2050, 8194, 32770, 131074, 524290, 2097154, 8388610, 33554434, 134217730, 536870914, 2147483650, 8589934594, 34359738370, 137438953474, 549755813890, 2199023255554, 8796093022210, 35184372088834, 140737488355330, 562949953421314
Offset: 0

Views

Author

Peter M. Chema, Feb 28 2017

Keywords

Comments

Number of vertices required to make a Sierpinski tetrahedron or tetrix of side length 2^n. The sum of the vertices (balls) plus line segments (rods) of one tetrix equals the vertices of its larger, adjacent iteration. See formula.
Equivalently, the number of vertices in the (n+1)-Sierpinski tetrahedron graph. - Eric W. Weisstein, Aug 17 2017
Also the independence number of the (n+2)-Sierpinski tetrahedron graph. - Eric W. Weisstein, Aug 29 2021
Final digit alternates 4 and 0.

Crossrefs

Subsequence of A016957.
First bisection of A052548, A087288; second bisection of A049332, A133140, A135440.
Cf. A002023 (edge count).

Programs

Formula

G.f.: 2*(2 - 5*x)/((1 - x)*(1 - 4*x)).
a(n) = 5*a(n-1) - 4*a(n-2) for n > 1.
a(n+1) = a(n) + A002023(n).
a(n) = 2*A052539(n) = A188161(n) - 1 = A087289(n) + 1 = A056469(2*n+2) = A261723(4*n+1).
E.g.f.: 2*(exp(4*x) + exp(x)). - G. C. Greubel, Aug 17 2017

Extensions

Entry revised by Editors of OEIS, Mar 01 2017

A140359 a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3).

Original entry on oeis.org

1, 1, 6, 11, 26, 51, 106, 211, 426, 851, 1706, 3411, 6826, 13651, 27306, 54611, 109226, 218451, 436906, 873811, 1747626, 3495251, 6990506, 13981011, 27962026, 55924051, 111848106, 223696211, 447392426, 894784851, 1789569706, 3579139411
Offset: 0

Views

Author

Paul Curtz, Jun 24 2008

Keywords

Comments

This is the sequence A(1,1;1,2;3) of the family of sequences [a,b:c,d:k] considered by G. Detlefs, and treated as A(a,b;c,d;k) in the W. Lang link given below. - Wolfdieter Lang, Oct 18 2010

Crossrefs

Programs

  • Magma
    [(5*2^(n+1) -9 + 5*(-1)^n)/6: n in [0..50]]; // G. C. Greubel, Oct 10 2017
  • Mathematica
    Table[(5*2^(n+1) -9 + 5*(-1)^n)/6, {n, 0, 50}] (* G. C. Greubel, Oct 10 2017 *)
    LinearRecurrence[{2,1,-2},{1,1,6},40] (* Harvey P. Dale, Mar 24 2021 *)
  • PARI
    for(n=0,50, print1((5*2^(n+1) -9 + 5*(-1)^n)/6, ", ")) \\ G. C. Greubel, Oct 10 2017
    

Formula

a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3).
a(n+1) - a(n) = 5*A001045(n), Jacobsthal numbers.
a(n+1) - 2*a(n) = (-1)^(n+1)* A010685(n).
From R. J. Mathar, Jul 10 2008: (Start)
O.g.f.: (1-x+3*x^2)/((x-1)*(2*x-1)*(1+x)).
a(n) = (5*2^(n+1) - 9 + 5*(-1)^n)/6. (End)
a(n) = a(n-1) + 2*a(n-2) +3, n>1 - Gary Detlefs, Jun 20 2010

Extensions

Extended by R. J. Mathar, Jul 10 2008
Showing 1-4 of 4 results.