in reply to Re: Simple arithmetic?
in thread Simple arithmetic?

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.

So now we come to your belatedendum:

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.

Finally

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.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

Replies are listed 'Best First'.
Re^3: Simple arithmetic?
by hdb (Monsignor) on Mar 08, 2015 at 13:07 UTC

    I find your response far too harsh and not really appropriate, generally and for this forum in particular. Especially in the light of the fact, that your posted snippet is far from exact:

    $R = 12; $S = 2*1024**3; $c -= 4096 while $c % $r;

    You use upper and lower case $r, $c is not initialized, so the while-loop will terminate immediately.

      Well, hdb, I can understand your point, but at the same time, I can testify that when I posted my answer yesterday evening UTC time, cheako's post only had the three first lines of its current content -- not really something tremendously useful in the context. I think that most of us agree that, when we modify our posts, we should make it clear, especially when the change is so substantive and after other answers have been posted. Quite often, when I update one of my previous posts, I even make the effort of stating clearly the UTC date and time when I do it, in order to be very clear on that. cheako did not do any of that, and I can also testify that I have seen at least another instance of him/her doing the same thing on another post.

      @ cheako: please don't consider this as a personal attack, it is not an attack. You are new in the Monastery, and I fully appreciate that you may not be aware of the commonly accepted behavior around here.

      Je suis Charlie.
      I find your response far too harsh

      And there was I feeling pleased with how gentle I had been.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
      In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked
      Thank you! :)

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)

      PS: Je suis Charlie!

      update

      For the records:

      There is no way to calculate LCM which isn't useful for integer factorization and vice versa.

        There is no way to calculate LCM which isn't useful for integer factorization

        Hm. Factoring an integer: factors( i ).

        Least common multiple: lcm( i, j ).

        If I need to factor (say) 100, what other integer do I substitute for xxx in: lcm( 100, xxx );?

        and vice versa

        So, factors( i ) == ... lcm( i, ??? )... and lcm( i, j ) == ... factors( i ) ....;.

        Isn't it a bit of a problem if you need lcm() to discover factors; and factors to discover lcm()?

        Your assertion is as devoid of logic and meaning; as the "usefulness of lcm to integer factorisation" is, to the question asked in the OP.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
        In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked