Problem 52921. Easy Sequences 40: Quadratic Congruence
Quadratic Congruence is a modular equation of the form: .
In this exercise you will be given a vector containing the coefficients of a quadratic polynomial (), and a modulus base (m). Using these data, create a function that outputs the pair (), which are the 'primitive' solutions to the quadratic congruence.
For example consider the congruence: , the solution is , since:
, and
.
NOTE: A primitive modulus to base m, can only have values from 0 to . This is a simplified problem, in which the quadratic polynomials given in the test suite, are all factorable, and the modulus base are all odd primes.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers11
Suggested Problems
-
The Hitchhiker's Guide to MATLAB
3251 Solvers
-
Matrix indexing with two vectors of indices
709 Solvers
-
Flip the vector from right to left
8467 Solvers
-
Pattern Recognition 3 - Variable Unit and Array Length (including cell arrays)
43 Solvers
-
calculate PI without using pi function
88 Solvers
More from this Author116
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!