OFFSET
1,4
LINKS
Stefano Spezia, First 30 rows of the triangle, flattened
EXAMPLE
The triangle begins:
1
1 1 2 2
1 1 2 3 2 1 2 3 3
1 1 2 3 2 1 1 2 3 4 4 3 2 3 4 4
...
MATHEMATICA
a={}; For[n=1, n<=6, n++, For[d=1, d<=n, d++, If[OddQ[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[OddQ[d], i= n; For[k=1, k<=2n-d, k++, AppendTo[a, i-k+1]], If[EvenQ[d], i=d-n+1; For[k=1, k<=2n-d, k++, AppendTo[a, i+k-1]]]]]]; a
CROSSREFS
KEYWORD
AUTHOR
Stefano Spezia, May 01 2021
STATUS
approved