Loading ...
Sorry, an error occurred while loading the content.
 

Re: [PrimeNumbers] Lucas Sequence modular sqrt help

Expand Messages
  • Phil Carmody
    ... A short and simple answer, thank you. Bleary-eyed, I incorrectly changed my code just now, and the code spewed out the correct answers, but on checking
    Message 1 of 2 , Dec 3 1:22 AM
      On Sun, 02 December 2001, Marcel Martin wrote:
      > Phil,
      >
      > >Lucas sqrt(15) mod 17 - P=1 Q=15 desc=10, want v[9]
      >
      > desc = P^2 - 4Q = 1 - 4x15 = -59, but -59 mod 17 = 9. This is a
      > square!

      A short and simple answer, thank you.

      Bleary-eyed, I incorrectly changed my code just now, and the code spewed out the correct answers, but on checking back, I noticed the code was now certainly wrong. So I changed it back to what I believe it was at first, and it now works???? Heaven knows where the descriptor being 10 came from, but that was certainly the root of the problem.

      I shall of course run with sanity checking to re-square anything I take the root of, but apart from that, I think my modular square root code is finally complete (you don't want to know how long it took...).

      Thanks again Marcel,
      Phil
      (Right, lets go smash a few records... :-) )

      Don't be fooled, CRC Press are _not_ the good guys.
      They've taken Wolfram's money - _don't_ give them yours.
      http://mathworld.wolfram.com/erics_commentary.html


      Find the best deals on the web at AltaVista Shopping!
      http://www.shopping.altavista.com
    Your message has been successfully submitted and would be delivered to recipients shortly.