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.

A157654 Triangle T(n, k, m) = 1 if k = 0 or k = n, otherwise m*abs( (n-k)^(m-1) - k^(m-1) ), with m = 2, read by rows.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 1, 2, 2, 1, 1, 4, 0, 4, 1, 1, 6, 2, 2, 6, 1, 1, 8, 4, 0, 4, 8, 1, 1, 10, 6, 2, 2, 6, 10, 1, 1, 12, 8, 4, 0, 4, 8, 12, 1, 1, 14, 10, 6, 2, 2, 6, 10, 14, 1, 1, 16, 12, 8, 4, 0, 4, 8, 12, 16, 1
Offset: 0

Views

Author

Roger L. Bagula, Mar 03 2009

Keywords

Comments

For the cases of m = 0, 1 the triangles reduce to T(n, k, m) = A103451(n, k). - G. C. Greubel, Dec 13 2021

Examples

			Triangle begins as:
  1;
  1,  1;
  1,  0,  1;
  1,  2,  2,  1;
  1,  4,  0,  4,  1;
  1,  6,  2,  2,  6,  1;
  1,  8,  4,  0,  4,  8,  1;
  1, 10,  6,  2,  2,  6, 10,  1;
  1, 12,  8,  4,  0,  4,  8, 12,  1;
  1, 14, 10,  6,  2,  2,  6, 10, 14,  1;
  1, 16, 12,  8,  4,  0,  4,  8, 12, 16, 1;
		

Crossrefs

Programs

  • Magma
    T:= func< n,k,q | k eq 0 or k eq n select 1 else q*Abs( (n-k)^(q-1) - k^(q-1) ) >;
    [T(n,k,2): k in [0..n], n in [0..15]]; // G. C. Greubel, Dec 13 2021
    
  • Mathematica
    T[n_, k_, m_]:= T[n, k, m]= If[k==0 || k==n, 1, m*Abs[(n-k)^(m-1) - k^(m-1)]];
    Table[T[n,k,2], {n,0,15}, {k,0,n}]//Flatten
  • Sage
    def A157684(n,k,q): return 1 if (k==0 or k==n) else q*abs((n-k)^(q-1) - k^(q-1))
    flatten([[A157684(n,k,2) for k in (0..n)] for n in (0..15)]) # G. C. Greubel, Dec 13 2021

Formula

T(n, k, m) = 1 if k = 0 or k = n, otherwise m*abs( (n-k)^(m-1) - k^(m-1) ), with m = 2.
From G. C. Greubel, Dec 13 2021: (Start)
Sum_{k=0..n} T(n, k, 2) = (-1)*[n==0] + A244800(n-1).
T(2*n, n, 2) = A000007(n). (End)

Extensions

Edited by G. C. Greubel, Dec 13 2021