This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.


Jacobi symbol

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.


numlib::jacobi(a, m)


numlib::jacobi(a,m) returns the Jacobi symbol (a | m).

numlib::jacobi returns an error if one of its arguments evaluates to a number of wrong type.


Example 1

Computing the Jacobi symbol (222222 | 304679):

numlib::jacobi(222222, 304679)

Example 2

Computing the Jacobi-Symbol (222222 | 324889):

numlib::jacobi(222222, 324899)

Example 3

Computing the Jacobi symbol (222222 | 333333):

numlib::jacobi(222222, 333333)



An integer


An odd positive integer

Return Values

numlib::jacobi(a,m) returns 0, 1, or -1, or the function call with evaluated arguments if one of the arguments is not a number.


numlib::jacobi doesn't use ifactor.

If a is an integer and m is an odd integer not coprime to a then by definition the Jacobi Symbol (a | m) is zero.

See Also

MuPAD Functions

Was this topic helpful?