Animated Factorization (2012)

datapointed.net

284 points by miniBill 2 months ago


hiAndrewQuinn - 2 months ago

This is more of a "dirty high school algebra" trick, but factoring polynomials by hand at that level got a lot easier once I realized every composite number below 100 has to be divisible by 2, 3, 5, or 7. If none of those divide it, then it's prime and you can stop factoring right there.

It similarly turns out the only "non-obvious" composite under this rule is 7*13=91, all the rest can be pretty quickly tested using the normal rules. 49 is 7², so it's similarly easy to recognize. All the others are an easy primality test.

A few randomly generated numbers to show this off:

* 31? Not divisible by 2, 3, or 5 - below 7² so no risk of 7 division either. Prime. 31=31¹.

* 69? Divisible by 3. 69 = 3*23. 23? Not divisible by 2, 3, 5 - so you can stop factoring there. 69=3¹23¹.

* 92? Divisible by 2, to 2*46 - again, divisible by 2, to 2²23 - 23 isn't divisible by 2, 3 or 5, so 92 = 2²23¹.

* 68 = 2¹34 = 2²17, and 17 is not divisible by 2, 3 or 5, so you can stop there. 2²17¹.

High school textbooks generally don't use numbers higher than 100 to preclude students who don't have calculators, so this trick came in handy many times for me. It also happens to gesture at the notion that primes are surprisingly common at low numbers, and then thin out rapidly as you climb higher and higher.

math_dandy - 2 months ago

The diagrams for powers of three form the Sierpinski triangle. Makes total sense once you see it, but I hadn't seen it until today!

worldsayshi - 2 months ago

This is brilliant!

Now i want (to build) a drag and drop toy where i can multiply or summarize numbers that are represented in this way. To see how factors move (like boids).

Is this visualization algorithm called something? The explanation link from a previous HN post seems to be broken: http://mathlesstraveled.com/2012/10/05/factorization-diagram...

pvg - 2 months ago

Threads (with some explainy links) from a million and a million and a bit years ago

https://news.ycombinator.com/item?id=10776019

https://news.ycombinator.com/item?id=4788224

kccqzy - 2 months ago

I wish the animation could play at a slower pace so you have time to count the number of groups and the circles within each group. I also wish each time a new circle would animate from the edge of the screen and then arranged to show the addition of the new circle clearly. Otherwise, excellent visualization!

glaucon - 2 months ago

Really good. I would appreciate it if it could be slowed down, or allow the numbers to be stepped through.

gavmor - 2 months ago

The jumps between neighbors are sometimes so drastic—are we sure our numbers are in the right order?

jderick - 2 months ago

Can you put them all on one page and zoom in/out? Might be interesting to see some patterns in the sequence. Maybe allow filters for different factors or number ranges or different groupings.

aaroninsf - 2 months ago

I wish that all the factors were shown,

e.g. when on 12, I'd like to see both 3x4 and 2x6, with a visual indicator of when the animation is showing the different factors... maybe the whole thing shrinks and additional factorizations fill in tiles subdividing the space

Knowing the number of different factorizations is an interesting and visually presentable quality that interacts in an interesting way with the factors themselves

- 2 months ago
[deleted]
dtjohnnymonkey - 2 months ago

After some time I find myself waiting for highly composite numbers rather than primes.

mousethatroared - 2 months ago

Almost ten years ago I wanted to draw out the first thirty numbers in factored groups as shown here. It was to put in my baby daughters bedroom.

Never got around to it. This is timely, as she's factoring in school now.

tocs3 - 2 months ago

It makes me wonder what the algorithm for arranging the dots looks like.

smusamashah - 2 months ago

Does it let you put your own number and see what diagram it makes?

liendolucas - 2 months ago

This is cool! Lets use it to display the digits of a clock :-)

carterschonwald - 2 months ago

I think this was originally invented by Brent yorgey

ape4 - 2 months ago

I think the sum of the area of the circles should remain constant. ie be the number that's being factored.

ajjenkins - 2 months ago

This would make a cool progress bar replacement. Replace percentage with the number of dots (0-100).

coolcase - 2 months ago

I found my new loading icon

chrsw - 2 months ago

This looks cool. Could also be a screensaver (do people still use those)?

andrewrn - 2 months ago

This is very cool. It looks like you used the canvas api for this, but I had expected that you'd use D3.js since its so common for data visualizations. I am curious what your thinking was there?

vivzkestrel - 2 months ago

sliders should be added on this page that control everything. colors and speed are starters

simojo - 2 months ago

it took me a few seconds before I realized that it wasn't the page loading

- 2 months ago
[deleted]
gus_massa - 2 months ago

Slightly related: If you have small kids, I recommend https://www.youtube.com/@Numberblocks that is a cartoon that has characters that are numbers made by blocks, and they split to show sum and rearrange to show the factorization. It's fun for kids and the technical part is correct.

ttoinou - 2 months ago

This is pure genius, congrats, and I’m disappointed at myself I didn’t think about that earlier (:

blueflow - 2 months ago

I thought this was a waiting animation and the website is broken.

gitroom - 2 months ago

[dead]

curtisszmania - 2 months ago

[dead]