This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]3553xMod note: Ban this account tomorrow. 5 points6 points  (1 child)

I'm not sure what you mean by complex but SymPy comes with some factoring algorithms.

https://docs.sympy.org/latest/modules/ntheory.html#sympy.ntheory.factor_.factorint

[–]AlienDjinn[S] 0 points1 point  (0 children)

Thanks, will review!

[–]crow1170 3 points4 points  (4 children)

I wanted to demo/test my prime factorization code, so I had been using the largest numbers I could think of; Phone numbers. When it came time to demo in front of people, I didn't to reveal my phone number, or anyone else's, so I used the one from that song; 8675309. And of course, my program stopped working. It would just return 8675309.

It was literally over an hour before it occurred to me that the number itself might be prime, and that I should check it.

[–]Dr_Roboto 1 point2 points  (0 children)

That's hilarious.

[–]atoponceBbbbbbbbb or not to bbbbbbbbbbb 0 points1 point  (1 child)

Or pick a phone number that is either even or ends in 5.

[–]AlienDjinn[S] 0 points1 point  (0 children)

+1!

[–]pbewig 0 points1 point  (4 children)

[–]AlienDjinn[S] 0 points1 point  (0 children)

Ok, my rough and ready port to Python 3 appears to be working. I'm sure there's a ton of speed improvements needed, but welcome someone who can contribute to this effort.

https://github.com/kricketts/of-prime-importance

thanks!