OFFSET
1,3
LINKS
Stefano Spezia, First 30 rows of the triangle, flattened
EXAMPLE
The triangle begins
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
...
MATHEMATICA
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
CROSSREFS
KEYWORD
AUTHOR
Stefano Spezia, Apr 19 2021
STATUS
approved