View Single Post
Old 2019-02-13, 14:04   #4
Dr Sardonicus
 
Dr Sardonicus's Avatar
 
Feb 2017
Nowhere

43·101 Posts
Default

Quote:
Originally Posted by enzocreti View Post
And what if I search for values of k such that
k is multiple of 43
k is of the form 41s+r with r=1,10,16,18,37
then if k is even, k have to be congruent to 6 mod 13
if k is odd, k have to be congruent to 7 mod 13
?

The Pari-GP function chinese() [named in honor of the Chinese Remainder Theorem, or CRT] is made for such things. The conditions 43|k, k == 1 (mod 41), 2|k, and k == 6 (mod 13) give

? chinese([Mod(0,43),Mod(1,41),Mod(0,2),Mod(6,13)])
%1 = Mod(23822, 45838)

while 43|k, k == 1 (mod 41), k == 1 (mod 2), and k == 7 (mod 13) give

? chinese([Mod(0,43),Mod(1,41),Mod(1,2),Mod(7,13)])
%2 = Mod(32637, 45838)

and similarly for the others.
Dr Sardonicus is offline   Reply With Quote