Not very efficient, but you may find it useful for some experiments. I perused the code from the link you provided (kuba's), although there are better alternatives in the answers. ClearAll[spiral, genTri, mp]; spiral[n_?OddQ] := Nest[ With[{d = Length@#, l = #[[-1, -1]]}, Composition[ Insert[#, l + 3 d + 2 + Range[d + 2], -1] &, Insert[#\[Transpose], l + 2 d + 1 + Range[d + 1], 1]\[Transpose] &, Insert[#, l + d + Range[d + 1, 1, -1], 1] &, Insert[#\[Transpose], l + Range[d, 1, -1], -1]\[Transpose] & ][#]] &, {{1}}, (n - 1)/2]; genTri[n_] := genTri[n] = IntegerQ[(-1 + Sqrt[1 + 8 #])/2] & /@ Range@n mp[n_] := mp[n] = Image[Unitize[spiral[n] /. Thread[Flatten@Position[genTri[n^2], True] -> 0]]] Erosion[mp[601], 1] ![Mathematica graphics](https://i.sstatic.net/xPwHy.png) There they are, your 17 arms