Patrick2788

May 12, 2023Silver Contributor

# Create a 'Triforce' array (Sierpiński Triangle) with a formula

I've been studying 'pyramid' arrays lately and with a new Zelda title out, I was inspired to generate a left-justified 'Triforce' array with a formula.

Sierpiński triangle - Wikipedia

I took the approach of identifying and keeping the odd binomial coefficients and discarding evens.

```
Sierpiński
=LAMBDA(r,c,LET(n, INT(COMBIN(r - 1, c - 1)), IF(AND(r = 1, c = 1), 1, IF(c <= r, IF(ISODD(n), 1, ""), ""))))
Triforce
=LAMBDA(dim,MAKEARRAY(dim, dim, Sierpiński))
```

I'm interested in any other creative approaches to creating this array!