David Cleaver on Wed, 29 Dec 2021 02:09:39 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

How to solve modular equations?


Is there a way to solve modular equations in pari-gp?

I've found how to solve simple modular equations with znlog, but how would I solve:
A*10^(B*n) + C*n + D = 0 mod p
where A, B, C, and D are integers and p is a prime.

For example, if A = 2, B = 2, C = -99, D = -9, and p = 13,
how can I find which values of n are solutions to the equation?

For this example, I know that this function has solutions whenever n = [11, 19, 30] mod 39.

Is there a way to find general solutions like this?

Thanks for any help anyone can provide.