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

A026268 Triangle, T(n, k): T(n,k) = 1 for n < 3, T(3,1) = T(3,2) = T(3,3) = 2, T(n,0) = 1, T(n,1) = n-1, T(n,n) = T(n-1,n-2) + T(n-1,n-1), otherwise T(n,k) = T(n-1,k-2) + T(n-1,k-1) + T(n-1,k), read by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 3, 5, 6, 4, 1, 4, 9, 14, 15, 10, 1, 5, 14, 27, 38, 39, 25, 1, 6, 20, 46, 79, 104, 102, 64, 1, 7, 27, 72, 145, 229, 285, 270, 166, 1, 8, 35, 106, 244, 446, 659, 784, 721, 436, 1, 9, 44, 149, 385, 796, 1349, 1889, 2164, 1941, 1157, 1, 10, 54, 202, 578, 1330, 2530, 4034, 5402, 5994, 5262, 3098
Offset: 0

Views

Author

Keywords

Comments

a(n) = number of strings s(0)..s(n) such that s(n) = n-k, where s(0) = 0, s(1) = 1, |s(i)-s(i-1)| <= 1 for i >= 2; |s(2)-s(1)| = 1, and |s(3)-s(2)| = 1 if s(2) = 1.

Examples

			Triangle begins as:
  1;
  1, 1;
  1, 1,  1;
  1, 2,  2,   2;
  1, 3,  5,   6,   4;
  1, 4,  9,  14,  15,  10;
  1, 5, 14,  27,  38,  39,   25;
  1, 6, 20,  46,  79, 104,  102,   64;
  1, 7, 27,  72, 145, 229,  285,  270,  166;
  1, 8, 35, 106, 244, 446,  659,  784,  721,  436;
  1, 9, 44, 149, 385, 796, 1349, 1889, 2164, 1941, 1157;
		

Crossrefs

Programs

  • Magma
    f:= func< n | n eq 2 select 1 else (n^2 -n -2)/2 >;
    function T(n,k) // T = A026268
      if k eq 0 or n lt 3 then return 1;
      elif k eq 1 then return n-1;
      elif k eq 2 then return f(n);
      elif k eq n then return T(n-1, n-2) + T(n-1, n-1);
      else return T(n-1, k-2) + T(n-1, k-1) + T(n-1, k);
      end if; return T;
    end function;
    [T(n,k): k in [0..n], n in [0..14]]; // G. C. Greubel, Sep 24 2022
    
  • Mathematica
    T[n_, k_]:= T[n, k]= If[n<3 || k==0, 1, If[k==1, n-1, If[k==2, (n^2-n-2)/2 + Boole[n==2], If[k==n, T[n-1, n-2] +T[n-1, n-1], T[n-1, k-2] + T[n-1, k-1] + T[n -1, k] ]]]];
    Table[T[n, k], {n,0,14}, {k,0,n}]//Flatten (* corrected by G. C. Greubel, Sep 24 2022 *)
  • SageMath
    def T(n,k): # T = A026268
        if n<3 or k==0: return 1
        elif k==1: return n-1
        elif k==2: return (n^2 -n -2)//2 + int(n==2)
        elif k==n: return T(n-1, n-2) + T(n-1, n-1)
        else: return T(n-1, k-2) + T(n-1, k-1) + T(n-1, k)
    flatten([[T(n,k) for k in range(n+1)] for n in range(14)]) # G. C. Greubel, Sep 24 2022

Formula

From G. C. Greubel, Sep 24 2022: (Start)
T(n, 1) = A000027(n-1), n >= 1.
T(n, 2) = A212342(n-1), n >= 2.
T(n, n-1) = A026270(n), n >= 2.
T(n, n-2) = A026288(n), n >= 2.
T(n, n-3) = A026289(n), n >= 3.
T(n, n-4) = A026290(n), n >= 4.
T(n, n) = A026269(n), n >= 2.
T(n, floor(n/2)) = A026297(n), n >= 0.
T(2*n, n) = A026292(n).
T(2*n, n-1) = A026295(n), n >= 1.
T(2*n, n+1) = A026296(n), n >= 1.
T(2*n-1, n-1) = A026291(n), n >= 2.
T(3*n, n) = A026293(n), n >= 0.
T(4*n, n) = A026294(n), n >= 0.
Sum_{k=0..n} T(n, k) = A026299(n-1), n >= 3.(End)

Extensions

Updated by Clark Kimberling, Aug 29 2014
Indices of b-file corrected by Sidney Cadot, Jan 06 2023.

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

Original entry on oeis.org

0, 0, 5, 18, 42, 80, 135, 210, 308, 432, 585, 770, 990, 1248, 1547, 1890, 2280, 2720, 3213, 3762, 4370, 5040, 5775, 6578, 7452, 8400, 9425, 10530, 11718, 12992, 14355, 15810, 17360, 19008, 20757, 22610, 24570, 26640, 28823, 31122, 33540, 36080, 38745, 41538, 44462, 47520, 50715, 54050, 57528
Offset: 2

Views

Author

N. J. A. Sloane, May 09 2012

Keywords

Comments

Sequence of coefficients of x^1 in marked mesh pattern generating function Q_{n,132}^(0,3,0,0)(x).
Is this row 2 of the convolution array A213819? - Clark Kimberling, Jul 04 2012

Crossrefs

Partial sums are in A241765.
Cf. similar sequences of the type m*(m+1)*(m+k)/2 listed in A267370.
Cf. also A212342.

Programs

  • Mathematica
    QQ0[t, x] = (1 - (1-4*x*t)^(1/2)) / (2*x*t); QQ1[t, x] = 1/(1 - t*QQ0[t, x]); QQ2[t, x] = (1 + t*(QQ1[t, x] - QQ0[t, x]))/(1 - t*QQ0[t, x]); QQ3[t, x] = (1 + t*(QQ2[t, x] - QQ0[t, x] + t*(QQ1[t, x] - QQ0[t,  x])))/(1 - t*QQ0[t, x]); CoefficientList[Coefficient[Simplify[Series[QQ3[t, x], {t, 0, 35}]],x],t]  (* Robert Price, Jun 04 2012 *)
    LinearRecurrence[{4,-6,4,-1},{0,0,5,18},60] (* Harvey P. Dale, Mar 15 2018 *)
  • PARI
    Vec(-x^4*(2*x-5)/(x-1)^4 + O(x^100)) \\ Colin Barker, Jul 10 2015

Formula

For n>=4, a(n) = (n-3)*A212342(n-1).
a(n) = 4*a(n-1)-6*a(n-2)+4*a(n-3)-a(n-4) for n>7. - Colin Barker, Jul 10 2015
G.f.: -x^4*(2*x-5) / (x-1)^4. - Colin Barker, Jul 10 2015
From Amiram Eldar, Apr 03 2022: (Start)
Sum_{n>=4} 1/a(n) = 23/72.
Sum_{n>=4} (-1)^n/a(n) = 4*log(2)/3 - 55/72. (End)

Extensions

a(10)-a(35) from Robert Price, Jun 02 2012
Entry revised by N. J. A. Sloane, Sep 10 2016

A118404 Triangle T, read by rows, where all columns of T are different and yet all columns of the matrix square T^2 (A118407) are equal; also equals the matrix inverse of triangle A118400.

Original entry on oeis.org

1, 1, -1, -1, 0, 1, -1, 1, -1, -1, 1, 0, 0, 2, 1, 1, -1, 0, -2, -3, -1, -1, 0, 1, 2, 5, 4, 1, -1, 1, -1, -3, -7, -9, -5, -1, 1, 0, 0, 4, 10, 16, 14, 6, 1, 1, -1, 0, -4, -14, -26, -30, -20, -7, -1, -1, 0, 1, 4, 18, 40, 56, 50, 27, 8, 1, -1, 1, -1, -5, -22, -58, -96, -106, -77, -35, -9, -1, 1, 0, 0, 6, 27, 80, 154, 202, 183, 112, 44, 10, 1, 1, -1, 0, -6, -33, -107, -234, -356, -385, -295, -156, -54, -11, -1, -1, 0, 1, 6, 39, 140, 341, 590, 741, 680, 451, 210, 65, 12, 1, -1, 1, -1, -7, -45, -179, -481, -931, -1331, -1421, -1131, -661, -275, -77, -13, -1, 1, 0, 0, 8, 52, 224, 660, 1412, 2262, 2752, 2552, 1792, 936, 352, 90, 14, 1
Offset: 0

Views

Author

Paul D. Hanna, Apr 27 2006

Keywords

Comments

Appears to coincide with triangle (5.2) in Lee-Oh (2016), although there is no obvious connection! - N. J. A. Sloane, Dec 07 2016

Examples

			Triangle begins:
1;
1,-1;
-1, 0, 1;
-1, 1,-1,-1;
1, 0, 0, 2, 1;
1,-1, 0,-2,-3,-1;
-1, 0, 1, 2, 5, 4, 1;
-1, 1,-1,-3,-7,-9,-5,-1;
1, 0, 0, 4, 10, 16, 14, 6, 1;
1,-1, 0,-4,-14,-26,-30,-20,-7,-1;
-1, 0, 1, 4, 18, 40, 56, 50, 27, 8, 1;
-1, 1,-1,-5,-22,-58,-96,-106,-77,-35,-9,-1;
1, 0, 0, 6, 27, 80, 154, 202, 183, 112, 44, 10, 1;
1, -1, 0, -6, -33, -107, -234, -356, -385, -295, -156, -54, -11, -1;
-1, 0, 1, 6, 39, 140, 341, 590, 741, 680, 451, 210, 65, 12, 1;
-1, 1, -1, -7, -45, -179, -481, -931, -1331, -1421, -1131, -661, -275, -77, -13, -1;
1, 0, 0, 8, 52, 224, 660, 1412, 2262, 2752, 2552, 1792, 936, 352, 90, 14, 1;
1, -1, 0, -8, -60, -276, -884, -2072, -3674, -5014, -5304, -4344, -2728, -1288, -442, -104, -15, -1;
-1, 0, 1, 8, 68, 336, 1160, 2956, 5746, 8688, 10318, 9648, 7072, 4016, 1730, 546, 119, 16, 1; ...
The matrix square is A118407:
1;
0, 1;
-2, 0, 1;
2,-2, 0, 1;
0, 2,-2, 0, 1;
-2, 0, 2,-2, 0, 1;
4,-2, 0, 2,-2, 0, 1;
-6, 4,-2, 0, 2,-2, 0, 1;
4,-6, 4,-2, 0, 2,-2, 0, 1;
6, 4,-6, 4,-2, 0, 2,-2, 0, 1; ...
in which all columns are equal.
		

Crossrefs

Cf. A118405 (row sums), A118406 (unsigned row sums), A118407 (matrix square), A118400 (matrix inverse).
Columns or diagonals (modulo offsets): A219977, A011848, A212342, A007598, A005581, A007910.

Programs

  • Mathematica
    T[n_, k_] := SeriesCoefficient[(-1)^k/((1+x^2)(1+x)^(k-1)), {x, 0, n-k}];
    Table[T[n, k], {n, 0, 16}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jul 26 2018 *)
  • PARI
    {T(n,k)=polcoeff(polcoeff((1+x)^2/(1+x^2)/(1+x+x*y +x*O(x^n)),n,x)+y*O(y^k),k,y)}
    for(n=0, 16, for(k=0, n, print1(T(n, k), ", ")); print(""))

Formula

G.f.: A(x,y) = (1+x)^2 / ( (1+x^2) * (1+x + x*y) ).
G.f. of column k: (-1)^k / ( (1+x^2) * (1+x)^(k-1) ) for k>=0.
Showing 1-3 of 3 results.