The factorization shit I'm always ranting about? I decided for once to explain it visually in this handy dandy little infographic.

We're essentially transforming the product from an unsmooth set of potential factors in its factor tree, to a factorization tree that guarantees first that the set of potential factors are all 2, 3, 5, and a or b of p, and second, that all the factors are *smooth integers* of a or b.

This is basically what Adi Shamir was trying to do with TWINKLE and TWIRL, despite checking a hundred thousand+ potential primes.

I did it in four.

  • 1
    Link to the discussion and source.


    Need to add decimal support and large prime generation next, in order to test larger ranges.

    Also wondering if there is a generalization of the existing product transformation rule, or a better way of deriving I and J.

    I want to maybe write an a-life to optimize the transformation rule set, to 1. push the number of products it applies to higher than the current 66%, and 2. speed it up. Half of all numbers return a successful transform in 2-10% of the smaller factor of the product's two factors, but a quarter of them take 40-60% of the search time of bruteforcing A.

    I'm wondering if I can recurse, instead *approximating* a correct transformation of P=N, and then in turn apply that transform to N, or simply N in such a way that I can derive I and J.

    I think theres a lot of ground to cover and a lot of potential improvement.
  • 2
    Police: Who committed crimes against mathematics?

    Detective: Wisecrack is our prime suspect.
  • 1

    Thats the thing. It really is stupid simple. Like if you look at the code it really does just boil down to string concatenation and individual digit manipulation.

    Like I wrote, it *shouldn't work, but it does.

    What do I need to actually prove it?

    When I rewrite the script should I make it command line?


    a = input("input factor a, or leave blank to have one generated for you:" )

    b = input("input factor a, or leave blank to have one generated for you:" )

    That people can just test it right out of the box without any setup?

    I think I may have cried wolf so many times, that people don't believe any more.




    get in here. I need to pick your brains.
  • 1
    My brain is sleepy, but I'll have a looksie tomorrow 😁
  • 0
    @atheist I would very much appreciate that.

    I'll see about converting it to the Decimal library and adding the inputs to make it cleaner, among other options.
  • 0
    Took long enough but I got factorization working properly. Not perfect but it's relatively clean and easy to use from the console. Just start the script like you'd normally do and it'll prompt you for relevant input

  • 0
    Second option in the menu is borked for some god awful reason. First option factors fine.

    Second option keeps returning a=p and b=1, or

    b=p, a=1

    And I'm too half awake to figure out why.

Add Comment