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 11 results. Next

A051159 Triangle read by rows: T(n, k) = binomial(n mod 2, k mod 2) * binomial(n div 2, k div 2), where 'div' denotes integer division.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 2, 0, 1, 1, 1, 2, 2, 1, 1, 1, 0, 3, 0, 3, 0, 1, 1, 1, 3, 3, 3, 3, 1, 1, 1, 0, 4, 0, 6, 0, 4, 0, 1, 1, 1, 4, 4, 6, 6, 4, 4, 1, 1, 1, 0, 5, 0, 10, 0, 10, 0, 5, 0, 1, 1, 1, 5, 5, 10, 10, 10, 10, 5, 5, 1, 1, 1, 0, 6, 0, 15, 0, 20, 0, 15, 0, 6, 0, 1, 1, 1, 6, 6, 15, 15, 20, 20, 15, 15, 6, 6, 1, 1
Offset: 0

Views

Author

Michael Somos, Oct 14 1999

Keywords

Comments

Previous name: Triangular array made of three copies of Pascal's triangle.
Computing each term modulo 2 also gives A047999, i.e., a(n) mod 2 = A007318(n) mod 2 for all n. (The triangle is paritywise isomorphic to Pascal's Triangle.) - Antti Karttunen
5th row/column gives entries of A000217 (triangular numbers C(n+1,2)) repeated twice and every other entry in 6th row/column form A000217. 7th row/column gives entries of A000292 (Tetrahedral (or pyramidal) nos: C(n+3,3)) repeated twice and every other entry in 8th row/column form A000292. 9th row/column gives entries of A000332 (binomial coefficients binomial(n,4)) repeated twice and every other entry in 10th row/column form A000332. 11th row/column gives entries of A000389 (binomial coefficients C(n,5)) repeated twice and every other entry in 12th row/column form A000389. - Gerald McGarvey, Aug 21 2004
If Sum_{k=0..n} A(k)*T(n,k) = B(n), the sequence B is the S-D transform of the sequence A. - Philippe Deléham, Aug 02 2006
Number of n-bead black-white reversible strings with k black beads; also binary grids; string is palindromic. - Yosu Yurramendi, Aug 07 2008
Row sums give A016116(n+1). - Yosu Yurramendi, Aug 07 2008 [corrected by Petros Hadjicostas, Nov 04 2017]
Coefficients in expansion of (x + y)^n where x and y anticommute (y x = -x y), that is, q-binomial coefficients when q = -1. - Michael Somos, Feb 16 2009
The sequence of coefficients of a general polynomial recursion that links at w=2 to the Pascal triangle is here w=0. Row sums are {1, 2, 2, 4, 4, 8, 8, 16, 16, 32, 32, 64, ...}. - Roger L. Bagula and Gary W. Adamson, Dec 04 2009
T(n,k) is the number of palindromic compositions of n+1 with exactly k+1 parts. T(6,4) = 3 because we have the following compositions of n+1=7 with length k+1=5: 1+1+3+1+1, 2+1+1+1+2, 1+2+1+2+1. - Geoffrey Critzer, Mar 15 2014 [corrected by Petros Hadjicostas, Nov 03 2017]
Let P(n,k) be the number of palindromic compositions of n with exactly k parts. MacMahon (1893) was the first to prove that P(n,k) = T(n-1,k-1), where T(n,k) are the numbers in this sequence (see the comment above by G. Critzer). He actually proved that, for 1 <= s <= m, we have P(2*m,2*s) = P(2*m,2*s-1) = P(2*m-1, 2*s-1) = bin(m-1, s-1), but P(2*m-1, 2*s) = 0. For the current sequence, this can be translated into T(2*m-1, 2*s-1) = T(2*m-1,2*s-2) = T(2*m-2, 2*s-2) = bin(m-1,s-1), but T(2m-2, 2*s-1) = 0 (valid again for 1 <= s <= m). - Petros Hadjicostas, Nov 03 2017
T is the infinite lower triangular matrix for this sequence; define two others, U and V; let U(n,k)=e_k(-1,2,-3,...,(-1)^n n), where e_k is the k-th elementary symmetric polynomial, and let V be the diagonal matrix A057077 (periodic sequence 1,1,-1,-1). Clearly V^-1 = V. Conjecture: U = U^-1, T = U . V, T^-1 = V . U, and |T| = |U|. - George Beck, Dec 16 2017
Let T*(n,k)=T(n,k) except when n is odd and k=(n+1)/2, where T*(n,k) = T(n,k)+2^((n-1)/2). Thus, T*(n,k) is the number of non-isomorphic symmetric stairs with n cells and k steps, i.e., k-1 changes of direction. See A016116. - Christian Barrientos and Sarah Minion, Jul 29 2018

Examples

			Triangle starts:
{1},
{1,  1},
{1,  0,  1},
{1,  1,  1,  1},
{1,  0,  2,  0,  1},
{1,  1,  2,  2,  1,  1},
{1,  0,  3,  0,  3,  0,  1},
{1,  1,  3,  3,  3,  3,  1,  1},
{1,  0,  4,  0,  6,  0,  4,  0,  1},
{1,  1,  4,  4,  6,  6,  4,  4,  1,  1},
{1,  0,  5,  0, 10,  0, 10,  0,  5,  0,  1},
{1,  1,  5,  5, 10, 10, 10, 10,  5,  5,  1,  1}
... - _Roger L. Bagula_ and _Gary W. Adamson_, Dec 04 2009
		

Crossrefs

Programs

  • Haskell
    a051159 n k = a051159_tabl !! n !! k
    a051159_row n = a051159_tabl !! n
    a051159_tabl = [1] : f [1] [1,1] where
       f us vs = vs : f vs (zipWith (+) ([0,0] ++ us) (us ++ [0,0]))
    -- Reinhard Zumkeller, Apr 25 2013
    
  • Maple
    T:= proc(n, k) option remember; `if`(n=0 and k=0, 1,
          `if`(n<0 or k<0, 0, `if`(irem(n, 2)=1 or
           irem(k, 2)=0, T(n-1, k-1) + T(n-1, k), 0)))
        end:
    seq(seq(T(n, k), k=0..n), n=0..14);  # Alois P. Heinz, Jul 12 2014
  • Mathematica
    T[ n_, k_] := QBinomial[n, k, -1]; (* Michael Somos, Jun 14 2011; since V7 *)
    Clear[p, n, x, a]
    w = 0;
    p[x, 1] := 1;
    p[x_, n_] := p[x, n] = If[Mod[n, 2] == 0, (x + 1)*p[x, n - 1], (x^2 + w*x + 1)^Floor[n/2]]
    a = Table[CoefficientList[p[x, n], x], {n, 1, 12}]
    Flatten[a] (* Roger L. Bagula and Gary W. Adamson, Dec 04 2009 *)
  • PARI
    {T(n, k) = binomial(n%2, k%2) * binomial(n\2, k\2)};
    
  • Python
    from math import comb as binomial
    def T(n, k): return binomial(n%2, k%2) * binomial(n//2, k//2)
    print([T(n, k) for n in range(14) for k in range(n+1)])  # Peter Luschny, Oct 17 2024
  • SageMath
    @cached_function
    def T(n, k):
        if k == 0 or k == n: return 1
        return T(n-1, k-1) + (-1)^k*T(n-1, k)
    for n in (0..12): print([T(n, k) for k in (0..n)]) # Peter Luschny, Jul 06 2021
    

Formula

T(n, k) = T(n-1, k-1) + T(n-1, k) if n odd or k even, else 0. T(0, 0) = 1.
T(n, k) = T(n-2, k-2) + T(n-2, k). T(0, 0) = T(1, 0) = T(1, 1) = 1.
Square array made by setting first row/column to 1's (A(i, 0) = A(0, j) = 1); A(1, 1) = 0; A(1, j) = A(1, j-2); A(i, 1) = A(i-2, 1); other entries A(i, j) = A(i-2, j) + A(i, j-2). - Gerald McGarvey, Aug 21 2004
Sum_{k=0..n} k * T(n,k) = A093968(n); A093968 = S-D transform of A001477. - Philippe Deléham, Aug 02 2006
Equals 2*A034851 - A007318. - Gary W. Adamson, Dec 31 2007. [Corrected by Yosu Yurramendi, Aug 07 2008]
A051160(n, k) = (-1)^floor(k/2) * T(n, k).
Sum_{k = 0..n} T(n,k)*x^k = A000012(n), A016116(n+1), A056487(n), A136859(n+2) for x = 0, 1, 2, 3 respectively. - Philippe Deléham, Mar 11 2014
G.f.: (1+x+x*y)/(1-x^2-y^2*x^2). - Philippe Deléham, Mar 11 2014
For n,k >= 1, T(n, k) = 0 when n odd and k even; otherwise, T(n, k) = binomial(floor((n-1)/2), floor((k-1)/2)). - Christian Barrientos, Mar 14 2020
From Werner Schulte, Jun 25 2021: (Start)
T(n,k) = T(n-1,k-1) + (-1)^k * T(n-1,k) for 0 < k < n with initial values T(n,0) = T(n,n) = 1 for n >= 0.
Matrix inverse is T^-1(n,k) = (-1)^((n-k)*(n+k+1)/2) * T(n,k) for 0 <= k <= n. (End)
From Peter Bala, Aug 08 2021: (Start)
Double Riordan array ( 1/(1 - x); x/(1 + x), x/(1 - x) ) in the notation of Davenport et al.
G.f. for column 2*n: (1 + x)*x^(2*n)/(1 - x^2)^(n+1); G.f. for column 2*n+1: x^(2*n+1)/(1 - x^2)^(n+1)
Row polynomials: R(2*n,x) = (1 + x^2)^n; R(2*n+1,x) = (1 + x)*(1 + x^2)^n.
The infinitesimal generator of this triangle has the sequence [1, 0, 1, 0, 1, 0, ...] on the main subdiagonal, the sequence [1, 1, 2, 2, 3, 3, 4, 4, ...] on the diagonal immediately below and zeros elsewhere.
Let T denote this lower triangular array. Then T^a, for a in C, is the double Riordan array ( (1 + a*x)/(1 - a*x^2); x/(1 + a*x), (1 + a*x)/(1 - a*x^2) ) with o.g.f. (1 + x*(a + y))/(1 - x^2*(a + y^2)) = 1 + (a + y)*x + (a + y^2)*x^2 + (a^2 + a*y + a*y^2 + y^3)*x^3 + (a^2 + 2*a*y^2 + y^4)*x^4 + ....
The (2*n)-th row polynomial of T^a is (a + y^2)^n; The (2*n+1)-th row polynomial of T^a is (a + y)*(a + y^2)^n. (End)

Extensions

New name using a formula of the author by Peter Luschny, Oct 17 2024

A026374 Triangular array T read by rows: T(n,0) = T(n,n) = 1 for all n >= 0, T(n,k) = T(n-1,k-1) + T(n-1,k) for odd n and 1< = k <= n-1, T(n,k) = T(n-1,k-1) + T(n-1,k) + T(n-2,k-1) for even n and 1 <= k <= n-1.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 4, 4, 1, 1, 6, 11, 6, 1, 1, 7, 17, 17, 7, 1, 1, 9, 30, 45, 30, 9, 1, 1, 10, 39, 75, 75, 39, 10, 1, 1, 12, 58, 144, 195, 144, 58, 12, 1, 1, 13, 70, 202, 339, 339, 202, 70, 13, 1, 1, 15, 95, 330, 685, 873, 685, 330, 95, 15, 1
Offset: 0

Views

Author

Keywords

Comments

T(n,k) is number of lattice paths from (0,0) to (n,n-2k) using steps U=(1,1), D=(1,-1) and, at levels ...,-4,-2,0,2,4,..., also H=(2,0). Example: T(4,1)=6 because we have the following paths from (0,0) to (4,2): UUUD, UUH, UUDU, UDUU, HUU and DUUU. Row sums yield A026383. Column 1 is A032766, column 2 is A026381, column 3 is A026382. - Emeric Deutsch, Jan 25 2004

Examples

			Triangle starts:
  1;
  1,  1;
  1,  3,   1;
  1,  4,   4,   1;
  1,  6,  11,   6,    1;
  1,  7,  17,  17,    7,    1;
  1,  9,  30,  45,   30,    9,    1;
  1, 10,  39,  75,   75,   39,   10,    1;
  1, 12,  58, 144,  195,  144,   58,   12,   1;
  1, 13,  70, 202,  339,  339,  202,   70,  13,   1;
  1, 15,  95, 330,  685,  873,  685,  330,  95,  15,  1;
  1, 16, 110, 425, 1015, 1558, 1558, 1015, 425, 110, 16, 1;
		

Crossrefs

Cf. A026375 (central terms).

Programs

  • Haskell
    a026374 n k = a026374_tabl !! n !! k
    a026374_row n = a026374_tabl !! n
    a026374_tabl = [1] : map fst (map snd $ iterate f (1, ([1, 1], [1]))) where
       f (0, (us, vs)) = (1, (zipWith (+) ([0] ++ us) (us ++ [0]), us))
       f (1, (us, vs)) = (0, (zipWith (+) ([0] ++ vs ++ [0]) $
                                 zipWith (+) ([0] ++ us) (us ++ [0]), us))
    -- Reinhard Zumkeller, Feb 22 2014
  • Mathematica
    p[x, 1] := 1;
    p[x_, n_] := p[x, n] = If[Mod[n, 2] == 0, (x + 1)*p[x, n - 1], (x^2 + 1)^Floor[n/2]];
    a = Table[CoefficientList[p[x, n], x], {n, 1, 12}];
    Flatten[a] (* Roger L. Bagula and Gary W. Adamson, Dec 04 2009 *)

Formula

T(n, k) = number of integer strings s(0), ..., s(n) such that s(0)=0, s(n) = n-2k, where, for 1 <= i <= n, s(i) is even if i is even and |s(i) - s(i-1)| <= 1.
From Emeric Deutsch, Jan 25 2004: (Start)
T(2n, k) = Sum_{j=ceiling(k/2)..k} 3^(2j-k)*binomial(n, j)*binomial(j, k-j);
T(2n+1, k) = T(2n, k-1) + T(2n, k).
G.f.: (1 + z + t*z)/(1 - (1+3*t+t^2)*z^2) = 1 + (1+t)*z + (1+3*t+t^2)*z^2+ ... .
Generating polynomial for row 2n is (1 + 3*t + t^2)^n;
Generating polynomial for row 2n+1 it is (1+t)*(1 + 3*t + t^2)^n. (End)
From Emeric Deutsch, Jan 30 2004: (Start)
T(2n, k) = Sum_{j=ceiling(k/2)..k} 3^(2j-k)*binomial(n, j)*binomial(j, k-j);
T(2n+1, k) = T(2n, k-1) + T(2n, k). (End)

A182522 a(0) = 1; thereafter a(2*n + 1) = 3^n, a(2*n + 2) = 2 * 3^n.

Original entry on oeis.org

1, 1, 2, 3, 6, 9, 18, 27, 54, 81, 162, 243, 486, 729, 1458, 2187, 4374, 6561, 13122, 19683, 39366, 59049, 118098, 177147, 354294, 531441, 1062882, 1594323, 3188646, 4782969, 9565938, 14348907, 28697814, 43046721, 86093442, 129140163, 258280326, 387420489
Offset: 0

Views

Author

Michael Somos, May 03 2012

Keywords

Comments

Row sums of triangle in A123149. - Philippe Deléham, May 04 2012
This is simply the classic sequence A038754 prefixed by a 1. - N. J. A. Sloane, Nov 23 2017
Binomial transform is A057960.
Range of row n of the circular Pascal array of order 6. - Shaun V. Ault, May 30 2014
a(n) is also the number of achiral color patterns in a row or cycle of length n using three or fewer colors. Two color patterns are the same if we permute the colors, so ABCAB=BACBA. For a cycle, we can rotate the colors, so ABCAB=CABAB. A row is achiral if it is the same as some color permutation of its reverse. Thus the reversal of ABCAB is BACBA, which is equivalent to ABCAB when we permute A and B. A cycle is achiral if it is the same as some rotation of some color permutation of its reverse. Thus CABAB reversed is BABAC. We can permute A and B to get ABABC and then rotate to get CABAB, so CABAB is achiral. It is interesting that the number of achiral color patterns is the same for rows and cycles. - Robert A. Russell, Mar 10 2018
Also, the number of walks of length n on the graph 0--1--2--3--4 starting at vertex 0. - Sean A. Irvine, Jun 03 2025

Examples

			G.f. = 1 + x + 2*x^2 + 3*x^3 + 6*x^4 + 9*x^5 + 18*x^6 + 27*x^7 + 54*x^8 + ...
From _Robert A. Russell_, Mar 10 2018: (Start)
For a(4) = 6, the achiral color patterns for rows are AAAA, AABB, ABAB, ABBA, ABBC, and ABCA.  Note that for cycles AABB=ABBA and ABBC=ABCA.  The achiral patterns for cycles are AAAA, AAAB, AABB, ABAB, ABAC, and ABBC.  Note that AAAB and ABAC are not achiral rows.
For a(5) = 9, the achiral color patterns (for both rows and cycles) are AAAAA, AABAA, ABABA, ABBBA, AABCC, ABACA, ABBBC, ABCAB, and ABCBA. (End)
		

Crossrefs

Cf. A038754 (essentially the same sequence).
Also row sums of triangle in A169623.
Column 3 of A305749.
Cf. A124302 (oriented), A001998 (unoriented), A107767 (chiral), for rows, varying offsets.
Cf. A002076 (oriented), A056353 (unoriented), A320743 (chiral), for cycles.

Programs

  • Magma
    I:=[1,1,2]; [n le 3 select I[n] else 3*Self(n-2): n in [1..40]]; // Bruno Berselli, Mar 19 2013
    
  • Mathematica
    Join[{1}, RecurrenceTable[{a[1]==1, a[2]==2, a[n]==3 a[n-2]}, a, {n, 40}]] (* Bruno Berselli, Mar 19 2013 *)
    CoefficientList[Series[(1+x-x^2)/(1-3*x^2), {x,0,50}], x] (* G. C. Greubel, Apr 14 2017 *)
    Table[If[EvenQ[n], StirlingS2[(n+6)/2,3] - 4 StirlingS2[(n+4)/2,3] + 5 StirlingS2[(n+2)/2,3] - 2 StirlingS2[n/2,3], StirlingS2[(n+5)/2,3] - 3 StirlingS2[(n+3)/2,3] + 2 StirlingS2[(n+1)/2,3]], {n,0,40}] (* Robert A. Russell, Oct 21 2018 *)
    Join[{1},Table[If[EvenQ[n], 2 3^((n-2)/2), 3^((n-1)/2)],{n,40}]] (* Robert A. Russell, Oct 28 2018 *)
  • Maxima
    makelist(if n=0 then 1 else (1+mod(n-1,2))*3^floor((n-1)/2), n, 0, 40); /* Bruno Berselli, Mar 19 2013 */
    
  • PARI
    {a(n) = if( n<1, n==0, n--; (n%2 + 1) * 3^(n \ 2))}
    
  • PARI
    my(x='x+O('x^50)); Vec((1+x-x^2)/(1-3*x^2)) \\ G. C. Greubel, Apr 14 2017
    
  • SageMath
    def A182522(n): return (3 -(3-2*sqrt(3))*((n+1)%2))*3^((n-3)/2) + int(n==0)/3
    [A182522(n) for n in range(41)] # G. C. Greubel, Jul 17 2023

Formula

G.f.: (1 + x - x^2) / (1 - 3*x^2).
Expansion of 1 / (1 - x / (1 - x / (1 + x / (1 + x)))) in powers of x.
a(n+1) = A038754(n).
a(n) = Sum_{k=0..n} A123149(n,k). - Philippe Deléham, May 04 2012
a(n) = (3-(1+(-1)^n)*(3-2*sqrt(3))/2)*sqrt(3)^(n-3) for n>0, a(0)=1. - Bruno Berselli, Mar 19 2013
a(0) = 1, a(1) = 1, a(n) = a(n-1) + a(n-2) if n is odd, and a(n) = a(n-1) + a(n-2) + a(n-3) if n is even. - Jon Perry, Mar 19 2013
For odd n = 2m-1, a(2m-1) = T(m,1)+T(m,2)+T(m,3) for triangle T(m,k) of A140735; for even n = 2m, a(2m) = T(m,1)+T(m,2)+T(m,3) for triangle T(m,k) of A293181. - Robert A. Russell, Mar 10 2018
From Robert A. Russell, Oct 21 2018: (Start)
a(2m) = S2(m+3,3) - 4*S2(m+2,3) + 5*S2(m+1,3) - 2*S2(m,3).
a(2m-1) = S2(m+2,3) - 3*S2(m+1,3) + 2*S2(m,3), where S2(n,k) is the Stirling subset number A008277.
a(n) = 2*A001998(n-1) - A124302(n) = A124302(n) - 2*A107767(n-1) = A001998(n-1) - A107767(n-1).
a(n) = 2*A056353(n) - A002076(n) = A002076(n) - 2*A320743(n) = A056353(n) - A320743(n).
a(n) = A057427(n) + A052551(n-2) + A304973(n). (End)

Extensions

Edited by Bruno Berselli, Mar 19 2013
Definition simplified by N. J. A. Sloane, Nov 23 2017

A171142 Triangle T(n,k) of the coefficients [x^k] of the polynomial p_n(x), where p_n(x)=(1+x)*p_{n-1}(x) if n even, p_n(x) = (x^2+4x+1)^((n-1)/2) if n odd.

Original entry on oeis.org

1, 1, 1, 1, 4, 1, 1, 5, 5, 1, 1, 8, 18, 8, 1, 1, 9, 26, 26, 9, 1, 1, 12, 51, 88, 51, 12, 1, 1, 13, 63, 139, 139, 63, 13, 1, 1, 16, 100, 304, 454, 304, 100, 16, 1, 1, 17, 116, 404, 758, 758, 404, 116, 17, 1, 1, 20, 165, 720, 1770, 2424, 1770, 720, 165, 20, 1, 1, 21, 185, 885
Offset: 1

Views

Author

Roger L. Bagula and Gary W. Adamson, Dec 04 2009

Keywords

Comments

Row sums are apparently in A026549.

Examples

			The triangle starts in row n=1 with column 0<=k<n as:
1;
1, 1;
1, 4, 1;
1, 5, 5, 1;
1, 8, 18, 8, 1;
1, 9, 26, 26, 9, 1;
1, 12, 51, 88, 51, 12, 1;
1, 13, 63, 139, 139, 63, 13, 1;
1, 16, 100, 304, 454, 304, 100, 16, 1;
1, 17, 116, 404, 758, 758, 404, 116, 17, 1;
1, 20, 165, 720, 1770, 2424, 1770, 720, 165, 20, 1;
1, 21, 185, 885, 2490, 4194, 4194, 2490, 885, 185, 21, 1;
		

Crossrefs

Programs

  • Maple
    A171142P := proc(n) option remember; if type(n,'even') then (x+1)*procname(n-1) ; else (x^2+4*x+1)^((n-1)/2) ; end if; expand(%) ;end proc:
    A171142 := proc(n,k) coeff(A171142P(n,x),x,k) ; end proc:
  • Mathematica
    Clear[p, n, x, a]
    w = 4;
    p[x, 1] := 1;
    p[x_, n_] := p[x, n] = If[Mod[n, 2] == 0, (x + 1)*p[x, n - 1], (x^2 + w*x + 1)^Floor[n/2]];
    a = Table[CoefficientList[p[x, n], x], {n, 1, 12}];
    Flatten[a]

A123149 Triangle T(n,k), 0<=k<=n, read by rows given by [1, 0, -1, 0, 0, 0, 0, 0, ...] DELTA [0, 1, 0, -1, 0, 0, 0, 0, ...] where DELTA is the operator defined in A084938.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 2, 2, 1, 0, 1, 2, 3, 2, 1, 0, 1, 3, 5, 5, 3, 1, 0, 1, 3, 6, 7, 6, 3, 1, 0, 1, 4, 9, 13, 13, 9, 4, 1, 0, 1, 4, 10, 16, 19, 16, 10, 4, 1, 0, 1, 5, 14, 26, 35, 35, 26, 14, 5, 1, 0, 1, 5, 15, 30, 45, 51, 45, 30, 15, 5, 1, 0, 1, 6, 20, 45, 75, 96, 96, 75, 45, 20, 6, 1, 0
Offset: 0

Views

Author

Philippe Deléham, Nov 05 2006

Keywords

Comments

A169623 is a very similar triangle except it does not have the outer diagonal of 0's. - N. J. A. Sloane, Nov 23 2017

Examples

			Triangle begins:
  1;
  1,  0;
  1,  1,  0;
  1,  1,  1,  0;
  1,  2,  2,  1,  0;
  1,  2,  3,  2,  1,  0;
  1,  3,  5,  5,  3,  1,  0;
  1,  3,  6,  7,  6,  3,  1,  0;
  1,  4,  9, 13, 13,  9,  4,  1,  0;
		

Crossrefs

Programs

  • Magma
    function T(n,k) // T = A123149
      if k lt 0 or k gt n then return 0;
      elif k eq 0 or k eq n-1 then return 1;
      elif k eq n then return 0;
      else return T(n-2,k) +T(n-2,k-1) +T(n-2,k-2);
      end if;
    end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jul 17 2023
    
  • Mathematica
    T[n_, k_]:= T[n, k]= If[k<0 || k>n, 0, If[k==0 || k==n-1, 1, If[k==n, 0, T[n-2,k] +T[n-2,k-1] +T[n-2,k-2] ]]];
    Table[T[n, k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Jul 17 2023 *)
  • SageMath
    def T(n,k): # T = A123149
        if (k<0 or k>n): return 0
        elif (k==0 or k==n-1): return 1
        elif (k==n): return 0
        else: return T(n-2,k) +T(n-2,k-1) +T(n-2,k-2)
    flatten([[T(n,k) for k in range(n+1)] for n in range(13)]) # G. C. Greubel, Jul 17 2023

Formula

T(n,k) = T(n-1,k-1) + T(n-1,k) if n even, T(n,k) = T(n-1,k-1) + T(n-2,k) if n odd, T(0,0) = 1, T(1,0) = 1, T(1,1) = 0, T(n,k) = 0 if k < 0 or if k > n.
T(n,k) = T(n,n-k-1).
Sum_{k=0..n} T(n,k) = A038754(n-1), for n>=1.
T(2*n,n) = A005773(n).
T(2*n+1,n) = A002426(n).
From Philippe Deléham, May 04 2012: (Start)
G.f.: (1+x-y^2*x^2)/(1-x^2-y*x^2-y^2*x^2).
T(n,k) = T(n-2,k) + T(n-2,k-1) + T(n-2,k-2), T(0,0) = T(1,0) = T(2,0) = T(2,1) = 1, T(1,1) = T(2,2) = 0 and T(n,k) = 0 if k < 0 or if k > n.
Sum_{k=0..n} T(n,k) = A182522(n). (End)
From G. C. Greubel, Jul 17 2023: (Start)
Sum_{k=0..n} (-1)^k*T(n,k) = A135528(n).
Sum_{k=0..floor(n/2)} T(n-k,k) = [n==0] + A013979(n+1). (End)

A295555 Generalized Pascal triangle read by rows: add the four terms that are right above you, three rows back.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 2, 3, 3, 2, 1, 1, 2, 3, 4, 3, 2, 1, 1, 3, 5, 7, 7, 5, 3, 1, 1, 3, 6, 9, 10, 9, 6, 3, 1, 1, 3, 6, 10, 12, 12, 10, 6, 3, 1, 1, 4, 9, 16, 22, 24, 22, 16, 9, 4, 1, 1, 4, 10, 19, 28, 34, 34, 28, 19, 10, 4, 1, 1, 4, 10, 20, 31, 40, 44, 40, 31, 20, 10, 4, 1
Offset: 0

Views

Author

N. J. A. Sloane, Nov 23 2017

Keywords

Comments

To explain the rule of formation, consider the first few rows of the triangle, which are:
1
1, 1
1, 1, 1
1, 1, 1, 1
A, B, C, D, 1
1, 2, 3, 3, 2, 1
1, 2, 3, 4, 3, 2, 1
1, 3, 5, E, 7, 5, 3, 1
The left and right edge are all 1's, the entries outside the triangle are all 0's, and the first 3 rows are all 1's.
Thereafter each term E (say) is the sum of the 4 terms A, B, C, D exactly above it three rows back.
Adding the two entries just above you in the previous row gives Pascal's triangle, A007318. Adding the three entries just above you two rows back gives A169623.
From Peter Bala, Aug 19 2021: (Start)
Let M denote the lower unit triangular array with the sequence [1,0,0,1,0,0,1,...] on all the subdiagonals. For k = 0,1,2,..., define M(k) to be the lower unit triangular block array
/I_k 0\
\ 0 M/
having the k X k identity matrix I_k as the upper left block; in particular, M(0) = M. Then the present triangle equals the infinite matrix product M(0)*M(1)*M(2)*... (which is clearly well-defined). See the Example section below. The proof uses the hockey-stick identities from the Formula section. (End)

Examples

			Triangle begins:
                    1
                  1,  1
                1,  1,  1
              1,  1,  1,  1
            1,  2,  2,  2,  1
          1,  2,  3,  3,  2,  1
        1,  2,  3,  4,  3,  2,  1
      1,  3,  5,  7,  7,  5,  3,  1
    1,  3,  6,  9, 10,  9,  6,  3,  1
  1,  3,  6, 10, 12, 12, 10,  6,  3,  1
...
From _Peter Bala_, Aug 19 2021: (Start)
With the arrays M(k) as defined in the Comments section, the infinite product M(0)*M(1)*M(2)*... begins
  /1            \/1            \/1            \      /1         \
  |1 1          ||0 1          ||0 1          |      |1 1       |
  |1 0 1        ||0 1 1        ||0 0 1        |      |1 1 1     |
  |1 0 0 1      ||0 1 0 1      ||0 0 1 1      |... = |1 1 1 1   |
  |1 0 0 1 1    ||0 1 0 0 1    ||0 0 1 0 1    |      |1 2 2 2 1 |
  |1 0 0 1 0 1  ||0 1 0 0 1 1  ||0 0 1 0 0 1  |      |...       |
  |1 0 0 1 0 0 1||0 1 0 0 1 0 1||0 0 1 0 0 1 1|
  |...          ||...          ||...          |
(End)
		

Crossrefs

Row sums are A133464.

Programs

  • Maple
    T:=proc(n,k) option remember;
    if n >= 0 and k = 0 then 1
    elif n >= 0 and k = n then 1
    elif (k < 0 or k > n) then 0
    elif n=2 then 1
    else T(n-3,k-3)+T(n-3,k-2)+T(n-3,k-1)+T(n-3,k);
    fi;
    end;
    for n from 0 to 14 do lprint([seq(T(n,k),k=0..n)]); od:
  • Mathematica
    T[n_, k_] := T[n, k] = Which[
       n >= 0 && k == 0, 1,
       n >= 0 && k == n, 1,
       k < 0 || k > n, 0,
       n == 2, 1,
       True, T[n-3, k-3] + T[n-3, k-2] + T[n-3, k-1] + T[n-3, k]];
    Table[T[n, k], {n, 0, 14}, { k, 0, n}] // Flatten (* Jean-François Alcover, Aug 19 2022, after Maple code *)

Formula

T(n,0)=T(n,n)=1, T(n,k)=0 if k<0 or k>n, also T(2,1)=1; thereafter T(n,k) = T(n-3,k-3) + T(n-3,k-2) + T(n-3,k-1) + T(n-3,k).
From Peter Bala, Aug 19 2021: (Start)
T(3*n,k) = T(3*n-2,k) + T(3*n-2,k-2).
T(3*n+1,k) = T(3*n,k) + T(3*n,k-1).
T(3*n+2,k) = T(3*n+1,k-1) + T(3*n,k).
Hockey-stick identities (relate row k entries to entries in row k-1):
T(3*n,k) = T(3*n-1,k-1) + T(3*n-4,k-1) + T(3*n-7,k-1) + ....
T(3*n+1,k) = T(3*n,k-1) + ( T(3*n-1,k-1) + T(3*n-4,k-1) + T(3*n-7,k-1) + ... ).
T(3*n+2,k) = T(3*n+1,k-1) + ( T(3*n-1,k-1) + T(3*n-4,k-1) + T(3*n-7,k-1) + ... ).
Row polynomials:
R(3*n,x) = R(3,x)^n = (1 + x + x^2 + x^3)^n.
R(3*n+1,x) = R(1,x)*R(3,x)^n = (1 + x)*(1 + x + x^2 + x^3)^n.
R(3*n+2,x) = R(2,x)*R(3,x)^n = (1 + x + x^2)*(1 + x + x^2 + x^3)^n. (End)

A171145 The sequence of coefficients of a polynomial recursion: p(x,n)=If[Mod[n, 2] == 0, (x + 1)*p(x, n - 1), (x^2 + n*x + 1)^Floor[n/2]].

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 4, 4, 1, 1, 10, 27, 10, 1, 1, 11, 37, 37, 11, 1, 1, 21, 150, 385, 150, 21, 1, 1, 22, 171, 535, 535, 171, 22, 1, 1, 36, 490, 3024, 7539, 3024, 490, 36, 1, 1, 37, 526, 3514, 10563, 10563, 3514, 526, 37, 1, 1, 55, 1215, 13530, 76845, 188001, 76845
Offset: 1

Views

Author

Roger L. Bagula and Gary W. Adamson, Dec 04 2009

Keywords

Comments

Row sums are:
{1, 2, 5, 10, 49, 98, 729, 1458, 14641, 29282, 371293, 742586,...}.
The modulo 2 of this appears to be a staggered Sierpinski-type fractal.

Examples

			{1},
{1, 1},
{1, 3, 1},
{1, 4, 4, 1},
{1, 10, 27, 10, 1},
{1, 11, 37, 37, 11, 1},
{1, 21, 150, 385, 150, 21, 1},
{1, 22, 171, 535, 535, 171, 22, 1},
{1, 36, 490, 3024, 7539, 3024, 490, 36, 1},
{1, 37, 526, 3514, 10563, 10563, 3514, 526, 37, 1},
{1, 55, 1215, 13530, 76845, 188001, 76845, 13530, 1215, 55, 1},
{1, 56, 1270, 14745, 90375, 264846, 264846, 90375, 14745, 1270, 56, 1}
		

Crossrefs

Programs

  • Mathematica
    Clear[p, n, x, a]
    p[x, 1] := 1;
    p[x_, n_] := p[x, n] = If[Mod[n, 2] == 0, (x + 1)*p[x, n - 1], (x^2 + n*x + 1)^Floor[n/2]];
    a = Table[CoefficientList[p[x, n], x], {n, 1, 12}];
    Flatten[a]

Formula

p(x,n)=If[Mod[n, 2] == 0, (x + 1)*p(x, n - 1), (x^2 + n*x + 1)^Floor[n/2]]

A171146 The sequence of coefficients of a polynomial recursion: p(x,n)=If[Mod[n, 2] == 0, (x + 1)*p(x, n - 1), (x^2 + (2*n - 1)*x + 1)^Floor[n/2]] ( correction).

Original entry on oeis.org

1, 1, 1, 1, 5, 1, 1, 6, 6, 1, 1, 18, 83, 18, 1, 1, 19, 101, 101, 19, 1, 1, 39, 510, 2275, 510, 39, 1, 1, 40, 549, 2785, 2785, 549, 40, 1, 1, 68, 1738, 19856, 86995, 19856, 1738, 68, 1, 1, 69, 1806, 21594, 106851, 106851, 21594, 1806, 69, 1, 1, 105, 4415, 93030, 985645
Offset: 1

Views

Author

Roger L. Bagula and Gary W. Adamson, Dec 04 2009

Keywords

Comments

Row sums are:
{1, 2, 7, 14, 121, 242, 3375, 6750, 130321, 260642, 6436343, 12872686...}.

Examples

			{1},
{1, 1},
{1, 5, 1},
{1, 6, 6, 1},
{1, 18, 83, 18, 1},
{1, 19, 101, 101, 19, 1},
{1, 39, 510, 2275, 510, 39, 1},
{1, 40, 549, 2785, 2785, 549, 40, 1},
{1, 68, 1738, 19856, 86995, 19856, 1738, 68, 1},
{1, 69, 1806, 21594, 106851, 106851, 21594, 1806, 69, 1},
{1, 105, 4415, 93030, 985645, 4269951, 985645, 93030, 4415, 105, 1},
{1, 106, 4520, 97445, 1078675, 5255596, 5255596, 1078675, 97445, 4520, 106, 1}
		

Crossrefs

Programs

  • Mathematica
    Clear[p, n, x, a]
    p[x, 1] := 1;
    p[x_, n_] := p[x, n] = If[Mod[n, 2] == 0, (x + 1)*p[x, n - 1], (x^2 + (2*n - 1)*x + 1)^Floor[n/2]];
    a = Table[CoefficientList[p[x, n], x], {n, 1, 12}];
    Flatten[a]

Formula

p(x,n)=If[Mod[n, 2] == 0, (x + 1)*p(x, n - 1), (x^2 + (2*n - 1)*x + 1)^Floor[n/2]]

A171147 The sequence of coefficients of a polynomial recursion: p(x,n)=If[Mod[n, 2] == 0, (x + 1)*p(x, n - 1), (x^2 + (2*n)*x + 1)^Floor[n/2]].

Original entry on oeis.org

1, 1, 1, 1, 6, 1, 1, 7, 7, 1, 1, 20, 102, 20, 1, 1, 21, 122, 122, 21, 1, 1, 42, 591, 2828, 591, 42, 1, 1, 43, 633, 3419, 3419, 633, 43, 1, 1, 72, 1948, 23544, 108870, 23544, 1948, 72, 1, 1, 73, 2020, 25492, 132414, 132414, 25492, 2020, 73, 1, 1, 110, 4845, 106920
Offset: 1

Views

Author

Roger L. Bagula and Gary W. Adamson, Dec 04 2009

Keywords

Comments

Row sums are:
{1, 2, 8, 16, 144, 288, 4096, 8192, 160000, 320000, 7962624, 15925248...}.

Examples

			{1},
{1, 1},
{1, 6, 1},
{1, 7, 7, 1},
{1, 20, 102, 20, 1},
{1, 21, 122, 122, 21, 1},
{1, 42, 591, 2828, 591, 42, 1},
{1, 43, 633, 3419, 3419, 633, 43, 1},
{1, 72, 1948, 23544, 108870, 23544, 1948, 72, 1},
{1, 73, 2020, 25492, 132414, 132414, 25492, 2020, 73, 1},
{1, 110, 4845, 106920, 1185810, 5367252, 1185810, 106920, 4845, 110, 1},
{1, 111, 4955, 111765, 1292730, 6553062, 6553062, 1292730, 111765, 4955, 111, 1}
		

Crossrefs

Programs

  • Mathematica
    Clear[p, n, x, a]
    p[x, 1] := 1;
    p[x_, n_] := p[x, n] = If[Mod[n, 2] == 0, (x + 1)*p[x, n - 1], (x^2 + (2*n)*x + 1)^Floor[n/2]];
    a = Table[CoefficientList[p[x, n], x], {n, 1, 12}];
    Flatten[a]

Formula

p(x,n)=If[Mod[n, 2] == 0, (x + 1)*p(x, n - 1), (x^2 + (2*n)*x + 1)^Floor[n/2]]

A276696 Triangle read by rows, T(n,k) = T(n-1, k-1) + T(n-2, k) if k is odd, T(n-1, k-1) + T(n-1, k) if k is even, for k<=0<=n and n>=2 with T(0,0)=T(1,0)=T(1,1)=0 and T(n,k)=0 when k>n, k<0, or n<0.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 4, 2, 1, 1, 3, 6, 5, 3, 1, 1, 3, 9, 8, 8, 3, 1, 1, 4, 12, 14, 16, 9, 4, 1, 1, 4, 16, 20, 30, 19, 13, 4, 1, 1, 5, 20, 30, 50, 39, 32, 14, 5, 1, 1, 5, 25, 40, 80, 69, 71, 36, 19, 5, 1, 1, 6, 30, 55, 120, 119, 140, 85, 55, 20, 6, 1
Offset: 0

Views

Author

Michel Marcus, Sep 14 2016

Keywords

Comments

This is the triangle frst(n,k) in the Ehrenborg and Readdy link. See Definition 3.1 and Table 1.

Examples

			Triangle starts:
  1;
  1, 1;
  1, 1, 1;
  1, 2, 2, 1;
  1, 2, 4, 2, 1;
  1, 3, 6, 5, 3, 1;
  1, 3, 9, 8, 8, 3, 1;
  ...
		

Crossrefs

Cf. A169623 (the triangle er).

Programs

  • Mathematica
    T[n_, n_] = T[, 0] = 1; T[n, k_] /; 0 <= k <= n := T[n, k] = If[OddQ[k], T[n-1, k-1] + T[n-2, k], T[n-1, k-1] + T[n-1, k]]; T[, ] = 0;
    Table[T[n, k], {n, 0, 11}, {k, 0, n}] // Flatten (* Jean-François Alcover, Sep 28 2018 *)
  • PARI
    frst(n, k) = if ((k>n) || (n<0) || (k<0), 0, if (n<=2, 1, if (k==0, 1, if (k%2, frst(n-1, k-1) + frst(n-2, k), frst(n-1, k-1) + frst(n-1, k)))));
    tf(nn) = for (n=0, nn, for (k=0, n, print1(frst(n,k), ", ");); print(););
Showing 1-10 of 11 results. Next