Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

modlin

Modular Linear Equation Solver


Description

Solves the modular equation a x = b mod n.

Usage

modlin(a, b, n)

Arguments

a, b, n

integer scalars

Details

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.

Value

Returns a vector of integer solutions.

See Also

Examples

modlin(14, 30, 100)             # 95 45
modlin(3, 4, 5)                 # 3
modlin(3, 5, 6)                 # []
modlin(3, 6, 9)                 # 2 5 8

numbers

Number-Theoretic Functions

v0.8-1
GPL (>= 3)
Authors
Hans Werner Borchers
Initial release
2021-04-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.