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-10 of 13 results. Next

A105693 a(n) = Fibonacci(2n+2)-2^n.

Original entry on oeis.org

0, 1, 4, 13, 39, 112, 313, 859, 2328, 6253, 16687, 44320, 117297, 309619, 815656, 2145541, 5637351, 14799280, 38826025, 101809867, 266865720, 699311581, 1832117599, 4799138368, 12569491809, 32917725667, 86200462408, 225717215989, 591018294423, 1547471885008
Offset: 0

Views

Author

Paul Barry, Apr 17 2005

Keywords

Crossrefs

Programs

  • Magma
    [Fibonacci(2*n+2)-2^n: n in [0..30]]; // Vincenzo Librandi, Apr 21 2011
    
  • Mathematica
    Table[Fibonacci[2n+2]-2^n,{n,0,30}] (* or *) LinearRecurrence[{5,-7,2},{0,1,4},40] (* Harvey P. Dale, Jul 21 2016 *)
  • PARI
    concat(0, Vec(x*(1-x)/((1-2*x)*(1-3*x+x^2)) + O(x^40))) \\ Colin Barker, Sep 12 2016
    
  • PARI
    a(n)=fibonacci(2*n+2)-2^n \\ Charles R Greathouse IV, Sep 12 2016

Formula

G.f.: x(1-x)/((1-2x)(1-3x+x^2)).
a(n) = sum{k=0..n+1, binomial(n+1, k+1)*sum{j=0..floor(k/2), F(k-2j)}}.
a(n) = A258109(n+1) + A001906(n), n>1. - Yuriy Sibirmovsky, Sep 12 2016
a(n) = 5*a(n-1)-7*a(n-2)+2*a(n-3) for n>2. - Colin Barker, Sep 12 2016

A258109 Number of balanced parenthesis expressions of length 2n and depth 3.

Original entry on oeis.org

1, 5, 18, 57, 169, 482, 1341, 3669, 9922, 26609, 70929, 188226, 497845, 1313501, 3459042, 9096393, 23895673, 62721698, 164531565, 431397285, 1130708866, 2962826465, 7761964833, 20331456642, 53249182309, 139449644717, 365166860706, 956185155129, 2503657040137
Offset: 3

Views

Author

Gheorghe Coserea, May 20 2015

Keywords

Comments

a(n) is the number of Dyck paths of length 2n and height 3. For example, a(3) = 1 because there is only one such Dyck path which is UUUDDD. - Ran Pan, Sep 26 2015
a(n) is the number of rooted plane trees with n+1 nodes and height 3 (see example for correspondence). - Gheorghe Coserea, Feb 04 2016

Examples

			For n=4, the a(4) = 5 solutions are
                /\       /\
               /  \        \
LRLLLRRR    /\/    \        \
................................
                /\        |
             /\/  \      / \
LLRLLRRR    /      \        \
................................
              /\/\        |
             /    \       |
LLLRLRRR    /      \     / \
................................
              /\          |
             /  \/\      / \
LLLRRLRR    /      \    /
................................
              /\          /\
             /  \        /
LLLRRRLR    /    \/\    /
		

References

  • S. S. Skiena and M. A. Revilla, Programming Challenges: The Programming Contest Training Manual, Springer, 2006, page 140.

Crossrefs

Column k=3 of A080936.
Column k=2 of A287213.

Programs

  • C
    typedef long long unsigned Integer;
    Integer a(int n)
    {
        int i;
        Integer pow2 = 1, a[3] = {0};
        for (i = 3; i <= n; ++i) {
            a[ i%3 ] = pow2 + 3 * a[ (i-1)%3 ] - a[ (i-2)%3 ];
            pow2 = pow2 * 2;
        }
        return a[ (i-1)%3 ];
    }
    
  • Magma
    I:=[1,5,18,57,169]; [n le 5 select I[n] else 5*Self(n-1) - 7*Self(n-2) + 2*Self(n-3): n in [1..40]]; // Vincenzo Librandi, Sep 26 2015
    
  • Maple
    a:= proc(n) option remember; `if`(n<3, 0,
          `if`(n=3, 1, 2^(n-3) +3*a(n-1) -a(n-2)))
        end:
    seq(a(n), n=3..30);  # Alois P. Heinz, May 20 2015
  • Mathematica
    Join[{1, 5}, LinearRecurrence[{5, -7, 2}, {18, 57, 169}, 30]] (* Vincenzo Librandi, Sep 26 2015 *)
  • PARI
    Vec(-x^3/((2*x-1)*(x^2-3*x+1)) + O(x^100)) \\ Colin Barker, May 24 2015
    
  • PARI
    a(n) = fibonacci(2*n-1) - 2^(n-1)  \\ Gheorghe Coserea, Feb 04 2016

Formula

a(n) = 2^(n-3) + 3 * a(n-1) - a(n-2).
a(n) = 5*a(n-1) - 7*a(n-2) + 2*a(n-3) for n>5. - Colin Barker, May 24 2015
G.f.: -x^3 / ((2*x-1)*(x^2-3*x+1)). - Colin Barker, May 24 2015
a(n) = A000045(2n-1) - A000079(n-1). - Gheorghe Coserea, Feb 04 2016
a(n) = 2^(-1-n)*(-5*4^n - (-5+sqrt(5))*(3+sqrt(5))^n + (3-sqrt(5))^n*(5+sqrt(5))) / 5. - Colin Barker, Jun 05 2017
a(n) = Sum_{i=1..n-1} A061667(i)*(n-1-i) - Tim C. Flowers, May 16 2018

A079289 For even n, a(n) = a(n-2) + a(n-1) + 2^(n/2-2), n>2. For odd n, a(n) = a(n-2) + a(n-1).

Original entry on oeis.org

1, 1, 2, 3, 6, 9, 17, 26, 47, 73, 128, 201, 345, 546, 923, 1469, 2456, 3925, 6509, 10434, 17199, 27633, 45344, 72977, 119345, 192322, 313715, 506037, 823848, 1329885, 2161925, 3491810, 5670119, 9161929, 14864816, 24026745, 38957097, 62983842
Offset: 0

Views

Author

Paul Barry, Feb 08 2003

Keywords

Comments

Generalized Fibonacci sequence: a(n) = a(n-2) + a(n-1), and for even n a row sum of Pascal's triangle (a power of two) is added.
Call a multiset of nonzero integers good if the sum of the cubes is the square of the sum. The number of ascending chains of good multisets starting from the empty set by adding one element at a time is a(n). - Michael Somos, Apr 14 2005
a(n) is the number of compositions of n which consist of an initial (possibly empty) subsequence of even summands and a remaining (possibly empty) sequence of odd summands.

Examples

			a(4) = 6 from the good multisets {-1,-1,1,1}, {-1,1,1,2}, {-2,-1,1,2}, {-2,1,2,2}, {-3,1,2,3}, {1,2,3,4}.
a(4) = 6 because there are six compositions of four, in which the initial parts are all even and the final parts are all odd: 4, 3+1, 1+3, 2+2, 2+1+1, 1+1+1+1.
		

Crossrefs

Cf. A000045, A005674, A007318, A011782, A061667 (bisection).

Programs

  • Magma
    I:=[1,1,2,3,6]; [n le 5 select I[n] else Self(n-1)+3*Self(n-2) -2*Self(n-3)-2*Self(n-4): n in [1..40]]; // Vincenzo Librandi, Aug 05 2013
  • Mathematica
    CoefficientList[Series[(1-x^2)^2/(1-x-x^2)/(1-2x^2),{x,0,37}],x]
    LinearRecurrence[{1,3,-2,-2}, {1,1,2,3,6}, 25] (* G. C. Greubel, Aug 16 2016; corrected by Georg Fischer, Apr 02 2019 *)
    nxt[{n_,a_,b_}]:={n+1,b,If[EvenQ[n],a+b,a+b+2^((n+1)/2-2)]}; Join[{1}, NestList[ nxt,{2,1,2},40][[All,2]]] (* Harvey P. Dale, Jul 13 2019 *)
  • PARI
    {a(n)=local(A); if(n<3,(n>=0)+(n>1), A=vector(n,i,i); for(i=3,n,A[i]=A[i-1]+A[i-2]+ if(i%2==0,2^(i/2-2))); A[n])} /* Michael Somos, Apr 14 2005 */
    

Formula

a(n) = a(n-2) + a(n-1) + floor(2^(n/2-2))*(1-(-1)^(n+1))/2 for n>1.
G.f.: (1-x^2)^2/((1-x-x^2)*(1-2*x^2)).
a(n) = -A016116(n+1)/2 +A000045(n+2), n>0. - R. J. Mathar, Sep 27 2012
From Gregory L. Simay, Jul 25 2016: (Start)
If n = 2k+1, a(n) = the convolution Sum_{j=0,..k} c(j)*F(n-2j), where c(j) = A011782(j) = 2^(j-1) and f(j)= A000045(j).
If n = 2k, a(n) = c(k) + the convolution Sum_{j=0,..(k-1)} c(j)*F(n-2j), where c(j)=A011782(j)=2^(j-1) and f(j)= A000045(j). (End)

A089932 G.f.: (1-x)^5/((-1+4*x-3*x^2+x^3)*(1-3*x+x^2)*(-1+2*x)).

Original entry on oeis.org

1, 4, 16, 60, 215, 747, 2539, 8491, 28049, 91782, 298109, 962594, 3093687, 9905444, 31619072, 100681587, 319944693, 1015039586, 3215903436, 10177462312, 32179381609, 101668695088, 321014982282, 1013068488800, 3195703133266, 10077204123667, 31767718475161
Offset: 0

Views

Author

N. J. A. Sloane, Jan 18 2004

Keywords

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(1-x)^5/((-1+4x-3x^2+x^3)(1-3x+x^2)(-1+2x)),{x,0,30}],x] (* or *) LinearRecurrence[{9,-30,46,-34,13,-2},{1,4,16,60,215,747},30] (* Harvey P. Dale, May 20 2015 *)

A097750 Reversal of the binomial transform of the Whitney triangle A004070 (see A131250), triangle read by rows, T(n,k) for 0 <= k <= n.

Original entry on oeis.org

1, 1, 2, 1, 4, 4, 1, 6, 11, 8, 1, 8, 22, 26, 16, 1, 10, 37, 64, 57, 32, 1, 12, 56, 130, 163, 120, 64, 1, 14, 79, 232, 386, 382, 247, 128, 1, 16, 106, 378, 794, 1024, 848, 502, 256, 1, 18, 137, 576, 1471, 2380, 2510, 1816, 1013, 512, 1, 20, 172, 834, 2517, 4944, 6476, 5812, 3797, 2036, 1024
Offset: 0

Views

Author

Paul Barry, Aug 23 2004

Keywords

Comments

Reversal of the Riordan array (1/(1-2x), x/(1-x)^2), see A131250. Row sums are A061667 and diagonal sums of A131250 are A045623. The n-th row elements correspond to the end elements of the 2n-th row of the Whitney triangle A004070. A131250 corresponds to the product of Pascal's triangle and the Whitney triangle.

Examples

			Triangle begins:
1;
1, 2;
1, 4, 4;
1, 6, 11, 8;
1, 8, 22, 26, 16;
1, 10, 37, 64, 57, 32;
1, 12, 56, 130, 163, 120, 64;
1, 14, 79, 232, 386, 382, 247, 128;
		

Crossrefs

Row sums are A061667.

Programs

  • Maple
    T := (n,k) -> binomial(2*n-k, k)*hypergeom([1, 1, -k], [1, 1-2*k+2*n], -1):
    for n from 0 to 8 do seq(simplify(T(n, k)), k=0..n) od; # Peter Luschny, Oct 28 2018
  • Mathematica
    T[, 0] = 1; T[n, n_] := 2^n; T[n_, k_] /; 0 < k < n := T[n, k] = T[n - 1, k] + 2 T[n - 1, k - 1] - T[n - 2, k - 2]; T[, ] = 0;
    Table[T[n, k], {n, 0, 10}, {k, 0, n}] (* Jean-François Alcover, Jun 19 2019 *)

Formula

T(n, k) = Sum_{i=0..n} binomial(n+k, i-k).
T(n, k) = T(n-1,k)+2*T(n-1,k-1)-T(n-2,k-2), T(0,0)=1, T(1,0)=1, T(1,1)=2, T(n,k)=0 if k<0 or if k>n. - Philippe Deléham, Jan 11 2014
T(n, k) = binomial(2*n-k, k)*hypergeom([1, 1, -k], [1, 1 - 2*k + 2*n], -1). - Peter Luschny, Oct 28 2018

Extensions

Definition and comments corrected by Philippe Deléham, Jan 11 2014

A125171 Riordan array ((1-x)/(1-3*x+x^2),x/(1-x)) read by rows.

Original entry on oeis.org

1, 2, 1, 5, 3, 1, 13, 8, 4, 1, 34, 21, 12, 5, 1, 89, 55, 33, 17, 6, 1, 233, 144, 88, 50, 23, 7, 1, 610, 377, 232, 138, 73, 30, 8, 1, 1597, 987, 609, 370, 211, 103, 38, 9, 1, 4181, 2584, 1596, 979, 581, 314, 141, 47, 10, 1, 10946, 6765, 4180, 2575, 1560, 895, 455, 188, 57, 11, 1, 28657, 17711, 10945, 6755, 4135, 2455, 1350, 643
Offset: 0

Views

Author

Gary W. Adamson, Nov 22 2006

Keywords

Comments

Partial column sums triangle of odd-indexed Fibonacci numbers.
Left border = odd-indexed Fibonacci numbers, next-to-left border = even-indexed Fibonacci numbers. Row sums = A061667: (1, 3, 9, 26, 73, 201, ...).
Diagonal sums are A027994(n). - Philippe Deléham, Jan 14 2014

Examples

			(6,3) = 33 = 12 + 21 = (5,3) + (5,2). First few rows of the triangle are:
   1;
   2,  1;
   5,  3,  1;
  13,  8,  4,  1;
  34, 21, 12,  5,  1;
  89, 55, 33, 17,  6,  1;
  ...
		

Crossrefs

Cf. A027994, A061667 (row sums).

Programs

  • Maple
    C := proc (n, k) if 0 <= k and k <= n then factorial(n)/(factorial(k)*factorial(n-k)) else 0 end if;
    end proc:
    with(combinat):
    for n from 0 to 10 do
        seq(C(n, n-k) + add(fibonacci(2*i)*C(n-i, n-k-i), i = 1..n), k = 0..n);
    end do; # Peter Bala, Mar 21 2018
  • PARI
    T(n,k)=if(k==n,1,if(k<=1,fibonacci(2*n-1),T(n-1,k)+T(n-1,k-1)));
    for(n=1,15,for(k=1,n,print1(T(n,k),", "));print()); /* show triangle */
    /* Joerg Arndt, Jun 17 2011 */

Formula

Let the left border = odd-indexed Fibonacci numbers, (1, 2, 5, 13, 34...); then for k>1, T(n,k) = T(n-1,k) + T(n-1,k-1).
G.f.: (1-x)^2/((1-3*x+x^2)*(1-x*(1+y))). - Paul Barry, Dec 05 2006
T(n,k) = 4*T(n-1,k) + T(n-1,k-1) - 4*T(n-2,k) - 3*T(n-2,k-1) + T(n-3,k) + T(n-3,k-1), T(0,0)=1, T(1,0)=2, T(1,1)=1, T(2,0)=5, T(2,1)=3, T(2,2)=1, T(n,k)=0 if k<0 or if k>n. - Philippe Deléham, Jan 14 2014
Exp(x) * e.g.f. for row n = e.g.f. for diagonal n. For example, for n = 3 we have exp(x)*(13 + 8*x + 4*x^2/2! + x^3/3!) = 13 + 21*x + 33*x^2/2! + 50*x^3/3! + 73*x^4/4! + .... The same property holds more generally for Riordan arrays of the form ( f(x), x/(1 - x) ). - Peter Bala, Dec 21 2014
T(n,k) = C(n, n-k) + Sum_{i = 1..n} Fibonacci(2*i)*C(n-i, n-k-i), where C(n,k) = n!/(k!*(n-k)!) for 0 <= k <= n, otherwise 0. - Peter Bala, Mar 21 2018

Extensions

New description from Paul Barry, Dec 05 2006
Data error corrected by Johannes W. Meijer, Jun 16 2011

A079284 Diagonal sums of triangle A008949.

Original entry on oeis.org

1, 1, 3, 4, 9, 13, 26, 39, 73, 112, 201, 313, 546, 859, 1469, 2328, 3925, 6253, 10434, 16687, 27633, 44320, 72977, 117297, 192322, 309619, 506037, 815656, 1329885, 2145541, 3491810, 5637351, 9161929, 14799280, 24026745, 38826025, 62983842, 101809867, 165055853, 266865720
Offset: 0

Views

Author

Paul Barry, Feb 08 2003

Keywords

Comments

a(2n) - a(2n-1) = Fibonacci(2n+1).
Diagonal sums of triangle A054450. - Paul Barry, Oct 23 2004

Crossrefs

Programs

  • Magma
    [Fibonacci(n+3)-2^Floor((n+1)/2): n in [0..40]]; // Vincenzo Librandi, Aug 05 2013
  • Maple
    with (combinat):a[0]:=0:a[1]:=1:a[2]:=1:for n from 2 to 50 do a[n]:=fibonacci(n-1)+2*a[n-2] od: seq(a[n], n=1..31); # Zerinvary Lajos, Mar 17 2008
  • Mathematica
    CoefficientList[Series[(1 - x^2) / ((1 - x - x^2) (1 - 2 x^2)), {x, 0, 40}], x] (* Vincenzo Librandi, Aug 05 2013 *)
    LinearRecurrence[{1,3,-2,-2},{1,1,3,4},40] (* Harvey P. Dale, Nov 30 2018 *)

Formula

a(n) = Sum_{j=0..floor(n/2)} Sum_{i=0..j} binomial(n-j, i).
a(n) = Fibonacci(n+3) - 2^floor((n+1)/2). - Vladeta Jovovic, Feb 12 2003
G.f.: (1-x^2)/((1-x-x^2)(1-2x^2)). - Paul Barry, Jan 13 2005

A121460 Triangle read by rows: T(n,k) is the number of nondecreasing Dyck paths of semilength n, having k returns to the x-axis (1<=k<=n).

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 5, 4, 3, 1, 13, 9, 7, 4, 1, 34, 22, 16, 11, 5, 1, 89, 56, 38, 27, 16, 6, 1, 233, 145, 94, 65, 43, 22, 7, 1, 610, 378, 239, 159, 108, 65, 29, 8, 1, 1597, 988, 617, 398, 267, 173, 94, 37, 9, 1, 4181, 2585, 1605, 1015, 665, 440, 267, 131, 46, 10, 1, 10946, 6766
Offset: 1

Views

Author

Emeric Deutsch, Jul 31 2006

Keywords

Comments

Also the number of directed column-convex polyominoes of area n, having k cells in the bottom row. Row sums are the odd-subscripted Fibonacci numbers (A001519). T(n,1)=fibonacci(2n-3) for n>=2 (A001519). T(n,2)=1+fibonacci(2n-4)=A055588(n-2). T(n,3)=n-3+fibonacci(2n-5). Sum(k*T(n,k),k=1..n)=A061667(n-1).

Examples

			T(4,2)=4 because we have UUDDUUDD, UDUUUDDD, UUUDDDUD and UDUUDUDD, where U=(1,1) and D=(1,-1) (the Dyck path UUDUDDUD does not qualify: it does have 2 returns to the x-axis but it is not nondecreasing since its valleys are at altitudes 1 and 0).
Triangle starts:
  1;
  1,1;
  2,2,1;
  5,4,3,1;
  13,9,7,4,1;
  34,22,16,11,5,1;
  ...
		

Crossrefs

Programs

  • Maple
    with(combinat): T:=(n,k)->binomial(n-2,k-2)+add(fibonacci(2*j-1)*binomial(n-2-j,k-2),j=1..n-k): for n from 1 to 12 do seq(T(n,k),k=1..n) od; # yields sequence in triangular form

Formula

T(n,k) = binomial(n-2,k-2)+Sum(fibonacci(2j-1)*binomial(n-2-j,k-2), j=1..n-k).
G.f.: G(t,z)=tz(1-2z)(1-z)/[(1-3z+z^2)(1-z-tz)].

A147293 Triangle read by rows, A011782 convolved with A001519.

Original entry on oeis.org

1, 1, 2, 2, 2, 5, 4, 4, 5, 13, 8, 8, 10, 13, 34, 16, 16, 20, 26, 34, 89, 32, 32, 40, 52, 68, 89, 233, 64, 64, 80, 104, 136, 178, 233, 610, 128, 128, 160, 208, 272, 356, 466, 610, 1597, 256, 256, 320, 416, 544, 712, 932, 1220, 1597, 4181
Offset: 0

Views

Author

Gary W. Adamson, Nov 05 2008

Keywords

Comments

Row sums = A061667: (1, 3, 9, 26, 73, 201, ...).

Examples

			First few rows of the triangle =
    1;
    1,   2;
    2,   2,   5;
    4,   4,   5,  13;
    8,   8,  10,  13,  34;
   16,  16,  20,  26,  34,  89;
   32,  32,  40,  52,  68,  89, 233;
   64,  64,  80, 104, 136, 178, 233,  610;
  128, 128, 160, 208, 272, 356, 466,  610, 1597;
  256, 256, 320, 416, 544, 712, 932, 1220, 1597, 4181;
  ...
Row 3 = (4, 4, 5, 13) = termwise products of (4, 2, 1, 1) and (1, 2, 5, 13). Row 3 sum of terms = 26 = (1, 1, 2, 4) convolved with (1, 2, 5, 13).
		

Crossrefs

Formula

Let M = an infinite lower triangular matrix with A011782: (1, 1, 2, 4, 8, 16, ...) in every column; and Q = an infinite lower triangular matrix with odd-indexed Fibonacci numbers, A001519: (1, 2, 5, 13, 34, 89, ...) as the main column and the rest zeros.
A147293 = M * Q.

A089947 G.f.: (1-x)^9/((1-5*x+6*x^2-4*x^3+x^4)*(-1+4*x-3*x^2+x^3)*(1-3*x+x^2)*(-1+2*x)).

Original entry on oeis.org

1, 5, 25, 115, 500, 2092, 8512, 33910, 132892, 514079, 1968021, 7470434, 28160354, 105542777, 393672627, 1462503264, 5414896000, 19991387639, 73628208598, 270614786791, 992880076249, 3637400475618, 13308475404934, 48639360355243, 177597694845849
Offset: 0

Views

Author

N. J. A. Sloane, Jan 18 2004

Keywords

References

  • A. Burstein and T. Mansour, Words restricted by 3-letter ..., Annals. Combin., 7 (2003), 1-14; see Th. 3.6, case k=5.

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(1-x)^9/((1-5x+6x^2-4x^3+x^4)(-1+4x-3x^2+x^3)(1-3x+x^2)(-1+2x)),{x,0,30}],x] (* or *) LinearRecurrence[{14,-81,254,-481,588,-485,270,-98,21,-2},{1,5,25,115,500,2092,8512,33910,132892,514079},30] (* Harvey P. Dale, Oct 03 2015 *)
Showing 1-10 of 13 results. Next