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.

A239287 Triangle T(n,k), 0 <= k <= n, read by rows: T(n,k) = floor(n/2) - min(k,n-k).

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 2, 1, 0, 1, 2, 2, 1, 0, 0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 3, 2, 1, 0, 0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 3, 4, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, 1, 2
Offset: 0

Views

Author

Philippe Deléham, Mar 14 2014

Keywords

Comments

Row sums are A110660(n).

Examples

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

Crossrefs

Cf. A004526.

Programs

  • Magma
    [[Floor(n/2) - Min(k,n-k): k in [0..n]]: n in [0..10]]; // G. C. Greubel, May 26 2018
  • Mathematica
    Column[Table[Floor[n/2] - Min[k, n - k], {n,0, 19}, {k, 0, n}]] (* Indranil Ghosh, Mar 15 2017 *)
  • PARI
    tabl(nn) = {for(n=0, nn, for(k=0, n, print1(floor(n/2) - min(k, n - k),", ");); print(););};
    tabl(19); \\ Indranil Ghosh, Mar 15 2017
    
  • Python
    i=0
    for n in range(0,20):
        for k in range(0, n+1):
            print(str(i)+" "+str((n//2) - min(k, n - k)))
            i+=1 # Indranil Ghosh, Mar 15 2017
    

Formula

T(n,k) = floor(n/2) - min(k,n-k).