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.

A157635 Triangle read by rows: T(n,m) = 1 if n*m*(n-m) = 0, and n*m*(n-m) otherwise.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 6, 6, 1, 1, 12, 16, 12, 1, 1, 20, 30, 30, 20, 1, 1, 30, 48, 54, 48, 30, 1, 1, 42, 70, 84, 84, 70, 42, 1, 1, 56, 96, 120, 128, 120, 96, 56, 1, 1, 72, 126, 162, 180, 180, 162, 126, 72, 1, 1, 90, 160, 210, 240, 250, 240, 210, 160, 90, 1
Offset: 0

Views

Author

Roger L. Bagula, Mar 03 2009

Keywords

Comments

Row sums are: {1, 2, 4, 14, 42, 102, 212, 394, 674, 1082, 1652, ...}.

Examples

			Triangle begins as:
   1;
   1,  1;
   1,  2,  1;
   1,  6,  6,  1;
   1, 12, 16, 12,  1;
   1, 20, 30, 30, 20,  1;
   1, 30, 48, 54, 48, 30, 1;
		

Programs

  • Magma
    [[n*k*(n-k) eq 0 select 1 else n*k*(n-k): k in [0..n]]: n in [0..10]]; // G. C. Greubel, Apr 09 2019
    
  • Mathematica
    Table[If[n*m*(n-m)==0, 1, n*m*(n-m)], {n, 0, 10}, {m, 0, n}]//Flatten (* modified by G. C. Greubel, Apr 09 2019 *)
  • PARI
    {T(n,k) = if(n*k*(n-k)==0, 1, n*k*(n-k))}; \\ G. C. Greubel, Apr 09 2019
    
  • Sage
    @CachedFunction
    def T(n, k):
       if (n*k*(n-k)==0): return 1
       else: return n*k*(n-k)
    [[T(n, k) for k in (0..n)] for n in (0..10)] # G. C. Greubel, Apr 09 2019

Formula

T(n,m) = 1 if n*m*(n - m) = 0, and n*m*(n - m) otherwise.

Extensions

Edited by G. C. Greubel, Apr 09 2019