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

A056236 a(n) = (2 + sqrt(2))^n + (2 - sqrt(2))^n.

Original entry on oeis.org

2, 4, 12, 40, 136, 464, 1584, 5408, 18464, 63040, 215232, 734848, 2508928, 8566016, 29246208, 99852800, 340918784, 1163969536, 3974040576, 13568223232, 46324811776, 158162800640, 540001579008, 1843680714752, 6294719700992
Offset: 0

Views

Author

Henry Bottomley, Aug 11 2000

Keywords

Comments

First differences give A060995. - Jeremy Gardiner, Aug 11 2013
Binomial transform of A002203 [Bhadouria].
The binomial transform of this sequence is 2, 6, 22, 90, 386, .. = 2*A083878(n). - R. J. Mathar, Nov 10 2013

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{4,-2},{2,4},30] (* Harvey P. Dale, Jan 18 2013 *)
  • PARI
    a(n) = 2*real((2+quadgen(8))^n);
    
  • Sage
    [lucas_number2(n,4,2) for n in range(37)] # Zerinvary Lajos, Jun 25 2008

Formula

a(n) = 4*a(n-1) - 2*a(n-2).
a(n) = a(n-2) - a(n-1) + 2*A020727(n-1).
a(n) = 2*A006012(n) = 4*A007052(n-1).
For n>2, a(n) = floor((2+sqrt(2))*a(n-1)).
G.f.: 2*(1-2*x)/(1-4*x+2*x^2).
From L. Edson Jeffery, Apr 08 2011: (Start)
a(n) = 2^(2*n)*(cos(Pi/8)^(2*n) + cos(3*Pi/8)^(2*n)).
a(n) = 3*a(n-1) + Sum_{k=1..(n-2)} a(k), for n>1, with a(0)=2, a(1)=4. (End)
a(n) = [x^n] ( (1 + 4*x + sqrt(1 + 8*x + 8*x^2))/2 )^n for n >= 1. - Peter Bala, Jun 23 2015

Extensions

More terms from James Sellers, Aug 25 2000

A068912 Number of n step walks (each step +/-1 starting from 0) which are never more than 3 or less than -3.

Original entry on oeis.org

1, 2, 4, 8, 14, 28, 48, 96, 164, 328, 560, 1120, 1912, 3824, 6528, 13056, 22288, 44576, 76096, 152192, 259808, 519616, 887040, 1774080, 3028544, 6057088, 10340096, 20680192, 35303296, 70606592, 120532992, 241065984, 411525376, 823050752, 1405035520, 2810071040
Offset: 0

Views

Author

Henry Bottomley, Mar 06 2002

Keywords

Comments

The number of n step walks (each step +/-1 starting from 0) which are never more than k or less than -k is given by a(n,k) = 2^n/(k+1)*Sum_{r=1..k+1} (-1)^r*cos((Pi*(2*r-1))/(2*(k+1)))^n*cot((Pi*(1-2*r))/(4*(k+1))). Here we have k=3. - Herbert Kociemba, Sep 19 2020

Crossrefs

Cf. A000007, A016116 (without initial term), A068911, A068913 for similar.

Programs

  • Maple
    # From Peter Luschny, Sep 20 2020: (Start)
    r := 1 + 2^(1/2): s := 1 - 2^(1/2):
    c := n -> (1+r)^(n/2)*(r+(2*(1+r))^(1/2)+(-1)^n*(r-(2*(1+r))^(1/2))):
    b := n -> (1+s)^(n/2)*(s-(2*(1+s))^(1/2)+(-1)^n*(s+(2*(1+s))^(1/2))):
    a := n -> (c(n) + b(n))/4:
    # Alternatively:
    a := proc(n) local h; h := n -> add((1+x)*(2+x)^(n/2), x=[sqrt(2),-sqrt(2)]);
    if n::even then h(n)/2 else h(n-1) fi end:
    seq(simplify(a(n)), n=0..30); # (End)
  • Mathematica
    nn=33; CoefficientList[Series[s+a + b + c + d + e +f/.Solve[{s ==1 + x a + x b, a==x s + x c, b==x s +x d, c==x a +x e, d== x b + x f, e==x c, f==x d,z==x e + x f },{s,a,b,c,d,e,f,z}],{x,0,nn}],x] (* Geoffrey Critzer, Jan 13 2014 *)
    a[n_,k_]:=2^n /(k+1) Sum[(-1)^r Cos[(Pi (2r-1))/(2 (k+1))]^n Cot[(Pi (1-2r))/(4 (k+1))] ,{r,1,k+1}]
    Table[a[n,3],{n,0,40}]//Round (* Herbert Kociemba, Sep 19 2020 *)
    a[n_]:=Module[{r=2+Sqrt[2]},Floor[(r^(n/2) (-2 (-1+(-1)^n) Sqrt[r]+(1+(-1)^n) r))/(4 Sqrt[2])]]
    Table[a[n],{n,0,40}] (* Herbert Kociemba, Sep 21 2020 *)

Formula

G.f.: (1+2*x)/(1-4*x^2+2*x^4).
a(n) = A068913(3, n).
a(n) = 4*a(n-2) - 2*a(n-4).
a(2*n) = A007070(n) = 2*a(2*n-1)-A060995(n); a(2*n+1) = 2*a(2*n).
a(n) = (2^n/4)*Sum_{r=1..4} (-1)^r*cos((Pi*(2*r-1))/8)^n*cot((Pi*(1-2*r))/16). - Herbert Kociemba, Sep 19 2020
Conjecture: a(n) = floor((1+r)^(n/2)*(r+(2*(1+r))^(1/2)+(-1)^n*(r-(2*(1+r))^(1/2)))/4) where r = 1 + 2^(1/2). - Peter Luschny, Sep 20 2020
From Herbert Kociemba, Sep 20 2020: (Start)
With the standard procedure to obtain an explicit formula for a(n) for a linear recurrence and r1=2-sqrt(2) and r2=2+sqrt(2) we get
a(n) = a1(n) + a2(n) with
a1(n) = -(r1^(n/2)*(-2*(-1+(-1)^n)*sqrt(r1)+(1+(-1)^n)*r1))/(4*sqrt(2)) and
a2(n) = +(r2^(n/2)*(-2*(-1+(-1)^n)*sqrt(r2)+(1+(-1)^n)*r2))/(4*sqrt(2)).
We have -1

A061897 Square table by antidiagonals of number of routes of length 2k+n on the sides of a 2n-gon from a point to its opposite point.

Original entry on oeis.org

1, 0, 2, 0, 0, 2, 0, 0, 4, 2, 0, 0, 8, 6, 2, 0, 0, 16, 18, 8, 2, 0, 0, 32, 54, 28, 10, 2, 0, 0, 64, 162, 96, 40, 12, 2, 0, 0, 128, 486, 328, 150, 54, 14, 2, 0, 0, 256, 1458, 1120, 550, 220, 70, 16, 2, 0, 0, 512, 4374, 3824, 2000, 858, 308, 88, 18, 2, 0, 0, 1024, 13122, 13056
Offset: 0

Author

Henry Bottomley, May 14 2001

Keywords

Examples

			Rows start
  1, 0, 0, 0, 0, ...
  2, 0, 0, 0, 0, ...
  2, 4, 8, 16, 32, ...
  2, 6, 18, 54, 162, ...
  2, 8, 28, 96, 328, ...
  ...
		

Crossrefs

Cf. A060995. Rows include A000007, A000038, A000079, A008776, A060995. Columns effectively (i.e. except for a small number of terms) include A040000, A005843, A028552.

Formula

T(0, 0)=1; if n>0, T(n, 0)=2; if k>1, T(n, k)=T(n, k-1)*A061896(n, 1)-T(n, k-2)*A061896(n, 2)+T(n, k-3)*A061896(n, 3)-T(n, k-4)*A061896(n, 4)+...T(n, k-[n/2])*A061896(n, [n/2]); if 0>k T(n, k)=0.

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

Original entry on oeis.org

0, -2, -8, -28, -96, -328, -1120, -3824, -13056, -44576, -152192, -519616, -1774080, -6057088, -20680192, -70606592, -241065984, -823050752, -2810071040, -9594182656, -32756588544, -111837988864, -381838778368, -1303679135744, -4451038986240, -15196797673472
Offset: 0

Author

Roger L. Bagula, May 30 2005

Keywords

Comments

See a Oct 01 2013 comment on A007070 where it is pointed out that this sequence, interspersed with zeros, appears, together with A007070, also interspersed with zeros, in the representation of nonnegative powers of the algebraic number rho(8) = 2*cos(Pi/8) in the power basis of the number field Q(rho(8)) of degree 4, known from the octagon. - Wolfdieter Lang, Oct 02 2013

Crossrefs

Programs

  • Magma
    [n le 2 select -(1+(-1)^n) else 4*Self(n-1) - 2*Self(n-2): n in [1..31]]; // G. C. Greubel, Sep 10 2021
    
  • Maple
    a[0]:=0: a[1]:=-2: for n from 2 to 27 do a[n]:=4*a[n-1]-2*a[n-2] od: seq(a[n], n=0..30);
  • Mathematica
    M= {{0,-2}, {1,4}}; v[1]= {0,1}; v[n_]:= v[n]= M.v[n-1]; Table[Abs[v[n][[1]]], {n, 30}]
    CoefficientList[Series[-2x/(1 -4x +2x^2), {x, 0, 30}], x] (* Vincenzo Librandi, Oct 04 2013 *)
  • Sage
    def a(n): return -2^((n+2)/2)*lucas_number1(n,2,-1) if (n%2==0) else -2^((n-1)/2)*lucas_number2(n,2,-1)
    [a(n) for n in (0..30)] # G. C. Greubel, Sep 10 2021

Formula

G.f.: -2*x/(1-4*x+2*x^2).
a(n) = -2*A007070(n-1) for n>=1.
a(n) = 4*a(n-1) - 2*a(n-2); a(0)=0, a(1)=-2.
From G. C. Greubel, Sep 10 2021: (Start)
a(2*n) = -2^(n+1)*Pell(2*n) = -2^(n+1)*A000129(2*n).
a(2*n+1) = -2^n*Q(2n+1) = -2^n*A002203(2*n+1). (End)
E.g.f.: -sqrt(2)*exp(2*x)*sinh(sqrt(2)*x). - Stefano Spezia, May 20 2024

Extensions

Edited by N. J. A. Sloane, Apr 30 2006
Further editing and simpler name, Joerg Arndt, Oct 02 2013

A387083 Expansion of e.g.f. (2*(1-x)^2)/(2-4*x+x^2).

Original entry on oeis.org

1, 0, 1, 6, 42, 360, 3690, 44100, 602280, 9253440, 157966200, 2966317200, 60765843600, 1348539192000, 32229405608400, 825285553092000, 22541609025936000, 654175871661312000, 20101465198839024000, 651991603501798560000, 22260385752292527840000
Offset: 0

Author

Enrique Navarrete, Aug 16 2025

Keywords

Comments

For n > 0, a(n) is the number of ways to sit n people around circular tables, choose 2 people from each table, and linear order the tables.

Examples

			a(6)=3690 since for 6 people the number of ways to do the combined tasks in the comment are: 1800 using one table, 1080 using two tables with 4 and 2 people, 720 using two tables with 3 people each, and 90 using three tables with 2 people each.
		

Crossrefs

Cf. A001286.

Programs

  • Mathematica
    With[{m = 20}, CoefficientList[Series[(2*(1 - x)^2)/(2 - 4*x + x^2), {x, 0, m}], x] * Table[n!, {n, 0, m}]] (* Amiram Eldar, Aug 16 2025 *)

Formula

For n > 0, a(n) = ((1 + sqrt(2))^(n-1) - (sqrt(2) - 1)^(n-1)) * n! / 2^(n/2 + 1). - Vaclav Kotesovec, Aug 18 2025
D-finite with recurrence 2*a(n) -4*n*a(n-1) +n*(n-1)*a(n-2)=0. - R. J. Mathar, Aug 26 2025
a(n) = A060995(n)*n!/2^n. - R. J. Mathar, Aug 26 2025
Showing 1-5 of 5 results.