Re: [PrimeNumbers] Lucas Sequence modular sqrt help
- On Sun, 02 December 2001, Marcel Martin wrote:
> Phil,A short and simple answer, thank you.
> >Lucas sqrt(15) mod 17 - P=1 Q=15 desc=10, want v
> desc = P^2 - 4Q = 1 - 4x15 = -59, but -59 mod 17 = 9. This is a
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,
(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.
Find the best deals on the web at AltaVista Shopping!