A343854 Irregular triangle read by rows: the n-th row gives the column indices of the matrix of 1..n^2 filled successively back and forth along antidiagonals.
1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 3, 3, 2, 3, 1, 2, 1, 1, 2, 3, 4, 3, 2, 1, 2, 3, 4, 4, 3, 4, 1, 2, 1, 1, 2, 3, 4, 3, 2, 1, 1, 2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 5, 5, 4, 5, 1, 2, 1, 1, 2, 3, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 2, 3, 4, 5, 6, 6, 5, 4, 3, 4, 5, 6, 6, 5, 6
Offset: 1
Examples
The triangle begins: 1 1 2 1 2 1 2 1 1 2 3 3 2 3 1 2 1 1 2 3 4 3 2 1 2 3 4 4 3 4 ...
Links
- Stefano Spezia, First 30 rows of the triangle, flattened
Crossrefs
Programs
-
Mathematica
a={};For[n=1,n<=6,n++,For[d=1,d<=n,d++, If[EvenQ[d],i=d;For [k=1,k<=d,k++, AppendTo[a,i-k+1]],i=1;For[k=1,k<=d,k++, AppendTo[a,i+k-1]]]];For[d=n+1,d<=2n-1,d++, If[EvenQ[d],i= n; For[k=1,k<=2n-d,k++,AppendTo[a,i-k+1]],If[OddQ[d],i=d-n+1;For[k=1,k<=2n-d,k++, AppendTo[a,i+k-1]]]]]]; a