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.

A143199 Triangle read by rows: T(n, k) = (n+1)*A000096(k-1) + n if k <= floor(n/2), otherwise T(n, k) = (n+1)*A000096(n-k-1) + n.

Original entry on oeis.org

-1, -1, -1, -1, 2, -1, -1, 3, 3, -1, -1, 4, 14, 4, -1, -1, 5, 17, 17, 5, -1, -1, 6, 20, 41, 20, 6, -1, -1, 7, 23, 47, 47, 23, 7, -1, -1, 8, 26, 53, 89, 53, 26, 8, -1, -1, 9, 29, 59, 99, 99, 59, 29, 9, -1, -1, 10, 32, 65, 109, 164, 109, 65, 32, 10, -1
Offset: 0

Views

Author

Roger L. Bagula and Gary W. Adamson, Oct 20 2008

Keywords

Examples

			Triangle begins as:
  -1;
  -1, -1;
  -1,  2, -1;
  -1,  3,  3, -1;
  -1,  4, 14,  4,  -1;
  -1,  5, 17, 17,   5,  -1;
  -1,  6, 20, 41,  20,   6,  -1;
  -1,  7, 23, 47,  47,  23,   7, -1;
  -1,  8, 26, 53,  89,  53,  26,  8, -1;
  -1,  9, 29, 59,  99,  99,  59, 29,  9, -1;
  -1, 10, 32, 65, 109, 164, 109, 65, 32, 10, -1;
		

Crossrefs

Programs

  • Magma
    function T(n,k) // A143199
      if k le Floor(n/2) then return n + (n+1)*(k-1)*(k+2)/2;
      else return T(n,n-k);
      end if;
    end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jun 10 2024
    
  • Maple
    seq(print(seq((n + 1) * (if m <= n/2 then (m - 1) * (m + 2)\
     / 2 else (n - m + 2) * (n - (m + 1)) / 2 fi) + n, m=0..n)), n=0..10); # Georg Fischer, Oct 28 2023
  • Mathematica
    T[n_, k_]:= If[k<=Floor[n/2], n +(n+1)*(k-1)*(k+2)/2, T[n,n-k]];
    Table[T[n,k], {n,0,12}, {k,0,n}]//Flatten
  • SageMath
    def A143199(n,k): return n +(n+1)*(k-1)*(k+2)//2 if (k<1+int(n//2)) else A143199(n,n-k)
    flatten([[A143199(n,k) for k in range(n+1)] for n in range(13)]) # G. C. Greubel, Jun 10 2024

Formula

T(n, m) = (n + 1)*(if m <= floor(n/2) then (m - 1)*(m + 2) / 2 else (n - m + 2)*(n - (m + 1)) / 2 fi) + n. - Georg Fischer, Oct 28 2023
From G. C. Greubel, Jun 10 2024: (Start)
T(n, k) = n + (n+1)*(k-1)*(k+2)/2 if 0 <= k <= floor(n/2), otherwise T(n, k) = T(n, n-k).
Sum_{k=0..n} T(n, k) = (1/48)*(n+1)*(-53 - 5*n + 3*(-1)^n*(n+1) + 2*(n + 1)^3). (End)

Extensions

Definition clarified and offset corrected by Georg Fischer, Oct 28 2023