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.

A343155 Irregular triangle T read by rows: T(n, k) is the sum of the consecutive integers placed along the k-th turn of the spiral of the n X n matrix defined in A126224.

Original entry on oeis.org

1, 10, 36, 9, 78, 58, 136, 164, 25, 210, 318, 138, 300, 520, 356, 49, 406, 770, 654, 250, 528, 1068, 1032, 612, 81, 666, 1414, 1490, 1086, 394, 820, 1808, 2028, 1672, 932, 121, 990, 2250, 2646, 2370, 1614, 570, 1176, 2740, 3344, 3180, 2440, 1316, 169, 1378, 3278, 4122, 4102, 3410, 2238, 778
Offset: 1

Views

Author

Stefano Spezia, Apr 07 2021

Keywords

Examples

			The triangle T(n, k) begins:
n\k|   1    2    3    4
---+-------------------
1  |   1
2  |  10
3  |  36    9
4  |  78   58
5  | 136  164   25
6  | 210  318  138
7  | 300  520  356   49
...
For n = 1 the matrix is
      1
and T(1, 1) = 1.
For n = 2 the matrix is
      1, 2
      4, 3
and T(2, 1) = 1 + 2 + 3 + 4 = 4*5/2 = 10.
For n = 3 the matrix is
      1, 2, 3
      8, 9, 4
      7, 6, 5
and T(3, 1) = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 = 8*9/2 = 36; T(3, 2) = 9.
For n = 4 the matrix is
      1,  2,  3,  4
     12, 13, 14,  5
     11, 16, 15,  6
     10,  9,  8,  7
and T(4, 1) = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 = 12*13/2 = 78; T(4, 2) = 13 + 14 + 15 + 16 = (13 + 16)*4/2 = 58.
...
		

Crossrefs

Programs

  • Mathematica
    Table[2(2k-n-1)(3+8k(k-n-1)+4n)+n^2KroneckerDelta[n,2k-1],{n,14},{k,Ceiling[n/2]}]//Flatten

Formula

T(n, k) = 2*(2*k - n - 1)*(3 + 8*k*(k - n - 1) + 4*n) + n^2*0^(n+1-2*k) with 0 < k <= ceiling(n/2).
T(n, 1) = A033585(n-1) for n > 1.