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.

A155124 Triangle T(n, k) = 1-n if k=0 else 2, read by rows.

Original entry on oeis.org

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

Views

Author

Roger L. Bagula, Jan 20 2009

Keywords

Examples

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

Programs

  • Magma
    [k eq 0 select 1-n else 2: k in [0..n], n in [0..15]]; // G. C. Greubel, Mar 25 2021
    
  • Mathematica
    Table[CoefficientList[-(m-1) + 2*x*(1-x^m)/(1-x), x], {m,0,15}]//Flatten
    Table[If[k==0, 1-n, 2], {n,0,15}, {k,0,n}]//Flatten (* G. C. Greubel, Mar 25 2021 *)
  • Sage
    flatten([[1-n if k==0 else 2 for k in (0..n)] for n in (0..15)]) # G. C. Greubel, Mar 25 2021

Formula

From G. C. Greubel, Mar 25 2021: (Start)
T(n, k) = 1-n if k=0 else 2.
Sum_{k=0..n} T(n ,k) = n+1 = A000027(n+1). (End)

Extensions

Edited by G. C. Greubel, Mar 25 2021