Eigensoul LabNo. 053 / 100Mathematics
Click or tap to step the modulus. It also advances by itself after each full triangle.

Mathematics · Study 053

Pascal Mod

Colour Pascal's triangle by remainder and fractals fall out. Mod 2 gives the Sierpinski triangle. Click through mod 3 to mod 7.

What you're looking at

Each entry of Pascal's triangle is the sum of the two above it. Here only the remainder after dividing by a small number m is kept, and each nonzero remainder gets a colour while multiples of m are left blank. Ninety six rows are drawn from the top down.

The idea behind it

With m = 2 the odd entries form the Sierpinski triangle exactly. Prime values of m give similar self repeating patterns with m rows of small triangles nested inside larger ones. The reason is a theorem by Édouard Lucas from 1878, which says that binomial coefficients modulo a prime can be read off digit by digit in base m.

Try this

Click or tap to step the modulus. It also advances by itself after each full triangle.

  • pascal's triangle
  • sierpinski triangle
  • modular arithmetic
  • lucas theorem
  • binomial coefficients