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.

A386319 Triangle read by rows where row n is the start, corner and end vertex numbers of a triangular spiral with n sides on a triangular grid, starting from 1 and working inwards (0 <= k <= n).

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 1, 3, 5, 6, 1, 4, 7, 9, 10, 1, 5, 9, 12, 14, 15, 1, 6, 11, 15, 18, 20, 21, 1, 7, 13, 18, 22, 25, 27, 28, 1, 8, 15, 21, 26, 30, 33, 35, 36, 1, 9, 17, 24, 30, 35, 39, 42, 44, 45, 1, 10, 19, 27, 34, 40, 45, 49, 52, 54, 55, 1, 11, 21, 30, 38, 45, 51, 56, 60, 63, 65, 66, 1, 12, 23, 33, 42, 50, 57, 63, 68, 72, 75, 77, 78
Offset: 0

Views

Author

Binay Krishna Maity, Jul 18 2025

Keywords

Comments

The first 2 sides are length n-1 so that T(n,1) = 1 + (n-1) and T(n,2) = 1 + 2*(n-1) and then the side lengths decrease by 1 each time as it spirals in (ending at triangular number A000217(n) when n>=1).
These sides mesh to fill the triangle as they go inwards, and can also be thought of going outwards tracing out the sides of the triangle.
The resulting vertex numbers are 1 together with row n of A141419.
Row n=1 is taken as a side of length 0 so the start and end numbers are both 1 (which is not really a spiral but is consistent with the formula and two points 1,2 would be even less like a triangle filled by a spiral).

Examples

			Triangle begins:
--------------------------------------
   n\k  0   1   2   3   4   5   6   7
--------------------------------------
   0|   1;
   1|   1,  1;
   2|   1,  2,  3;
   3|   1,  3,  5,  6;
   4|   1,  4,  7,  9, 10;
   5|   1,  5,  9, 12, 14, 15;
   6|   1,  6, 11, 15, 18, 20, 21;
   7|   1,  7, 13, 18, 22, 25, 27, 28;
  ...
For n = 2 the spiral is 2 sides of length 1 so row [1, 2, 3],
   1 --- 2
       /
     3
For n = 4 the spiral is:
   1  2  3  4
    9  10  5
      8  6
        7
The start, corner and end vertices are [1, 4, 7, 9, 10].
		

Crossrefs

Columns: A000012 (k=0), A000027 (k=1), A144396 (k=3).
Cf. A179865(n+1) (main diagonal), A056520 (row sums).

Programs

  • Mathematica
    T[n_,k_]:=If[k==0,1,k(2n-k+1)/2];Table[T[n,k],{n,0,12},{k,0,n}]//Flatten (* James C. McMahon, Jul 31 2025 *)

Formula

T(n,0) = 1.
T(n,k) = k*(2*n - k + 1)/2 for k >= 1.