Talk:Tonelli–Shanks algorithm

Latest comment: 5 years ago by 88.76.118.122 in topic About the Tonelli formulas

the case where p = 3 mod 4

edit

It is written that in the special case where p equals 3 modulo 4, then the solution is simply:

 

I don't get why. Is it supposed to be obvious? --Grondilu (talk) 14:01, 20 June 2012 (UTC)Reply

Yes. Square it, and apply Euler's criterion.—Emil J. 14:41, 20 June 2012 (UTC)Reply

alberto tonelli needs enwiki biop (from itwiki)

edit

Alberto Tonelli needs a enwiki translation. He has an article on the itwiki, a small one that doesn't mention he first came up with the important Tonelli-Shanks modular square root algorithm. There are three algorithms to take a modular square root and Tonelli's is as good as any of them. It's actually a rather important algorithm, since public key cryptography uses modular arithmetic. Endo999 (talk) 02:13, 28 August 2017 (UTC)Reply

dickson's work on tonelli says the algorithm will work on mod p^k

edit

I'm not a professional mathematician but I just read Dickson's "History of Numbers" [1] where it says on page 215-216 that

A. Tonelli[2] gave an explicit formula for the roots of  

Perhaps some mathematician should work out if the Tonelli algorithm takes modular square roots for powers of primes as well as for primes This Wiki article says the algorithm only works for prime modula.

After reading the Dickson text a couple of times on p215,216 I came across this formula for the square root of  .

when  , or   and  
for   then
  where  

Noting that   and noting that   then

 

So Tonelli's math does seem to take modular square roots of prime powers! Endo999 (talk) 03:17, 2 September 2017 (UTC)Reply

Here's another equation:   and

 

Endo999 (talk) 06:36, 30 August 2017 (UTC)Reply

On page 215-216 of the Dickson book, the equation is given of Tonelli's:

  where   and  ;

Using   and using the modulus of   the math follows (in mathematica):

Mod[1115^2, 23 23 23]=2191
 
Mod[1115^2, 23]=6
PowerMod[6, 1/2, 23]=11

Mod[11^(23 23) 2191^((23 23 23 - 2 23 23 + 1)/2), 23 23 23] =1115

Thus Tonelli's work can work for a 3 mod 4 prime power. Endo999 (talk) 20:23, 11 September 2017 (UTC)Reply

References

  1. ^ "History of the Theory of Numbers" Volume 1 by Leonard Eugene Dickson, p215-216 read online
  2. ^ "AttiR. Accad. Lincei, Rendiconti, (5), 1, 1892, 116-120."

The algorithm makes no sense at all when

edit

I suppose that   should rather read  ? And the introductory sentence is more than confusing as well. The "multiplicative group" would perhaps be  , and of course all operations and comparisons in that ring are modulo  . --Hagman (talk) 09:09, 10 February 2018 (UTC)Reply

Completely agreed. There are further issues: several times when computing the order of the multiplicative group modulo  , the order is given as   instead of the correct  . I think this should be flagged for fixing - it's factually incorrect as written on the page at present. --Anonymous Coward, 19:35, 5 November 2018 (UTC) — Preceding unsigned comment added by 97.115.75.203 (talk)

Error in first line of 'core ideas'?

edit

> Given a non-zero n and an odd prime p, the Euler's criterion tells us that n has a square root (i.e., n is a quadratic residue) if and only if

I don't know about this stuff, but this seems wrong in one or more ways. First, "has a square root" has to be wrong, as every integer "has a square root". I think it means an integer square root? Secondly, I don't think that's true either, but only "modulo p". I think maybe a quadratic residue is only sensible "modulo p"? At least, based on my understanding from the first sentence of "Quadratic residue" wikipedia page. — Preceding unsigned comment added by 134.134.139.74 (talk) 21:44, 22 February 2018 (UTC)Reply

I have linked quadratic residue in that sentence since it is the first occurrence. And yes, it is modulo p. I think the lead makes that clear. It is the first sentence after the lead. PrimeHunter (talk) 22:30, 22 February 2018 (UTC)Reply

About the Tonelli formulas

edit

This is a bit confusing:

The Dickson reference shows the following formula for the square root of  .

when  , or  (s must be 2 for this equation) and   such that  
for   then
  where  

Noting that   and noting that   then

[....]

One should probably say (using the notation in Dickson's "History of the theory of numbers"):

The Dickson reference shows the following formula for the square root of  .

when   is prime, where   and   is odd, thus   is odd
for  , where   then
if  :
 
if  :
 
if  :
 ,
where   is an integer such that   is a quadratic residue of  , and   is a non-residue.
We may take   if   is not divisible by  , but   if   is divisible by  , while neither   nor   are divisible by  .

In the following we set  ,   and   such that  ,   and   then

[....] — Preceding unsigned comment added by 88.76.118.122 (talk) 23:09, 9 June 2019 (UTC)Reply