• by hiAndrewQuinn on 5/22/2025, 6:52:38 AM

    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.

  • by math_dandy on 5/21/2025, 3:13:44 PM

    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!

  • by worldsayshi on 5/21/2025, 3:24:59 PM

    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...

  • by pvg on 5/21/2025, 2:59:10 PM

    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

  • by kccqzy on 5/21/2025, 5:22:01 PM

    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!

  • by glaucon on 5/21/2025, 7:07:35 PM

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

  • by gavmor on 5/21/2025, 5:23:34 PM

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

  • by jderick on 5/21/2025, 5:45:02 PM

    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.

  • by aaroninsf on 5/21/2025, 4:05:25 PM

    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

  • by dtjohnnymonkey on 5/21/2025, 7:55:46 PM

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

  • by mousethatroared on 5/22/2025, 12:39:50 AM

    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.

  • by tocs3 on 5/21/2025, 3:47:55 PM

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

  • by smusamashah on 5/21/2025, 8:59:43 PM

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

  • by liendolucas on 5/21/2025, 6:27:26 PM

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

  • by carterschonwald on 5/21/2025, 4:38:42 PM

    I think this was originally invented by Brent yorgey

  • by ape4 on 5/21/2025, 6:32:08 PM

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

  • by ajjenkins on 5/21/2025, 3:35:59 PM

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

  • by coolcase on 5/21/2025, 11:17:58 PM

    I found my new loading icon

  • by chrsw on 5/21/2025, 2:45:07 PM

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

  • by andrewrn on 5/21/2025, 4:04:42 PM

    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?

  • by vivzkestrel on 5/21/2025, 5:46:56 PM

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

  • by simojo on 5/21/2025, 3:16:47 PM

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

  • by gus_massa on 5/21/2025, 4:20:04 PM

    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.

  • by ttoinou on 5/21/2025, 6:17:08 PM

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

  • by blueflow on 5/21/2025, 3:16:19 PM

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