I down voted this post last night when you posted the first three lines of the current post:
We are talking about integer factorisation?
This has (almost) nothing to do with integer factorisation. That is to say, whilst there might be an approach the problem using integer factorisation; it would be like using calculus to tally your bar bill.
Can't be calculated without a quantum computer.
Whilst generalised integer factorisation is known to be hard; for the size of integers involved here < 2^64, there are simple, efficient methods available.
Plus your code could endless loop
You're right, it could; but only if the product, $r *4096 > $c; which will never be the case; and the 'cure' (omitted for clarity in the description of the question) is trivial.
One good solution is to use a lookup table.
(Apart from: what does $__intfactor{%r} mean?, (which I'll assume is a typo); and where did $r and $c come from in that subroutine? (Which I'll assume is just laziness.)
Offering a solution that caches to disk, the results of the iterative method I posted, doesn't begin to answer the question I asked.
It's like answering the question "How do we solve world hunger", with a proposal for setting up food warehouses and suggesting that when people are hungry, they simply go to the warehouse and collect some food.
This is the third time in the last couple of days where you've immediately posted something fairly meaningless when a SoPW first appears; and then silently expanded/modified it without attribution later. Apparently taking Ambrus' "advice" to heart.
Fair warning: Continue to do so in threads I start, or those I am interested in, and you and I will have a problem.
In reply to Re^2: Simple arithmetic?
by BrowserUk
in thread Simple arithmetic?
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |