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.

A157268 Triangle T(n, k, m) = (m*(n-k) + 1)*T(n-1, k-1, m) + (m*k + 1)*T(n-1, k, m) + m*f(n,k)*T(n-2, k-1, m) with T(n, 0, m) = T(n, n, m) = 1, f(n, k) = 2^k if k <= floor(n/2) otherwise 2^(n-k), and m = 1, read by rows.

Original entry on oeis.org

1, 1, 1, 1, 6, 1, 1, 17, 17, 1, 1, 40, 126, 40, 1, 1, 87, 606, 606, 87, 1, 1, 182, 2413, 5856, 2413, 182, 1, 1, 373, 8679, 40337, 40337, 8679, 373, 1, 1, 756, 29376, 232726, 497066, 232726, 29376, 756, 1, 1, 1523, 95668, 1205968, 4527078, 4527078, 1205968, 95668, 1523, 1
Offset: 0

Views

Author

Roger L. Bagula, Feb 26 2009

Keywords

Examples

			Triangle begins as:
  1;
  1,    1;
  1,    6,     1;
  1,   17,    17,       1;
  1,   40,   126,      40,       1;
  1,   87,   606,     606,      87,       1;
  1,  182,  2413,    5856,    2413,     182,       1;
  1,  373,  8679,   40337,   40337,    8679,     373,     1;
  1,  756, 29376,  232726,  497066,  232726,   29376,   756,    1;
  1, 1523, 95668, 1205968, 4527078, 4527078, 1205968, 95668, 1523, 1;
		

Crossrefs

Programs

  • Mathematica
    f[n_,k_]:= If[k<=Floor[n/2], 2^k, 2^(n-k)];
    T[n_, k_, m_]:= T[n, k, m]= If[k==0 || k==n, 1, (m*(n-k)+1)*T[n-1,k-1,m] + (m*k+1)*T[n-1,k,m] + m*f[n,k]*T[n-2,k-1,m]];
    Table[T[n,k,1], {n,0,12}, {k,0,n}]//Flatten (* modified by G. C. Greubel, Feb 04 2022 *)
  • Sage
    def f(n,k): return 2^k if (k <= n//2) else 2^(n-k)
    @CachedFunction
    def T(n,k,m):  # A157207
        if (k==0 or k==n): return 1
        else: return (m*(n-k) +1)*T(n-1,k-1,m) + (m*k+1)*T(n-1,k,m) + m*f(n,k)*T(n-2,k-1,m)
    flatten([[T(n,k,1) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Feb 04 2022

Formula

T(n, k, m) = (m*(n-k) + 1)*T(n-1, k-1, m) + (m*k + 1)*T(n-1, k, m) + m*f(n,k)*T(n-2, k-1, m) with T(n, 0, m) = T(n, n, m) = 1, f(n, k) = 2^k if k <= floor(n/2) otherwise 2^(n-k), and m = 1.
T(n, n-k, m) = T(n, k, m).
T(n, 1, 1) = A101945(n-1), n >= 1. - G. C. Greubel, Feb 04 2022

Extensions

Edited by G. C. Greubel, Feb 04 2022

A157275 Triangle T(n, k, m) = (m*(n-k) + 1)*T(n-1, k-1, m) + (m*k + 1)*T(n-1, k, m) + m*f(n,k)*T(n-2, k-1, m) with T(n, 0, m) = T(n, n, m) = 1, f(n, k) = 2*k if k <= floor(n/2) otherwise 2*(n-k), and m = 1, read by rows.

Original entry on oeis.org

1, 1, 1, 1, 6, 1, 1, 17, 17, 1, 1, 40, 126, 40, 1, 1, 87, 606, 606, 87, 1, 1, 182, 2413, 5604, 2413, 182, 1, 1, 373, 8679, 38117, 38117, 8679, 373, 1, 1, 756, 29376, 219020, 426002, 219020, 29376, 756, 1, 1, 1523, 95668, 1133786, 3749066, 3749066, 1133786, 95668, 1523, 1
Offset: 0

Views

Author

Roger L. Bagula, Feb 26 2009

Keywords

Examples

			Triangle begins as:
  1;
  1,    1;
  1,    6,     1;
  1,   17,    17,       1;
  1,   40,   126,      40,       1;
  1,   87,   606,     606,      87,       1;
  1,  182,  2413,    5604,    2413,     182,       1;
  1,  373,  8679,   38117,   38117,    8679,     373,     1;
  1,  756, 29376,  219020,  426002,  219020,   29376,   756,    1;
  1, 1523, 95668, 1133786, 3749066, 3749066, 1133786, 95668, 1523, 1;
		

Crossrefs

Programs

  • Mathematica
    f[n_,k_]:= If[k<=Floor[n/2], 2*k, 2*(n-k)];
    T[n_, k_, m_]:= T[n, k, m]= If[k==0 || k==n, 1, (m*(n-k)+1)*T[n-1,k-1,m] + (m*k+1)*T[n-1,k,m] + m*f[n,k]*T[n-2,k-1,m]];
    Table[T[n,k,1], {n,0,12}, {k,0,n}]//Flatten (* modified by G. C. Greubel, Feb 05 2022 *)
  • Sage
    def f(n,k): return 2*k if (k <= n//2) else 2*(n-k)
    @CachedFunction
    def T(n,k,m):  # A157275
        if (k==0 or k==n): return 1
        else: return (m*(n-k) +1)*T(n-1,k-1,m) + (m*k+1)*T(n-1,k,m) + m*f(n,k)*T(n-2,k-1,m)
    flatten([[T(n,k,1) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Feb 05 2022

Formula

T(n, k, m) = (m*(n-k) + 1)*T(n-1, k-1, m) + (m*k + 1)*T(n-1, k, m) + m*f(n,k)*T(n-2, k-1, m) with T(n, 0, m) = T(n, n, m) = 1, f(n, k) = 2*k if k <= floor(n/2) otherwise 2*(n-k), and m = 1.
T(n, n-k, m) = T(n, k, m).
T(n, 1, 1) = A101945(n-1), for n >= 1. - G. C. Greubel, Feb 05 2022

Extensions

Edited by G. C. Greubel, Feb 05 2022

A101946 a(n) = 6*2^n - 3*n - 5.

Original entry on oeis.org

1, 4, 13, 34, 79, 172, 361, 742, 1507, 3040, 6109, 12250, 24535, 49108, 98257, 196558, 393163, 786376, 1572805, 3145666, 6291391, 12582844, 25165753, 50331574, 100663219, 201326512, 402653101, 805306282, 1610612647, 3221225380, 6442450849, 12884901790
Offset: 0

Views

Author

Gary W. Adamson, Dec 22 2004

Keywords

Comments

Sequence generated from a 3 X 3 matrix, companion to A101945.
Characteristic polynomial of M = x^3 - 4x^2 + 5x - 2.
Sequence can also be generated by the same method as A061777 with slightly different rules. Refer to A061777, which is the "vertex to vertex" expansion version. For this case, the expandable vertices of the existing generation will contact the sides of the new ones, i.e., "vertex to side" expansion version. Let us assign the label "1" to the triangle at the origin; at n-th generation add a triangle at each expandable vertex, i.e., each vertex where the added generations will not overlap the existing ones, although overlaps among new generations are allowed. The non-overlapping triangles will have the same label value as a predecessor; for the overlapping ones, the label value will be sum of label values of predecessors. a(n) is the sum of all label values at n-th generation. The triangles count is A005448. See illustration. - Kival Ngaokrajang, Sep 26 2014
The number of ways to select 0 or more nodes of a 2 X n rectangular grid such that the selected nodes are connected, but do not fill any 2 X 2 square. This question arises in logic puzzles such as Nurikabe. - Hugo van der Sanden, Feb 22 2024

Examples

			a(4) = 79 = 4*34 - 5*13 + 2*4 = 4*a(3) - 5*a(2) + 2*a(1).
a(4) = right term in M^4 * [1 1 1], since M^4 * [1 1 1] = [1 46 a(4)], where 46 = A033484(4).
		

Crossrefs

Programs

  • Magma
    [6*2^n -3*n-5: n in [0..40]]; // G. C. Greubel, Feb 06 2022
    
  • Mathematica
    a[0]=1; a[1]=4; a[2]=13; a[n_]:= a[n]= 4a[n-1] -5a[n-2] +2a[n-3]; Table[ a[n], {n, 0, 30}] (* Or *)
    a[n_] := (MatrixPower[{{1, 0, 0}, {2, 2, 0}, {1, 2, 1}}, n].{{1}, {1}, {1}})[[3, 1]]; Table[ a[n], {n, 0, 30}] (* Robert G. Wilson v, Jan 12 2005 *)
    Table[6*2^n-3n-5,{n,0,40}] (* or *) LinearRecurrence[{4,-5,2},{1,4,13},40] (* Harvey P. Dale, Jun 03 2017 *)
  • PARI
    a(n) = if (n<1, 1, 5*(2^n-1)+a(n-1))\\ Kival Ngaokrajang, Sep 26 2014
    
  • PARI
    Vec(-(2*x^2+1)/((x-1)^2*(2*x-1)) + O(x^100)) \\ Colin Barker, Sep 26 2014
    
  • Sage
    [3*(2^(n+1) -n-2) +1 for n in (0..40)] # G. C. Greubel, Feb 06 2022

Formula

a(0)=1, a(1)=4, a(2)=13 and for n>2, a(n) = 4*a(n-1) - 5*a(n-2) + 2*a(n-3).
a(n) = right term in M^n * [1 1 1], where M = the 3X3 matrix [1 0 0 / 2 2 0 / 1 2 1]. M^n * [1 1 1] = [1 A033484(n) a(n)].
a(0) = 1, for n >= 1, a(n) = 3*A000225(n) + a(n-1). - Kival Ngaokrajang, Sep 26 2014
G.f.: (1+2*x^2)/((1-x)^2*(1-2*x)). - Colin Barker, Sep 26 2014
E.g.f.: 6*exp(2*x) - (5+3*x)*exp(x). - G. C. Greubel, Feb 06 2022

Extensions

New definition from Ralf Stephan, May 17 2007

A135855 A007318 * a tridiagonal matrix with (1, 4, 1, 0, 0, 0, ...) in every column.

Original entry on oeis.org

1, 5, 1, 10, 6, 1, 16, 16, 7, 1, 23, 32, 23, 8, 1, 31, 55, 55, 31, 9, 1, 40, 86, 110, 86, 40, 10, 1, 50, 126, 196, 196, 126, 50, 11, 1, 61, 176, 322, 392, 322, 176, 61, 12, 1, 73, 237, 498, 714, 714, 498, 237, 73, 13, 1
Offset: 0

Views

Author

Gary W. Adamson, Dec 01 2007

Keywords

Examples

			First few rows of the triangle:
   1;
   5,  1;
  10,  6,   1;
  16, 16,   7,  1;
  23, 32,  23,  8,  1;
  31, 55,  55, 31,  9,  1;
  40, 86, 110, 86, 40, 10, 1;
  ...
		

Crossrefs

Programs

  • Magma
    A135855:= func< n,k | Binomial(n,k)*(n^2 + (2*k+7)*n - 2*(k^2 + 2*k -1))/((k+1)*(k+2)) >;
    [A135855(n,k): k in [0..n], n in [0..10]]; // G. C. Greubel, Feb 06 2022
    
  • Mathematica
    T[n_, k_]:= T[n, k]= If[k<0 || k>n, 0, If[k==0, (n^2+7*n+2)/2, If[k==n, 1, T[n-1, k-1] + T[n-1, k]]]];
    Table[T[n, k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Feb 06 2022 *)
  • Sage
    @CachedFunction
    def T(n,k): # A135855
        if (k==0): return (n^2+7*n+2)/2
        elif (k==n): return 1
        else: return T(n-1, k-1) + T(n-1, k)
    flatten([[T(n,k) for k in (0..n)] for n in (0..10)]) # G. C. Greubel, Feb 06 2022

Formula

Binomial transform of an infinite tridiagonal matrix with (1, 4, 1, 0, 0, 0, ...) in every column; i.e., (1, 1, 1, ...) in the main diagonal, (4, 4, 4, 0, 0, 0, ...) in the subdiagonal and (1, 1, 1, ...) in the subsubdiagonal.
T(n, 0) = A052905(n).
Sum_{k=0..n} T(n, k) = A101945(n).
From G. C. Greubel, Feb 06 2022: (Start)
T(n, k) = T(n-1, k-1) + T(n-1, k), with T(n, n) = 1, T(n, 0) = A052905(n).
T(n, k) = binomial(n,k)*(n^2 + (2*k+7)*n - 2*(k^2 + 2*k -1))/((k+1)*(k+2)).
T(n, 1) = A134465(n).
T(n, 2) = A022815(n-1).
T(n, n-1) = n+3.
T(n, n-2) = A052905(n+2). (End)

A368826 Square array T(n,k) = 3*2^k - n read by ascending antidiagonals.

Original entry on oeis.org

3, 2, 6, 1, 5, 12, 0, 4, 11, 24, -1, 3, 10, 23, 48, -2, 2, 9, 22, 47, 96, -3, 1, 8, 21, 46, 95, 192, -4, 0, 7, 20, 45, 94, 191, 384, -5, -1, 6, 19, 44, 93, 190, 383, 768, -6, -2, 5, 18, 43, 92, 189, 382, 767, 1536, -7, -3, 4, 17, 42, 91, 188, 381, 766, 1535, 3072
Offset: 0

Views

Author

Paul Curtz, Jan 07 2024

Keywords

Comments

Similar to A367559.

Examples

			Table begins:
   3  6 12 24 48 96 ...
   2  5 11 23 47 95 ...
   1  4 10 22 46 94 ...
   0  3  9 21 45 93 ...
  -1  2  8 20 44 92 ...
  -2  1  7 19 43 91 ...
  ...
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := 3*2^k - n; Table[T[n - k, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Amiram Eldar, Jan 15 2024 *)

Formula

T(0,k) = 3*2^k = A007283(k).
T(1,k) = 3*2^k - 1 = A083329(k+1).
T(2,k) = 3*2^k - 2 = A033484(k).
T(3,k) = 3*2^k - 3 = 3*A000225(k).
T(4,k) = 3*2^k - 4 = -A165751(k).
T(5,k) = 3*2^k - 5 = A048488(k-1)
T(6,k) = 3*2^k - 6 = 3*A000918(k).
Showing 1-5 of 5 results.