
Factorizer - espeed
http://www.datapointed.net/visualizations/math/factorization/animated-diagrams/
======
chubot
Very interesting. Here is a nice explanation of the algorithm:

[http://mathlesstraveled.com/2012/10/05/factorization-
diagram...](http://mathlesstraveled.com/2012/10/05/factorization-diagrams/)

(from the "About" page)

------
S4M
Nice! One suggestion: allow the viewer to input a number to view directly its
factorization instead of having to wait until that number is reached -
although it may not be efficient if the program caches the prime numbers and
factorizations. Which brings me to my second question: is the code available
somewhere? The website uses a minified version of the js code. Not the most
pleasant to understand the algorithm.

~~~
chrisseaton
> although it may not be efficient if the program caches the prime numbers and
> factorisations

If you watched this website non-stop for a whole year, it would still only
take a thousandth of a second or so to factorise the highest number you'd
reach, from scratch. Integer factorisation is only time consuming when the
numbers are really really big.

------
normac
Totally out of left field here, but I got some auditory synesthesia from
watching this, especially on high speed. If any of you did as well and are
interested why, it's probably the same phenomenon talked about here:
[https://www.newscientist.com/article/dn14459-screensaver-
rev...](https://www.newscientist.com/article/dn14459-screensaver-reveals-new-
test-for-synaesthesia/)

------
pdkl95
[http://www.divisorplot.com/](http://www.divisorplot.com/)

------
gotothrowaway
How do you figure out the factorizations? I've been looking for an efficient
way to do this with really big numbers

~~~
waynecochran
Me too. When you figure it out try to factor
641071800653367850802176606120792275422168080497001121 for me please.

~~~
jwmerrill
Sure thing!

651651626268416641641703*983764598769387649827639876407 =
641071800653367850802176606120792275422168080497001121

~~~
waynecochran
Wow -- I'm impressed. I just threw that out there to show how hard factoring
is -- I didn't think anyone would actually do it. Ummm... Do you work for the
NSA?

~~~
jwmerrill
I don't work for the NSA—I just have a laptop, and a copy of Mathematica. The
factorization took about 10 seconds.

Mathematica is really a pretty remarkable piece of software. I doubt it's
world class for factorization, but it gives you easy access to a lot of pretty
darn good algorithms for a wide range of problems.

There's 1 sentence on the implementation of FactorInteger in the docs, FWIW:

[http://reference.wolfram.com/language/tutorial/SomeNotesOnIn...](http://reference.wolfram.com/language/tutorial/SomeNotesOnInternalImplementation.html#12915)

~~~
waynecochran
Okay ... wow ... how big do the numbers need to get to bog down Mathematica?

~~~
Pyxl101
The numbers that we're talking about are not big. The number you specified:

641071800653367850802176606120792275422168080497001121

OK, so take a 64 bit integer. That's the typical size of an integer in a
modern programming language. A signed integer can represent 2^63-1 which is
9223372036854775807.

Imagine a "big integer" which is a composite of multiple 64-bit integers. With
a big integer made up of two regular integers, you can represent the value
170141183460469231731687303715884105727. With three, you get to
3138550867693340381917894711603833208051177722232017256447 if I'm doing the
math right. That's already in the ballpark of the number you mentioned - just
three regular integers together.

Granted, I'm not talking about how difficult the factoring is, but it's worth
noting that the size of the numbers are pretty small to a computer. Modern
computers are really fast and can brute force a large number of computations.
Mathematica probably has a fairly optimized general purpose factoring
algorithm as well.

A number like this might be more difficult to factor:

    
    
      16158503035655503650357438344334975980222051334857
      74201606517271376232756943394544659860070576145673
      18443589804609490097470597795752454605475440761932
      24141560315438683650498045875098875194826053398028
      81919203378413839610932130987808091904716923808523
      52908229260181525214437879457705329043037761995619
      65192760957166694834171210342487393282284747428088
      01766316102903890282966551309635423015707512929643
      20885583629718018592309286787991755761508229522018
      48806616643615613562842355410104862578550863465661
      73483927129032834896752299863417649931910776258319
      47186677718010677166148023226592393024760740967779
      26805529798115327

------
skykooler
This is beautiful!

------
icholy
I want this to be my screensaver

------
potatote
Does anyone know what visualization library was used to do this? I am
interested in learning data visualization and always wonder where to begin.

~~~
wslh
Just looking at the source:
[http://www.datapointed.net/media/2012/10/factor_min.js](http://www.datapointed.net/media/2012/10/factor_min.js)
and then looking at some keywords:

//Link to original minified source code
[http://www.datapointed.net/media/2012/10/factor_min.js](http://www.datapointed.net/media/2012/10/factor_min.js)

//Credits to Stephen Von Worley www.datapointed.net

Here there is an expanded version
[https://gist.github.com/brianahearn/6032808](https://gist.github.com/brianahearn/6032808)
and a discussion:
[https://groups.google.com/forum/m/#!msg/mathfuture/yEfAaey6j...](https://groups.google.com/forum/m/#!msg/mathfuture/yEfAaey6jq0/x7DXTBJzgRMJ)

------
bad-joke
Very cool! Why does it stop at 10,000?

------
dedalus
why a circle and why NOT a straight line which is equally plausible
visualization

~~~
rspeer
You sound a little demanding when you capitalize "NOT" like that.

I didn't make the visualization but I find the circles to be a good choice.
Not only is it pretty, it makes use of two-dimensional space in a consistent
way. A factor of 5 has the same shape whenever it appears.

If you factorized things into a straight line, do you just line everything up
horizontally, in which case you just see hundreds of dots with gaps in them
and there would be nothing interesting about the visualization? Or do you make
rectangles, with some of the factors going vertically? In that case, sometimes
your 5s will go horizontally and sometimes they'll go vertically, making a
distinction out of nothing.

~~~
d4n3
I think this actually wasn't an arbitrary choice, but a result of the
algorithm.. e.g. factors are displayed as clusters ordered in a circle
(factors of 2 is a circle with groups of 2, factors of 3 is a circle of groups
of 3).

So for primes, you have a circle of groups of 1.

------
espeed
Primes form a circle because they can't be divided.

~~~
Retra
You can divide circles.

~~~
espeed
Primes can't be divided.

