Animated Factorization (2012)
51 comments
·May 21, 2025worldsayshi
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...
CGMthrowaway
Kind of makes me wish that there were recognizable shapes for primes bigger 2 (pair), 3 (triangle), 4 (square) and 5 (pentagon) that didn't just look like circles. Because my favorite part about this is how you can see at a glance what the factors are. Except for primes 7 or greater I find myself cheating and looking at the top left for which prime it is.
Is there some non-regular polygon that would be more distinctly recognizable to use for 7, 11, etc?
tocs3
I asked somewhere here about the algorithm for the position of the dots and got an answer (can I link directly to a post?) below. Putting things on a circle sounds like a good way to do it but it sort of precludes special arrangement for specific numbers. Not that it could not be done but what would the algorithm look like?
Edit: I looked more at the animation some more and maybe I am wrong. Anyway I may try to make one.
drdeca
4 isn’t prime.
You could probably use the binary expansion to group the dots? So, 1 is • 2 is •• 3 is _• •_•
5 is
_• •_• •_•
7 is ____• _•_____• •_•___•_•
11 is ____• _•_____• •_•___•_• •_•___•_•
And so on.
(So, 2n is represented as n next to n, unless n is 2 in which case it is n above n, and 2n+1 is 1 above 2n )
Alternatively, using stars instead of n-gons could also be clearer?
worldsayshi
Couldn't you draw it in a recognizable way using summation?
7 = 2*3+1
11 = (2*2+1)*2+1
etc...
CGMthrowaway
Interesting idea
Liftyee
Agree. I watched for a while to see some larger primes and was a little disappointed.
Filled polygons would offer some more shapes. Filled hexagon = 7, etc etc...
GaggiX
Aren't 2 (pair), 3 (triangle), 4 (square) and 5 (pentagon) also "circles" with less resolution? The visualization is just consistent.
CGMthrowaway
Yes I dont disagree and it is elegant as is, but the way our eyes/ brain works it's much harder to ID septagon, nonagon, triacontahenagon etc at a glance. A non-regular shape would be better fit for purpose
ashwinsundar
I believe it's called prime factorization. Each number is placed in a group of numbers (or group of groups, etc...)
E.g. 24 -> 2 * 3 * 4 = Two groups of (three groups of (four items))
Also try this for the archived version of that explanation -> https://web.archive.org/web/20130206023100/http://mathlesstr...
null
math_dandy
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!
robot_jesus
Same. I loved this unique insight that the visualization provided. It definitely unlocked something in my brain for how I should think about that shape.
If anyone is curious, 6561 (3^8) is the highest pure Sierpinski available in the animation since it caps at 10K.
pvg
Threads (with some explainy links) from a million and a million and a bit years ago
dang
Thanks! Macroexpanded:
Factorizer - https://news.ycombinator.com/item?id=10776019 - Dec 2015 (30 comments)
Animated Factorisation Diagrams - https://news.ycombinator.com/item?id=4788224 - Nov 2012 (72 comments)
Animated Factorization Diagrams - https://news.ycombinator.com/item?id=4713048 - Oct 2012 (2 comments)
sherdil2022
And definitely re-post worthy!
kccqzy
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!
gavmor
The jumps between neighbors are sometimes so drastic—are we sure our numbers are in the right order?
jerf
That's the difference between the additive view of the world and the multiplicative one. A lot of number theory involves trying to bridge that gap, and even this simplest view of numbers can rapidly fling you into the mathematical unknown. The "simplest hard problem", the Collatz conjecture, can be viewed as coming from this space. You either take a step in multiplicative space, or a step in multiplicative space and then additive space, and ask a very simple question about where those steps can take you.
And that's all it takes to end up at an unsolved problem in math.
You can spend a lifetime on this simple observation that "the jumps between neighbors are so dramatic", just trying to reconcile the complex relationships between the additive view of the world and the multiplicative one.
And we haven't even done anything like bring in complex numbers, or rationals, or introduce exponentiation!
gavmor
How can a layperson approach and develop correct intuitions for "the multiplicative view" of numbers? Is it practical?
jhanschoo
I don't know what you mean by that, but for an example, 16=2^4 and is therefore arranged as a grid, whereas 17 is prime, and must therefore be arranged as 17 dots on a circle.
gavmor
The primes are some of the worst offenders, eg the transition from 647 (prime) to 648 (3×3×3×3×2×2×2), but as we approach infinity, the visualizations increasingly appear circular, and it's the least-primey (?) that break from the trend.
eg 854-856, & 857 (prime) are all virtually or perfectly circular. Or maybe I'm observing not mathematical but neuro-visual principles.
smusamashah
Does it let you put your own number and see what diagram it makes?
jderick
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.
glaucon
Really good. I would appreciate it if it could be slowed down, or allow the numbers to be stepped through.
null
dtjohnnymonkey
After some time I find myself waiting for highly composite numbers rather than primes.
ape4
I think the sum of the area of the circles should remain constant. ie be the number that's being factored.
I found my new loading icon