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.

A128282 Regular symmetric triangle, read by rows, whose left half consists of the positive integers.

Original entry on oeis.org

1, 2, 2, 3, 4, 3, 5, 6, 6, 5, 7, 8, 9, 8, 7, 10, 11, 12, 12, 11, 10, 13, 14, 15, 16, 15, 14, 13, 17, 18, 19, 20, 20, 19, 18, 17, 21, 22, 23, 24, 25, 24, 23, 22, 21, 26, 27, 28, 29, 30, 30, 29, 28, 27, 26, 31, 32, 33, 34, 35, 36, 35, 34, 33, 32, 31, 37, 38, 39, 40, 41, 42, 42, 41, 40, 39, 38, 37
Offset: 0

Views

Author

Philippe Deléham, May 03 2007

Keywords

Comments

Left half triangle is A000027 (positive integers) (compare with example triangle):
1;
2;
3, 4;
5, 6;
7, 8, 9;
10, 11, 12;
13, 14, 15, 16;
17, 18, 19, 20;
...

Examples

			Triangle begins:
   1;
   2,  2;
   3,  4,  3;
   5,  6,  6,  5;
   7,  8,  9,  8,  7;
  10, 11, 12, 12, 11, 10;
  13, 14, 15, 16, 15, 14, 13;
  17, 18, 19, 20, 20, 19, 18, 17;
  ...
		

Crossrefs

Cf. A000027, A000290, A033638 (1st column and right diagonal).

Programs

  • Maple
    A := proc(n,k) ## n >= 0 and k = 0 .. n
        1+(1/4)*n*(n+1)+min(k, n-k)+(1/2)*ceil((1/2)*n)
    end proc: # Yu-Sheng Chang, May 25 2020
  • Mathematica
    T[n_,k_]:=1+n*(n+1)/4+Min[k,n-k]+Ceiling[n/2]/2;Table[T[n,k],{n,0,11},{k,0,n}]//Flatten (* James C. McMahon, Jan 06 2025 *)

Formula

T(n,k) = T(n,n-k).
T(2*n,n) = (n+1)^2 = A000290(n+1).
T(n,0) = T(n,n) = A033638(n+1).
From Yu-Sheng Chang, May 25 2020: (Start)
O.g.f.: F(z,v) = (z/((-z+1)^3*(z+1)) - v^2*z/((-v*z+1)^3*(v*z+1)))/(1-v) + 1/((-z+1)*(-v*z+1)*(-v*z^2+1)).
T(n,k) = [v^k] (1/8)*(1-v^(n+1))*(2*(n+1)^2 - 1 - (-1)^n)/(1-v) + (v^(2+n) + (1/2*((sqrt(v)-1)^2*(-1)^n - (sqrt(v)+1)^2))*v^((1/2)*n + 1/2) + 1)/(1-v)^2.
T(n,k) = 1 + (1/4)*n*(n+1) + min(k, n-k) + (1/2)*ceiling((1/2)*n). (End)
T(n,k) = ((n+k-1)^2 - ((n+k-1) mod 2))/4 + min(n,k) for n and k >= 1, as an array. See Xie. - Michel Marcus, May 25 2021

Extensions

Name edited by Michel Marcus, May 25 2021