numlib::lincongruence --
linear congruence
IntroductionFor integers a and b and a nonzero integer
m numlib::lincongruence(a,b,m)
returns the sorted list of all solutions of the linear congruence if
this congruence is solvable. Otherwise FAIL is
returned.
Call(s)numlib::lincongruence(a, b, m)
Parametersa |
- | an integer |
b |
- | an integer |
m |
- | a non-zero integer |
Returnsnumlib::lincongruence(a,b,m) returns a
list of nonnegative integers if a and b are
integers and m is a non-zero integer such that the linear
congruence is solvable.
numlib::lincongruence(a,b,m) returns
FAIL if a and b are integers and
m is a non-zero integer such that the linear congruence
is not solvable.
numlib::lincongruence(a,b,m) returns the
function call with its arguments evaluated if one of the arguments is a
symbolic expression.
Related
Functionsnumlib::ichrem,
numlib::mroots,
numlib::msqrts
Detailsnumlib::lincongruence(a,b,m) returns an
error if one of the arguments evaluates to a number of wrong type.
Example
1A linear congruence possessing one solution:
>> numlib::lincongruence(7,19,23)
[6]
Example
2A linear congruence possessing several solutions:
>> numlib::lincongruence(77,209,253)
[6, 29, 52, 75, 98, 121, 144, 167, 190, 213, 236]
Example
3A linear congruence possessing no solutions:
>> numlib::lincongruence(77,208,253)
FAIL