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

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

Original entry on oeis.org

0, 1, 2, 6, 16, 44, 120, 328, 896, 2448, 6688, 18272, 49920, 136384, 372608, 1017984, 2781184, 7598336, 20759040, 56714752, 154947584, 423324672, 1156544512, 3159738368, 8632565760, 23584608256, 64434348032, 176037912576, 480944521216, 1313964867584
Offset: 0

Views

Author

Keywords

Comments

Individually, both this sequence and A028859 are convergents to 1 + sqrt(3). Mutually, both sequences are convergents to 2 + sqrt(3) and 1 + sqrt(3)/2. - Klaus E. Kastberg (kastberg(AT)hotkey.net.au), Nov 04 2001
The number of (s(0), s(1), ..., s(n+1)) such that 0 < s(i) < 6 and |s(i) - s(i-1)| <= 1 for i = 1, 2, ..., n + 1, s(0) = 2, s(n+1) = 3. - Herbert Kociemba, Jun 02 2004
The same sequence may be obtained by the following process. Starting a priori with the fraction 1/1, the denominators of fractions built according to the rule: add top and bottom to get the new bottom, add top and 4 times the bottom to get the new top. The limit of the sequence of fractions is sqrt(4). - Cino Hilliard, Sep 25 2005
The Hankel transform of this sequence is [1, 2, 0, 0, 0, 0, 0, 0, 0, ...]. - Philippe Deléham, Nov 21 2007
[1, 3; 1, 1]^n *[1, 0] = [A026150(n), a(n)]. - Gary W. Adamson, Mar 21 2008
(1 + sqrt(3))^n = A026150(n) + a(n)*sqrt(3). - Gary W. Adamson, Mar 21 2008
a(n+1) is the number of ways to tile a board of length n using red and blue tiles of length one and two. - Geoffrey Critzer, Feb 07 2009
Starting with offset 1 = INVERT transform of the Jacobsthal sequence, A001045: (1, 1, 3, 5, 11, 21, ...). - Gary W. Adamson, May 12 2009
Starting with "1" = INVERTi transform of A007482: (1, 3, 11, 39, 139, ...). - Gary W. Adamson, Aug 06 2010
An elephant sequence, see A175654. For the corner squares four A[5] vectors, with decimal values 85, 277, 337 and 340, lead to this sequence (without the leading 0). For the central square these vectors lead to the companion sequence A026150, without the first leading 1. - Johannes W. Meijer, Aug 15 2010
The sequence 0, 1, -2, 6, -16, 44, -120, 328, -896, ... (with alternating signs) is the Lucas U(-2,-2)-sequence. - R. J. Mathar, Jan 08 2013
a(n+1) counts n-walks (closed) on the graph G(1-vertex;1-loop,1-loop,2-loop,2-loop). - David Neil McGrath, Dec 11 2014
Number of binary strings of length 2*n - 2 in the regular language (00+11+0101+1010)*. - Jeffrey Shallit, Dec 14 2015
For n >= 1, a(n) equals the number of words of length n - 1 over {0, 1, 2, 3} in which 0 and 1 avoid runs of odd lengths. - Milan Janjic, Dec 17 2015
a(n+1) is the number of compositions of n into parts 1 and 2, both of two kinds. - Gregory L. Simay, Sep 20 2017
Number of associative, quasitrivial, and order-preserving binary operations on the n-element set {1, ..., n} that have neutral elements. - J. Devillet, Sep 28 2017
(1 + sqrt(3))^n = A026150(n) + a(n)*sqrt(3), for n >= 0; integers in the real quadratic number field Q(sqrt(3)). - Wolfdieter Lang, Feb 10 2018
Starting with 1, 2, 6, 16, ..., number of permutations of length n>0 avoiding the partially ordered pattern (POP) {1>3, 1>4} of length 4. That is, number of length n permutations having no subsequences of length 4 in which the first element is larger than the third and fourth elements. - Sergey Kitaev, Dec 09 2020
a(n) is the number of tilings of a 2 X n board missing one corner cell, with 1 X 1 and L-shaped tiles (where the L-shaped tiles cover 3 squares). Compare to A127864. - Greg Dresden and Yilin Zhu, Jul 17 2025

References

  • John Derbyshire, Prime Obsession, Joseph Henry Press, April 2004, p. 16.

Crossrefs

First differences are given by A026150.
a(n) = A073387(n, 0), n>=0 (first column of triangle).
Equals (1/3) A083337. First differences of A077846. Pairwise sums of A028860 and abs(A077917).
a(n) = A028860(n)/2 apart from the initial terms.
Row sums of A081577 and row sums of triangle A156710.
The following sequences (and others) belong to the same family: A001333, A000129, A026150, A046717, A015518, A084057, A063727, A002533, A002532, A083098, A083099, A083100, A015519.
Cf. A175289 (Pisano periods).
Cf. A002530.
Cf. A127864.

Programs

  • Haskell
    a002605 n = a002605_list !! n
    a002605_list =
       0 : 1 : map (* 2) (zipWith (+) a002605_list (tail a002605_list))
    -- Reinhard Zumkeller, Oct 15 2011
    
  • Magma
    [Floor(((1 + Sqrt(3))^n - (1 - Sqrt(3))^n)/(2*Sqrt(3))): n in [0..30]]; // Vincenzo Librandi, Aug 18 2011
    
  • Magma
    [n le 2 select n-1 else 2*Self(n-1) + 2*Self(n-2): n in [1..30]]; // G. C. Greubel, Jan 07 2018
  • Maple
    a[0]:=0:a[1]:=1:for n from 2 to 50 do a[n]:=2*a[n-1]+2*a[n-2]od: seq(a[n], n=0..33); # Zerinvary Lajos, Dec 15 2008
    a := n -> `if`(n<3, n, 2^(n-1)*hypergeom([1-n/2, (1-n)/2], [1-n], -2));
    seq(simplify(a(n)), n=0..29); # Peter Luschny, Dec 16 2015
  • Mathematica
    Expand[Table[((1 + Sqrt[3])^n - (1 - Sqrt[3])^n)/(2Sqrt[3]), {n, 0, 30}]] (* Artur Jasinski, Dec 10 2006 *)
    a[n_]:=(MatrixPower[{{1,3},{1,1}},n].{{1},{1}})[[2,1]]; Table[a[n],{n,-1,40}] (* Vladimir Joseph Stephan Orlovsky, Feb 19 2010 *)
    LinearRecurrence[{2, 2}, {0, 1}, 30] (* Robert G. Wilson v, Apr 13 2013 *)
    Round@Table[Fibonacci[n, Sqrt[2]] 2^((n - 1)/2), {n, 0, 20}] (* Vladimir Reshetnikov, Oct 15 2016 *)
    nxt[{a_,b_}]:={b,2(a+b)}; NestList[nxt,{0,1},30][[All,1]] (* Harvey P. Dale, Sep 17 2022 *)
  • PARI
    Vec(x/(1-2*x-2*x^2)+O(x^99)) \\ Charles R Greathouse IV, Jun 10 2011
    
  • PARI
    A002605(n)=([2,2;1,0]^n)[2,1] \\ M. F. Hasler, Aug 06 2018
    
  • Sage
    [lucas_number1(n,2,-2) for n in range(0, 30)] # Zerinvary Lajos, Apr 22 2009
    
  • Sage
    a = BinaryRecurrenceSequence(2,2)
    print([a(n) for n in (0..29)])  # Peter Luschny, Aug 29 2016
    

Formula

a(n) = (-I*sqrt(2))^(n-1)*U(n-1, I/sqrt(2)) where U(n, x) is the Chebyshev U-polynomial. - Wolfdieter Lang
G.f.: x/(1 - 2*x - 2*x^2).
From Paul Barry, Sep 17 2003: (Start)
E.g.f.: x*exp(x)*(sinh(sqrt(3)*x)/sqrt(3) + cosh(sqrt(3)*x)).
a(n) = (1 + sqrt(3))^(n-1)*(1/2 + sqrt(3)/6) + (1 - sqrt(3))^(n-1)*(1/2 - sqrt(3)/6), for n>0.
Binomial transform of 1, 1, 3, 3, 9, 9, ... Binomial transform is A079935. (End)
a(n) = Sum_{k=0..floor(n/2)} binomial(n - k, k)*2^(n - k). - Paul Barry, Jul 13 2004
a(n) = A080040(n) - A028860(n+1). - Creighton Dement, Jan 19 2005
a(n) = Sum_{k=0..n} A112899(n,k). - Philippe Deléham, Nov 21 2007
a(n) = Sum_{k=0..n} A063967(n,k). - Philippe Deléham, Nov 03 2006
a(n) = ((1 + sqrt(3))^n - (1 - sqrt(3))^n)/(2*sqrt(3)).
a(n) = Sum_{k=0..n} binomial(n, 2*k + 1) * 3^k.
Binomial transform of expansion of sinh(sqrt(3)x)/sqrt(3) (0, 1, 0, 3, 0, 9, ...). E.g.f.: exp(x)*sinh(sqrt(3)*x)/sqrt(3). - Paul Barry, May 09 2003
a(n) = (1/3)*Sum_{k=1..5} sin(Pi*k/2)*sin(2*Pi*k/3)*(1 + 2*cos(Pi*k/6))^n, n >= 1. - Herbert Kociemba, Jun 02 2004
a(n+1) = ((3 + sqrt(3))*(1 + sqrt(3))^n + (3 - sqrt(3))*(1 - sqrt(3))^n)/6. - Al Hakanson (hawkuu(AT)gmail.com), Jun 29 2009
Antidiagonals sums of A081577. - J. M. Bergot, Dec 15 2012
G.f.: Q(0)*x/2, where Q(k) = 1 + 1/(1 - x*(4*k + 2 + 2*x)/(x*(4*k + 4 + 2*x) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 30 2013
a(n) = 2^(n - 1)*hypergeom([1 - n/2, (1 - n)/2], [1 - n], -2) for n >= 3. - Peter Luschny, Dec 16 2015
Sum_{k=0..n} a(k)*2^(n-k) = a(n+2)/2 - 2^n. - Greg Dresden, Feb 11 2022
a(n) = 2^floor(n/2) * A002530(n). - Gregory L. Simay, Sep 22 2022
From Peter Bala, May 08 2024: (Start)
G.f.: x/(1 - 2*x - 2*x^2) = Sum_{n >= 0} x^(n+1) *( Product_{k = 1..n} (k + 2*x + 1)/(1 + k*x) )
Also x/(1 - 2*x - 2*x^2) = Sum_{n >= 0} (2*x)^n *( x*Product_{k = 1..n} (m*k + 2 - m + x)/(1 + 2*m*k*x) ) for arbitrary m (both series are telescoping). (End)
a(n) = A127864(n-1) + A127864(n-2). - Greg Dresden and Yilin Zhu, Jul 17 2025

Extensions

Edited by N. J. A. Sloane, Apr 15 2009

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

Original entry on oeis.org

0, 1, 2, 6, 16, 38, 92, 222, 536, 1294, 3124, 7542, 18208, 43958, 106124, 256206, 618536, 1493278, 3605092, 8703462, 21012016, 50727494, 122467004, 295661502, 713790008, 1723241518, 4160273044, 10043787606, 24247848256, 58539484118, 141326816492, 341193117102
Offset: 0

Views

Author

Alois P. Heinz, Apr 06 2016

Keywords

Crossrefs

Programs

  • Mathematica
    Join[{0, 1, 2}, LinearRecurrence[{2, 1}, {6, 16}, 30]] (* Jean-François Alcover, Nov 02 2021 *)
  • PARI
    concat(0, Vec(x*(1+x)*(1-x+2*x^2)/(1-2*x-x^2) + O(x^50))) \\ Colin Barker, Apr 12 2016

Formula

From Colin Barker, Apr 12 2016: (Start)
a(n) = ((1+sqrt(2))^n*(-5+4*sqrt(2)) + (1-sqrt(2))^n*(5+4*sqrt(2)))/sqrt(2) for n>2.
a(n) = 2*a(n-1)+a(n-2) for n>4.
(End)

A065113 Sum of the squares of the a(n)-th and the (a(n)+1)st triangular numbers (A000217) is a perfect square.

Original entry on oeis.org

6, 40, 238, 1392, 8118, 47320, 275806, 1607520, 9369318, 54608392, 318281038, 1855077840, 10812186006, 63018038200, 367296043198, 2140758220992, 12477253282758, 72722761475560, 423859315570606, 2470433131948080, 14398739476117878, 83922003724759192
Offset: 1

Views

Author

Robert G. Wilson v, Nov 12 2001

Keywords

Comments

The sequence of square roots of the sum of the squares of the n-th and the (n+1)st triangular numbers is A046176.

Examples

			T6 = 21 and T7 = 28, 21^2 + 28^2 = 441 + 784 = 1225 = 35^2.
		

Crossrefs

Cf. A001652, A002315, A003499 (first differences), A065651.

Programs

  • Mathematica
    CoefficientList[ Series[2*(x - 3)/(-1 + 7x - 7x^2 + x^3), {x, 0, 24} ], x]
    LinearRecurrence[{7,-7,1},{6,40,238},41] (* Harvey P. Dale, Dec 27 2011 *)
  • PARI
    a(n)=-1+subst(poltchebi(abs(n+1))-poltchebi(abs(n)),x,3)/2
    
  • PARI
    Vec(2*x*(3-x)/((1-6*x+x^2)*(1-x)) + O(x^40)) \\ Colin Barker, Mar 05 2016

Formula

a(n) = 2*A001652(n) = -1 + A002315(n).
a(n) - a(n-1) = A003499(n).
From Michael Somos, Apr 07 2003: (Start)
G.f.: 2*x*(3-x)/((1-6*x+x^2)*(1-x)).
a(n) = 6*a(n-1) - a(n-2) + 4.
a(-1-n) = -a(n) - 2. (End)
a(1)=6, a(2)=40, a(3)=238, a(n) = 7*a(n-1)-7*a(n-2)+a(n-3). - Harvey P. Dale, Dec 27 2011
a(n)^2 + (a(n)+2)^2 = A075870(n+1)^2 = A165518(n+1). - Joerg Arndt, Feb 15 2012
a(n) = (-2-(3-2*sqrt(2))^n*(-1+sqrt(2))+(1+sqrt(2))*(3+2*sqrt(2))^n)/2. - Colin Barker, Mar 05 2016
From Klaus Purath, Sep 05 2021: (Start)
(a(n+1) - a(n) - a(n-1) + a(n-2))/8 = A005319(n), for n >= 3.
((a(n) - a(n-1))^2)/2 - 2 = A005319(n)^2 = 2*A132592(n), for n>= 2.
a(n) = A265278(2*n+1).
a(n) = A293004(2*n+1).
a(n) = A213667(2*n).
a(n) = Sum_{k=1..n} A003499(k). (End)

A265106 Expansion of (x^5-x^4-2*x^3+x^2-x)/(-x^4+x^3-2*x^2+3*x-1).

Original entry on oeis.org

0, 1, 2, 6, 16, 36, 80, 178, 394, 870, 1920, 4236, 9344, 20610, 45458, 100262, 221136, 487732, 1075728, 2372594, 5232922, 11541574, 25455744, 56144412, 123830400, 273116546, 602377506, 1328585414, 2930287376, 6462952260, 14254489936, 31439267250, 69341486762
Offset: 0

Views

Author

Alois P. Heinz, Apr 06 2016

Keywords

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(x^5-x^4-2x^3+x^2-x)/(-x^4+x^3-2x^2+3x-1),{x,0,40}],x] (* or *) LinearRecurrence[{3,-2,1,-1},{0,1,2,6,16,36},40] (* Harvey P. Dale, Feb 05 2019 *)
  • PARI
    concat(0, Vec(x*(1-x+2*x^2+x^3-x^4)/((1-x)*(1-2*x-x^3)) + O(x^50))) \\ Colin Barker, Apr 12 2016

Formula

a(n) = 3*a(n-1)-2*a(n-2)+a(n-3)-a(n-4) for n>5. - Colin Barker, Apr 12 2016
a(n) = 2*a(n-1) + a(n-3) + 2 for n>4. - Greg Dresden, Feb 09 2020

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

Original entry on oeis.org

0, 1, 2, 6, 16, 36, 76, 156, 316, 636, 1276, 2556, 5116, 10236, 20476, 40956, 81916, 163836, 327676, 655356, 1310716, 2621436, 5242876, 10485756, 20971516, 41943036, 83886076, 167772156, 335544316, 671088636, 1342177276, 2684354556, 5368709116, 10737418236, 21474836476
Offset: 0

Views

Author

N. J. A. Sloane, Apr 06 2016

Keywords

Crossrefs

Agrees with A048487 except for initial terms.

Programs

  • Magma
    [n le 2 select n else 5*2^(n-2)-4: n in [0..40]]; // Bruno Berselli, Apr 08 2016
    
  • PARI
    concat(0, Vec(x*(1-x+2*x^2+2*x^3)/((1-x)*(1-2*x)) + O(x^50))) \\ Colin Barker, Apr 12 2016

Formula

G.f.: x*(1 - x + 2*x^2 + 2*x^3)/((1 - x)*(1 - 2*x)).
a(n) = 5*2^(n-2)-4 for n>2. - Bruno Berselli, Apr 08 2016
a(n) = 3*a(n-1)-2*a(n-2) for n>4. - Colin Barker, Apr 12 2016
From Paul Curtz, Sep 23 2019: (Start)
a(n+1) = b(n+4) - b(n) where b(n) = 0, 1, 1, 1 followed by A026646.
a(n) = 2*a(n-1)+4 for n>4. (End)

A293004 Expansion of 2*x^2 / (x^3 + x^2 - 3x + 1).

Original entry on oeis.org

0, 0, 2, 6, 16, 40, 98, 238, 576, 1392, 3362, 8118, 19600, 47320, 114242, 275806, 665856, 1607520, 3880898, 9369318, 22619536, 54608392, 131836322, 318281038, 768398400, 1855077840, 4478554082, 10812186006, 26102926096, 63018038200, 152139002498
Offset: 0

Views

Author

J. Devillet, Sep 28 2017

Keywords

Comments

Number of weak orderings R on {1,...,n} that are weakly single-peaked w.r.t. the total ordering 1 < ... < n and for which {1,...,n} has exactly one maximal element for the weak ordering R.

Crossrefs

Essentially the same as A265278.

Programs

  • Magma
    I:=[0,0,2]; [n le 3 select I[n] else 3*Self(n-1)-Self(n-2)-Self(n-3): n in [1..40]]; // Vincenzo Librandi, Oct 09 2017
  • Maple
    A293004:=gfun:-rectoproc({a(n)=3*a(n-1) -a(n-2)-a(n-3),a(0)=0,a(1)=0,a(2)=2},a(n),remember):  map(A293004, [$0..10^3]);  # Muniru A Asiru, Oct 09 2017
  • Mathematica
    CoefficientList[Series[2 x^2/(x^3 + x^2 - 3 x + 1), {x, 0, 30}], x] (* Michael De Vlieger, Oct 06 2017 *)
    RecurrenceTable[{a[1]==a[2]==0, a[3]==2, a[n]==3a[n-1] - a[n-2] - a[n-3]}, a, {n, 40}] (* Vincenzo Librandi, Oct 09 2017 *)
  • PARI
    concat(vector(2), Vec(2*x^2 / (x^3+x^2-3*x+1) + O(x^40))) \\ Colin Barker, Sep 28 2017
    

Formula

G.f.: 2*x^2 / (x^3 + x^2 - 3x + 1).
a(n) = 2*A048739(n-2), a(0) = a(1) = 0.
From Colin Barker, Sep 28 2017: (Start)
a(n) = 3*a(n-1) - a(n-2) - a(n-3) for n > 2.
a(n) = (-2 + (1-sqrt(2))^n + (1+sqrt(2))^n) / 2. (End)
a(n) = A265278(n) for n != 1. - Joerg Arndt, Oct 01 2017

A287144 Number of partitions of n such that the absolute difference between any part i and the sum of all other parts not larger than i is not larger than two.

Original entry on oeis.org

1, 1, 2, 2, 4, 4, 7, 6, 10, 8, 15, 11, 17, 13, 23, 16, 24, 18, 33, 23, 34, 26, 43, 28, 41, 30, 53, 36, 52, 39, 63, 40, 58, 42, 75, 51, 74, 56, 90, 57, 83, 60, 103, 69, 97, 71, 112, 69, 99, 71, 124, 83, 119, 89, 141, 88, 127, 91, 154, 102, 142, 103, 161, 98
Offset: 0

Views

Author

Alois P. Heinz, May 20 2017

Keywords

Examples

			a(7) = 6: 31111, 3211, 322, 331, 4111, 421.
a(8) = 10: 32111, 3221, 3311, 332, 41111, 4211, 422, 431, 5111, 521.
a(9) = 8: 42111, 4221, 4311, 432, 51111, 5211, 522, 531.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
          b(n, i-1)+`if`(i>n or abs(i-(n-i))>2, 0, b(n-i, i))))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..100);
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0, b[n, i - 1] + If[i > n || Abs[i - (n - i)] > 2, 0, b[n - i, i]]]];
    a[n_] := b[n, n];
    a /@ Range[0, 100] (* Jean-François Alcover, Dec 11 2020, after Alois P. Heinz *)

Formula

a(2^n-1) = A265278(n) for n>0.
a(2^n) = A052542(n).
a(2^n+1) = A182780(n-1) for n>0.
Showing 1-7 of 7 results.