Code covered by the BSD License  

Highlights from
Jacobi and Legendre symbol

Be the first to rate this file! 7 Downloads (last 30 days) File Size: 1.52 KB File ID: #24672

Jacobi and Legendre symbol

by Petter

 

09 Jul 2009

JACOBI computes the Jacobi symbol (m/n), a generalization of the Legendre symbol.

| Watch this File

File Information
Description

For the Legendre symbol (m/p), p must be an odd prime. The Jacobi symbol (m/n) allows n to be any odd number.

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
16 Dec 2010 Sean McClintock

There are a couple of bugs in this program...

In line 36, we want to test if n=+/-1 mod8, however, since matlab will return a value from 0 to 7 for mod(n,8),

if abs(mod(n,8))==1 is not adequate,

Perhaps

if mod(n,8)==1
    j = jacobi(m/2,n);
elseif mod(n,8)==7
    j = jacobi(m/2,n);
etc would be better.

Also, I don't think this program deals with negative m.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
number theory Petter 09 Jul 2009 10:58:23
jacobi symbol Petter 09 Jul 2009 10:58:23

Contact us at files@mathworks.com