This program was exactly what I was looking for. I had each of the boys play with it. My older son went first:

My younger son went next. I’m sorry this video runs a little long – I just couldn’t stop. He was so engaged by the program and kept finding new interesting things to talk about:

These multiplication graphs make for one of the most interesting ways for kids to talk about math – from number theory to geometry – that I’ve ever seen.

Also, I’d point out that the math involved here goes up pretty high. Here’s a famous paper by Bjorn Poonen and Michael Rubenstein from 1997 which solved the problem of how to count the number of times the diagonals of a regular polygon intersect.

I’m guessing that counting the intersection points inside of the shapes in this project (as a function of N and M) is probably an extremely difficult problem.