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.

A157458 Triangle, read by rows, double tent function: T(n,k) = min(1 + 2*k, 1 + 2*(n-k), n).

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 3, 4, 3, 1, 1, 3, 5, 5, 3, 1, 1, 3, 5, 6, 5, 3, 1, 1, 3, 5, 7, 7, 5, 3, 1, 1, 3, 5, 7, 8, 7, 5, 3, 1, 1, 3, 5, 7, 9, 9, 7, 5, 3, 1, 1, 3, 5, 7, 9, 10, 9, 7, 5, 3, 1, 1, 3, 5, 7, 9, 11, 11, 9, 7, 5, 3, 1, 1, 3, 5, 7, 9, 11, 12, 11, 9, 7, 5, 3, 1, 1, 3, 5, 7, 9, 11, 13, 13, 11, 9, 7, 5, 3, 1
Offset: 0

Views

Author

Roger L. Bagula, Mar 01 2009

Keywords

Comments

The general form of this, and related triangular sequences, takes the form A(n, k, m) = (m*(n-k) + 1)*A(n-1, k-1, m) + (m*k + 1)*A(n-1, k, m) + m*f(n, k)* A(n-2, k-1, m), where f(n,k) is a polynomial in n and k.
Row sums are: 0, 2, 4, 8, 12, 18, 24, 32, 40, 50, 60, ... = A007590(n+1). - N. J. A. Sloane, Aug 27 2009

Examples

			Triangle begins as:
  0;
  1, 1;
  1, 2, 1;
  1, 3, 3, 1;
  1, 3, 4, 3, 1;
  1, 3, 5, 5, 3, 1;
  1, 3, 5, 6, 5, 3, 1;
  1, 3, 5, 7, 7, 5, 3, 1;
  1, 3, 5, 7, 8, 7, 5, 3, 1;
  1, 3, 5, 7, 9, 9, 7, 5, 3, 1;
  1, 3, 5, 7, 9, 10, 9, 7, 5, 3, 1;
		

Crossrefs

Programs

  • Maple
    T := proc(m,n) return min(1+2*m, 1+2*(n-m), n): end: seq(seq(T(m,n),m=0..n),n=0..14); # Nathaniel Johnston, Apr 29 2011
  • Mathematica
    T[n_, k_]:= Min[1+2*k, 1+2*(n-k), n]; Table[T[n, k], {n,0,14}, {k,0,n}]//Flatten

Formula

T(n, k) = min(1 + 2*k, 1 + 2*(n - k), n).
From Yu-Sheng Chang, May 19 2020: (Start)
O.g.f.: F(z,v) = (1+v)*z/((1-v*z-1)*(1-z)*(1-v*z^2)).
T(n,k) = [v^k] (1+v)*(2*v^(n+1)+2-((sqrt(v)-1)^2 * (-1)^n + (sqrt(v)+1)^2) * v^((1/2)*n))/(2*(v-1)^2). (End)

Extensions

Edited by N. J. A. Sloane, Aug 27 2009
More terms from and partially edited by G. C. Greubel, May 21 2020