X = A2 + B2を求めてみる。
まず、2つの 9 bit の自乗和は、高々 19 bit であるから
A 5 = 2 (mod 5), A 7 = 0 (mod 7), A 9 = 6 (mod 9), A11 = 5 (mod 11), A13 = 6 (mod 13), A16 = 5 (mod 16)
となる。それぞれの自乗の剰余を求めB 5 = 2 (mod 5), B 7 = 6 (mod 7), B 9 = 7 (mod 9), B11 = 5 (mod 11), B13 = 9 (mod 13), B16 = 12 (mod 16)
SA 5 = 4 (mod 5), SA 7 = 0 (mod 7), SA 9 = 0 (mod 9), SA11 = 3 (mod 11), SA13 = 10 (mod 13), SA16 = 9 (mod 16)
それぞれの和の剰余を求めるとSB 5 = 4 (mod 5), SB 7 = 1 (mod 7), SB 9 = 2 (mod 9), SB11 = 3 (mod 11), SB13 = 3 (mod 13), SB16 = 0 (mod 16)
となり、剰余系において答えが求められた。S 5 = 3 (mod 5), S 7 = 1 (mod 7), S 9 = 4 (mod 9), S11 = 6 (mod 11), S13 = 0 (mod 13), S16 = 9 (mod 16)
(n / dj ) xj ≡ 1 (mod dj )なる xj 、つまり n / d の dj における乗法的逆元を 拡張ユークリッドの互除法 (extended Euclid's algorithm)により求め、
各剰余類と逆元の積和として、得ることが出来る。n 5 = 576576 (mod m / 5), n 7 = 205920 (mod m / 7), n 9 = 320320 (mod m / 9), n11 = 196560 (mod m / 11), n13 = 277200 (mod m / 13), n16 = 585585 (mod m / 16)
X = ( (S 5 n 5 ) (mod n) + (S 7 n 7 ) (mod n) + (S 9 n 9 ) (mod n) + (S11 n11 ) (mod n) + (S13 n13 ) (mod n) + (S16 n16 ) (mod n) ) (mod n)
= 297193 (mod n)
Karatsuba 法による乗算