Documentation

numlib::msqrts

Modular square roots

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

numlib::msqrts(a, m)

Description

numlib::msqrts(a,m) returns the list of all integers x ∈ {0, 1, …, m - 1} such that .

Examples

Example 1

Computing the square roots of 132132 modulo 3231227:

numlib::msqrts(132132,3231227)

Example 2

There are no square roots of 222222 modulo 324899:

numlib::msqrts(222222,324899)

Example 3

48884 is a composite number, so a number can have more than two square roots modulo 48884:

numlib::msqrts(37,48884)

Parameters

a

An integer

m

A natural number relatively prime to a

Return Values

numlib::msqrts(a,m) returns a list of nonnegative integers

Algorithms

numlib::msqrts uses D. Shanks' algorithm RESSOL.

See Also

MuPAD Functions

Was this topic helpful?