中国剩余定理笔记 Posted on 2019-06-01 Edited on 2021-05-09 In algorithm 中国剩余定理{x≡a1modm1x≡a2modm2…x≡anmodmn其中mi两两互质M=∏i=0nmi,Mi=Mmix=∑i=0naiMiMi−1(modmi) 扩展中国剩余定理模数不互质的时候x≡a1modm1x≡a2modm2也就是x=k1m1+a1=k2m2+a2∴k1m1=(a2−a1)+k2m2即k1m2≡(a2−a1)modm2让d=(m1,m2)即k1m1d≡(a2−a1)dmodm2d这样就可以得到k1=k′m2d+a2−a1d(m1d)−1(modm2d)令t=a2−a1d(m1d)−1(modm2d)带回原式得x=(k′m2d+t)m1+a1即可并成x=k′m1m2d+tm1+a1即x≡amodm,其中a=tm1+a1,m=m1m2d Related Posts 欧几里得算法与扩展欧几里得算法 行列式 线性代数笔记 高等数学笔记 Have fun. Donate WeChat Pay Alipay Post author: BeiYu Post link: https://blog.bj-yan.top/algorithm-chinese-remainder-theorem/ Copyright Notice: All articles in this blog are licensed under BY-NC-SA unless stating additionally.