modlin | R Documentation |
Solves the modular equation a x = b mod n
.
modlin(a, b, n)
a, b, n |
integer scalars |
Solves the modular equation a x = b mod n
. This eqation is solvable
if and only if gcd(a,n)|b
. The function uses the extended greatest
common divisor approach.
Returns a vector of integer solutions.
extGCD
modlin(14, 30, 100) # 95 45 modlin(3, 4, 5) # 3 modlin(3, 5, 6) # [] modlin(3, 6, 9) # 2 5 8
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.