Recursive Examples
Recursive Examples
Example 4.34
• Find the greatest common divisor of 250 and 111, and express the result
as a linear combination of these integers.
• gcd(250, 111) = 1
• The linear combination: (250x + 111y = 1)
1 = 28 – 1 x (111 – 3 x 28)
= 4 x 28 – 1 x 111
= 4 x (250 – 2 x 111) – 1 x 111
= 4 x 250 – 9 x 111
Example – Java program
• Please explain the java codes.
Example - Diophantine equation
We seek integers x, y ≥ 0,
where 6x + 10y = 104, or 3x + 5y = 52.
6 8 10 12 14
+1
Example: Section 4.1
Example: Sudoku