Group Abstract Group Abstract

Message Boards Message Boards

0
|
3K Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Using JacobiSymbol vs KroneckerSymbol

Posted 2 years ago

Hello all,

from my understanding, both JacobiSymbol(n,m) and KroneckerSymbol(n,m) return the same values when their arguments are integer, even though JacobiSymbol is about 6 X faster (and even though, mathematically, the Jacobi symbol should only be defined for odd positive m).

nn=1000;

a=Table[KroneckerSymbol[ n,m], {n, -nn, nn},{m,-nn,nn}]; // AbsoluteTiming

b=Table[JacobiSymbol[ n,m], {n, -nn, nn},{m,-nn,nn}]; // AbsoluteTiming

a==b (* True *)

So, is it safe to use JacobiSymbol instead of KroneckerSymbol?

Thank you in advance.

POSTED BY: Paolo Xausa
3 Replies
Posted 2 years ago

Yes, thank you, but JacobiSymbol[2,4] (for example) works and returns the correct value:

JacobiSymbol[2,4] == KroneckerSymbol[2,4]

I can't find any difference between the two functions (with the added bonus that JacobiSymbol is faster).

POSTED BY: Paolo Xausa
POSTED BY: Mariusz Iwaniuk
POSTED BY: Mariusz Iwaniuk
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard