Comment on Show HN: Primeval NumbersComments−dullcrisp2yWhat logic does it use for when to use a +1? One thing I noticed: if I give it 100,000 it gives me 2^5•5^5. But if I give it 100,001, instead of 2^5•5^5+1, it gives (2•5 + 1)•(2•3^2•5•(2^2•5^2 + 1) + 1), which seems sub-optimal.−aravindetOP2yIt only uses the +1 for prime numbers. 100,001 is not prime.This rule ensures that there is a unique representation for every number.−aaron52yFantastic! Thank you for explaining this.
Comments
What logic does it use for when to use a +1? One thing I noticed: if I give it 100,000 it gives me 2^5•5^5. But if I give it 100,001, instead of 2^5•5^5+1, it gives (2•5 + 1)•(2•3^2•5•(2^2•5^2 + 1) + 1), which seems sub-optimal.
It only uses the +1 for prime numbers. 100,001 is not prime.
This rule ensures that there is a unique representation for every number.
Fantastic! Thank you for explaining this.