login
Irregular triangle read by rows: the n-th row gives the column indices of the consecutive elements of the spiral of the n X n matrix defined in A126224.
2

%I #19 Jul 01 2021 08:21:44

%S 1,1,2,2,1,1,2,3,3,3,2,1,1,2,1,2,3,4,4,4,4,3,2,1,1,1,2,3,3,2,1,2,3,4,

%T 5,5,5,5,5,4,3,2,1,1,1,1,2,3,4,4,4,3,2,2,3,1,2,3,4,5,6,6,6,6,6,6,5,4,

%U 3,2,1,1,1,1,1,2,3,4,5,5,5,5,4,3,2,2,2,3,4,4,3

%N Irregular triangle read by rows: the n-th row gives the column indices of the consecutive elements of the spiral of the n X n matrix defined in A126224.

%H Stefano Spezia, <a href="/A343559/b343559.txt">First 30 rows of the triangle, flattened</a>

%e The triangle begins

%e 1

%e 1 2 2 1

%e 1 2 3 3 3 2 1 1 2

%e 1 2 3 4 4 4 4 3 2 1 1 1 2 3 3 2

%e ...

%t a:={};nmax:=6;For[n=1,n<=nmax,n++,For[s=1,s<=2n-1,s++,If[OddQ[s]&&Mod[s,4]==1 ,k=Floor[s/4];For[i=1,i<=Ceiling[n-s/2],i++,AppendTo[a,k+i]];k=+Floor[s/4]+Ceiling[n-s/2],If[EvenQ[s],For[i=1,i<=Ceiling[n-s/2],i++,AppendTo[a,k]],For[i=1,i<=Ceiling[n-s/2],i++,AppendTo[a,k-i]];k=k-i+1]]]]; a

%Y Cf. A000290 (row length), A002265, A002411 (row sums), A010873, A060747, A126224, A343558 (row indices).

%K nonn,look,tabf

%O 1,3

%A _Stefano Spezia_, Apr 19 2021