# Behavior of Pascal's triangle in $n\mod m$ where $m>2$, any fractals?

If Sierpinski Triangles are found in Pascal's Triangle under modulo 2 what happens when we view Pascal's Triangle under modulo $m$ where $m>2$? Do fractals appear and if so for which numbers?

Related question, can we predict any behaviors if $m$ is prime?

I looked at $m=3$ with about fifty rows and saw a complicated pattern of upwards and downwards facing triangles be highlighted, but was unsure if the patterns were forming a fractal.

• I wrote a python script about 3 years ago that looked at something similar. It would highlight entries in Pascal's triangle that were equivalent to $0 \pmod m$ for any $m$. You got some interesting looking shapes with triangles, as you said. I will share it when I get home and if I remember. Aug 4, 2014 at 17:49
• I did something on this a long long time ago when I was trying to prove the famous result $$\binom{pa}{pb} \equiv \binom{a}{b}\pmod {p^3}$$ when $p>3$ is prime. Definitely got interesting results when $m$ is prime, and there are fractal-like properties. Aug 4, 2014 at 18:00

For prime $m=p$ you have Lucas' theorem. It might not be obvious, but this gives a fractal structure to the binomial coefficients, modulo $p$.

(From here out, $m$ is an arbitrary integer, not $p$, because this is the statement from Wikipedia.)

It says that if $m=\sum_{i=0}^k m_i p^i$ and $n=\sum_{i=0}^k n_ip_i$ are the base $p$ representations (so $0\leq m_i,n_i<p$) then:

$$\binom{m}{n}\equiv \prod_{i=0}^k \binom{m_i}{n_i} \pmod p$$

Specifically, then, this means that if $0\leq a< b<p^k$ and and $M,N$ are any non-negative integers, then:

$$\binom{Mp^k + a}{Np^k+b} \equiv 0\pmod p$$

This gives big blocks where Pascal's triangle is zero, as in Sierpinski.

This answer gives some details on Andrew Granville's result for modulo prime powers. Don't know how "fractal" that result is. It seems to be not as "fractal" is the result for primes, but it is hard to tell.

If it is, then modulo any number $M$, Chinese Remainder Theorem says that Pascal's triangle looks like the overlay of the fractals for each of the prime powers in the unique factorization.

Without Granville, if $M$ is square-free, there will be a fractal structure, modulo $M$.

Do fractals appear and if so for which numbers?

Here is what happens experimentally for $m=3..8$ for the first $100$ rows:

All of the pictures are for $C(n,k) \text{ mod } m=0$:  I see fractal strucutre for all the cases, however for primes it's much more simple than for composite numbers, which fits with Thomas' answer.

If we pick $C(n,k) \text{ mod } m=l,~l = 1,2,\dots,m-1$ we also obtain some kind of fractal structures, but different and usually more complicated than for $l=0$.

There is this excellent page which explains a lot about the topic, and with pictures (unlike most papers).

Namely, the pattern for compostie $m$ is a combination of patterns for their prime factors.