{"id":65476,"date":"2026-08-19T10:37:10","date_gmt":"2026-08-19T09:37:10","guid":{"rendered":"https:\/\/blog-admin.thethinkacademy.com\/?p=65476"},"modified":"2026-08-19T10:37:12","modified_gmt":"2026-08-19T09:37:12","slug":"euclidean-algorithm-guide","status":"publish","type":"post","link":"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/08\/19\/euclidean-algorithm-guide\/","title":{"rendered":"Euclidean Algorithm Explained: Definition, Steps and Applications"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The Euclidean algorithm is one of the oldest algorithms in mathematics \u2014 described by Euclid around 300 BCE \u2014 and one of the most useful. It finds the greatest common divisor (GCD) of two integers efficiently, using nothing more than repeated division with remainder. It is the foundation of a significant portion of computational number theory, appears in every major mathematics competition, and underlies the RSA cryptography system that secures most internet communication today.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide explains the Euclidean algorithm step by step, proves why it works, extends it to find integer solutions to linear equations, and shows where it appears in the curriculum and in competition mathematics.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">What Is the Euclidean Algorithm?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>Euclidean algorithm<\/strong> is a method for finding the <strong>greatest common divisor (GCD)<\/strong> of two positive integers \u2014 the largest integer that divides both without remainder.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The key insight:<\/strong> <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>b<\/mi><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>b<\/mi><mo separator=\"true\">,<\/mo><mi>r<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(a, b) = \\gcd(b, r)<\/annotation><\/semantics><\/math>gcd(a,b)=gcd(b,r) where <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>r<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">r<\/annotation><\/semantics><\/math>r is the remainder when <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">a<\/annotation><\/semantics><\/math>a is divided by <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>b<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">b<\/annotation><\/semantics><\/math>b.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This means you can replace the larger number with the smaller, and the smaller number with the remainder, repeating until the remainder is 0. The last non-zero remainder is the GCD.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">The Euclidean Algorithm: Step by Step<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Algorithm:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Given two positive integers <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><mo>&gt;<\/mo><mi>b<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">a &gt; b<\/annotation><\/semantics><\/math>a&gt;b:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Divide <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">a<\/annotation><\/semantics><\/math>a by <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>b<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">b<\/annotation><\/semantics><\/math>b: write <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><mo>=<\/mo><mi>q<\/mi><mo>\u22c5<\/mo><mi>b<\/mi><mo>+<\/mo><mi>r<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">a = q \\cdot b + r<\/annotation><\/semantics><\/math>a=q\u22c5b+r where <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>0<\/mn><mo>\u2264<\/mo><mi>r<\/mi><mo>&lt;<\/mo><mi>b<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">0 \\leq r &lt; b<\/annotation><\/semantics><\/math>0\u2264r&lt;b<\/li>\n\n\n\n<li>If <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>r<\/mi><mo>=<\/mo><mn>0<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">r = 0<\/annotation><\/semantics><\/math>r=0: the GCD is <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>b<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">b<\/annotation><\/semantics><\/math>b. Stop.<\/li>\n\n\n\n<li>If <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>r<\/mi><mo mathvariant=\"normal\">\u2260<\/mo><mn>0<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">r \\neq 0<\/annotation><\/semantics><\/math>r\ue020=0: replace <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>b<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">(a, b)<\/annotation><\/semantics><\/math>(a,b) with <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mo stretchy=\"false\">(<\/mo><mi>b<\/mi><mo separator=\"true\">,<\/mo><mi>r<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">(b, r)<\/annotation><\/semantics><\/math>(b,r) and go to Step 1.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Why it terminates:<\/strong> The remainders form a strictly decreasing sequence of non-negative integers \u2014 so the algorithm must reach 0 in a finite number of steps.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.thinkacademy.ca\/free-assessment?source_id=6721&amp;source_type=9&amp;utm_medium=website&amp;utm_source=pc_blog\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"409\" src=\"https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_29_39-AM-1-1024x409.png\" alt=\"\" class=\"wp-image-65478\" srcset=\"https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_29_39-AM-1-1024x409.png 1024w, https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_29_39-AM-1-300x120.png 300w, https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_29_39-AM-1-768x307.png 768w, https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_29_39-AM-1-1536x614.png 1536w, https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_29_39-AM-1-1300x520.png 1300w, https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_29_39-AM-1.png 1983w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Worked Examples<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Example 1 \u2014 Finding gcd(252, 105)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>252<\/mn><mo>=<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>105<\/mn><mo>+<\/mo><mn>42<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">252 = 2 \\times 105 + 42<\/annotation><\/semantics><\/math>252=2\u00d7105+42 <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>105<\/mn><mo>=<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>42<\/mn><mo>+<\/mo><mn>21<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">105 = 2 \\times 42 + 21<\/annotation><\/semantics><\/math>105=2\u00d742+21 <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>42<\/mn><mo>=<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>21<\/mn><mo>+<\/mo><mn>0<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">42 = 2 \\times 21 + 0<\/annotation><\/semantics><\/math>42=2\u00d721+0<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Remainder is 0. Last non-zero remainder: <strong>21<\/strong>.<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mn>252<\/mn><mo separator=\"true\">,<\/mo><mn>105<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>21<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(252, 105) = 21<\/annotation><\/semantics><\/math>gcd(252,105)=21<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Check:<\/strong> <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>252<\/mn><mo>=<\/mo><mn>21<\/mn><mo>\u00d7<\/mo><mn>12<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">252 = 21 \\times 12<\/annotation><\/semantics><\/math>252=21\u00d712 \u2713 and <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>105<\/mn><mo>=<\/mo><mn>21<\/mn><mo>\u00d7<\/mo><mn>5<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">105 = 21 \\times 5<\/annotation><\/semantics><\/math>105=21\u00d75 \u2713<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Example 2 \u2014 Finding gcd(1071, 462)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>1071<\/mn><mo>=<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>462<\/mn><mo>+<\/mo><mn>147<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">1071 = 2 \\times 462 + 147<\/annotation><\/semantics><\/math>1071=2\u00d7462+147 <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>462<\/mn><mo>=<\/mo><mn>3<\/mn><mo>\u00d7<\/mo><mn>147<\/mn><mo>+<\/mo><mn>21<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">462 = 3 \\times 147 + 21<\/annotation><\/semantics><\/math>462=3\u00d7147+21 <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>147<\/mn><mo>=<\/mo><mn>7<\/mn><mo>\u00d7<\/mo><mn>21<\/mn><mo>+<\/mo><mn>0<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">147 = 7 \\times 21 + 0<\/annotation><\/semantics><\/math>147=7\u00d721+0 <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mn>1071<\/mn><mo separator=\"true\">,<\/mo><mn>462<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>21<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(1071, 462) = 21<\/annotation><\/semantics><\/math>gcd(1071,462)=21<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Example 3 \u2014 Finding gcd(17, 13) (Consecutive-ish primes)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>17<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>13<\/mn><mo>+<\/mo><mn>4<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">17 = 1 \\times 13 + 4<\/annotation><\/semantics><\/math>17=1\u00d713+4 <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>13<\/mn><mo>=<\/mo><mn>3<\/mn><mo>\u00d7<\/mo><mn>4<\/mn><mo>+<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">13 = 3 \\times 4 + 1<\/annotation><\/semantics><\/math>13=3\u00d74+1 <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>4<\/mn><mo>=<\/mo><mn>4<\/mn><mo>\u00d7<\/mo><mn>1<\/mn><mo>+<\/mo><mn>0<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">4 = 4 \\times 1 + 0<\/annotation><\/semantics><\/math>4=4\u00d71+0 <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mn>17<\/mn><mo separator=\"true\">,<\/mo><mn>13<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(17, 13) = 1<\/annotation><\/semantics><\/math>gcd(17,13)=1<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When the GCD is 1, the two numbers are <strong>coprime<\/strong> (share no common factor other than 1). This is significant in number theory and cryptography.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Example 4 \u2014 Finding gcd(144, 89) (Fibonacci numbers!)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>144<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>89<\/mn><mo>+<\/mo><mn>55<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">144 = 1 \\times 89 + 55<\/annotation><\/semantics><\/math>144=1\u00d789+55 <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>89<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>55<\/mn><mo>+<\/mo><mn>34<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">89 = 1 \\times 55 + 34<\/annotation><\/semantics><\/math>89=1\u00d755+34 <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>55<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>34<\/mn><mo>+<\/mo><mn>21<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">55 = 1 \\times 34 + 21<\/annotation><\/semantics><\/math>55=1\u00d734+21 <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>34<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>21<\/mn><mo>+<\/mo><mn>13<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">34 = 1 \\times 21 + 13<\/annotation><\/semantics><\/math>34=1\u00d721+13 <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>21<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>13<\/mn><mo>+<\/mo><mn>8<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">21 = 1 \\times 13 + 8<\/annotation><\/semantics><\/math>21=1\u00d713+8 <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>13<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>8<\/mn><mo>+<\/mo><mn>5<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">13 = 1 \\times 8 + 5<\/annotation><\/semantics><\/math>13=1\u00d78+5 <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>8<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>5<\/mn><mo>+<\/mo><mn>3<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">8 = 1 \\times 5 + 3<\/annotation><\/semantics><\/math>8=1\u00d75+3 <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>5<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>3<\/mn><mo>+<\/mo><mn>2<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">5 = 1 \\times 3 + 2<\/annotation><\/semantics><\/math>5=1\u00d73+2 <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>3<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>2<\/mn><mo>+<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">3 = 1 \\times 2 + 1<\/annotation><\/semantics><\/math>3=1\u00d72+1 <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>2<\/mn><mo>=<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>1<\/mn><mo>+<\/mo><mn>0<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">2 = 2 \\times 1 + 0<\/annotation><\/semantics><\/math>2=2\u00d71+0 <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mn>144<\/mn><mo separator=\"true\">,<\/mo><mn>89<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(144, 89) = 1<\/annotation><\/semantics><\/math>gcd(144,89)=1<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>This is not a coincidence.<\/strong> 144 and 89 are consecutive Fibonacci numbers, and consecutive Fibonacci numbers are always coprime. The Euclidean algorithm applied to consecutive Fibonacci numbers produces the maximum possible number of steps \u2014 making Fibonacci pairs the &#8220;worst case&#8221; for the algorithm. This is a classical result in algorithm analysis.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Why the Euclidean Algorithm Works: The Proof<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Claim:<\/strong> <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>b<\/mi><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>b<\/mi><mo separator=\"true\">,<\/mo><mi>r<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(a, b) = \\gcd(b, r)<\/annotation><\/semantics><\/math>gcd(a,b)=gcd(b,r) where <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><mo>=<\/mo><mi>q<\/mi><mi>b<\/mi><mo>+<\/mo><mi>r<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">a = qb + r<\/annotation><\/semantics><\/math>a=qb+r.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Proof:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>d<\/mi><mo>=<\/mo><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>b<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">d = \\gcd(a, b)<\/annotation><\/semantics><\/math>d=gcd(a,b). We show <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>d<\/mi><mo>=<\/mo><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>b<\/mi><mo separator=\"true\">,<\/mo><mi>r<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">d = \\gcd(b, r)<\/annotation><\/semantics><\/math>d=gcd(b,r).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>d<\/mi><mo>\u2223<\/mo><mi>a<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">d \\mid a<\/annotation><\/semantics><\/math>d\u2223a and <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>d<\/mi><mo>\u2223<\/mo><mi>b<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">d \\mid b<\/annotation><\/semantics><\/math>d\u2223b: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>d<\/mi><mo>\u2223<\/mo><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo>\u2212<\/mo><mi>q<\/mi><mi>b<\/mi><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mi>r<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">d \\mid (a &#8211; qb) = r<\/annotation><\/semantics><\/math>d\u2223(a\u2212qb)=r. So <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>d<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">d<\/annotation><\/semantics><\/math>d is a common divisor of <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>b<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">b<\/annotation><\/semantics><\/math>b and <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>r<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">r<\/annotation><\/semantics><\/math>r.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now let <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>e<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">e<\/annotation><\/semantics><\/math>e be any common divisor of <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>b<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">b<\/annotation><\/semantics><\/math>b and <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>r<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">r<\/annotation><\/semantics><\/math>r. Then <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>e<\/mi><mo>\u2223<\/mo><mi>q<\/mi><mi>b<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">e \\mid qb<\/annotation><\/semantics><\/math>e\u2223qb and <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>e<\/mi><mo>\u2223<\/mo><mi>r<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">e \\mid r<\/annotation><\/semantics><\/math>e\u2223r, so <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>e<\/mi><mo>\u2223<\/mo><mo stretchy=\"false\">(<\/mo><mi>q<\/mi><mi>b<\/mi><mo>+<\/mo><mi>r<\/mi><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mi>a<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">e \\mid (qb + r) = a<\/annotation><\/semantics><\/math>e\u2223(qb+r)=a. Thus <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>e<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">e<\/annotation><\/semantics><\/math>e is a common divisor of <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">a<\/annotation><\/semantics><\/math>a and <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>b<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">b<\/annotation><\/semantics><\/math>b, so <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>e<\/mi><mo>\u2264<\/mo><mi>d<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">e \\leq d<\/annotation><\/semantics><\/math>e\u2264d.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Therefore <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>d<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">d<\/annotation><\/semantics><\/math>d is the greatest common divisor of <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>b<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">b<\/annotation><\/semantics><\/math>b and <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>r<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">r<\/annotation><\/semantics><\/math>r: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>b<\/mi><mo separator=\"true\">,<\/mo><mi>r<\/mi><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mi>d<\/mi><mo>=<\/mo><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>b<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(b, r) = d = \\gcd(a, b)<\/annotation><\/semantics><\/math>gcd(b,r)=d=gcd(a,b). \u25a1<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This proof is short, elegant, and uses only the definition of divisibility \u2014 a model of mathematical reasoning that competition students should know.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">The Euclidean Algorithm and the LCM<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The GCD and LCM (least common multiple) are related by:<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mtext>lcm<\/mtext><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>b<\/mi><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mfrac><mrow><mi>a<\/mi><mo>\u22c5<\/mo><mi>b<\/mi><\/mrow><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>b<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><\/mfrac><\/mrow><annotation encoding=\"application\/x-tex\">\\text{lcm}(a, b) = \\frac{a \\cdot b}{\\gcd(a, b)}<\/annotation><\/semantics><\/math>lcm(a,b)=gcd(a,b)a\u22c5b\u200b<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So once the GCD is found using the Euclidean algorithm, the LCM follows immediately.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:<\/strong> <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mtext>lcm<\/mtext><mo stretchy=\"false\">(<\/mo><mn>252<\/mn><mo separator=\"true\">,<\/mo><mn>105<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mfrac><mrow><mn>252<\/mn><mo>\u00d7<\/mo><mn>105<\/mn><\/mrow><mn>21<\/mn><\/mfrac><mo>=<\/mo><mfrac><mn>26460<\/mn><mn>21<\/mn><\/mfrac><mo>=<\/mo><mn>1260<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">\\text{lcm}(252, 105) = \\frac{252 \\times 105}{21} = \\frac{26460}{21} = 1260<\/annotation><\/semantics><\/math>lcm(252,105)=21252\u00d7105\u200b=2126460\u200b=1260.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">The Extended Euclidean Algorithm<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>extended Euclidean algorithm<\/strong> not only finds <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>b<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(a, b)<\/annotation><\/semantics><\/math>gcd(a,b) but also finds integers <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>x<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">x<\/annotation><\/semantics><\/math>x and <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>y<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">y<\/annotation><\/semantics><\/math>y such that:<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mi>a<\/mi><mi>x<\/mi><mo>+<\/mo><mi>b<\/mi><mi>y<\/mi><mo>=<\/mo><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>b<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">ax + by = \\gcd(a, b)<\/annotation><\/semantics><\/math>ax+by=gcd(a,b)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is called a <strong>B\u00e9zout identity<\/strong> (or <strong>B\u00e9zout&#8217;s lemma<\/strong>), and it states that the GCD of two integers can always be expressed as an integer linear combination of those integers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Method: Back-substitution<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Working backwards through the Euclidean algorithm steps, express each remainder as a linear combination of <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">a<\/annotation><\/semantics><\/math>a and <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>b<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">b<\/annotation><\/semantics><\/math>b.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:<\/strong> Find <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>x<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">x<\/annotation><\/semantics><\/math>x, <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>y<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">y<\/annotation><\/semantics><\/math>y such that <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>252<\/mn><mi>x<\/mi><mo>+<\/mo><mn>105<\/mn><mi>y<\/mi><mo>=<\/mo><mn>21<\/mn><mo>=<\/mo><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mn>252<\/mn><mo separator=\"true\">,<\/mo><mn>105<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">252x + 105y = 21 = \\gcd(252, 105)<\/annotation><\/semantics><\/math>252x+105y=21=gcd(252,105).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">From the Euclidean algorithm steps:<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>42<\/mn><mo>=<\/mo><mn>252<\/mn><mo>\u2212<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>105<\/mn><mspace width=\"1em\"><\/mspace><mo>\u22ef<\/mo><mo stretchy=\"false\">(<\/mo><mn>1<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">42 = 252 &#8211; 2 \\times 105 \\quad \\cdots (1)<\/annotation><\/semantics><\/math>42=252\u22122\u00d7105\u22ef(1) <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>21<\/mn><mo>=<\/mo><mn>105<\/mn><mo>\u2212<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>42<\/mn><mspace width=\"1em\"><\/mspace><mo>\u22ef<\/mo><mo stretchy=\"false\">(<\/mo><mn>2<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">21 = 105 &#8211; 2 \\times 42 \\quad \\cdots (2)<\/annotation><\/semantics><\/math>21=105\u22122\u00d742\u22ef(2)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Substitute (1) into (2):<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><semantics><mrow><mn>21<\/mn><mo>=<\/mo><mn>105<\/mn><mo>\u2212<\/mo><mn>2<\/mn><mo stretchy=\"false\">(<\/mo><mn>252<\/mn><mo>\u2212<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>105<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>105<\/mn><mo>\u2212<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>252<\/mn><mo>+<\/mo><mn>4<\/mn><mo>\u00d7<\/mo><mn>105<\/mn><mo>=<\/mo><mn>5<\/mn><mo>\u00d7<\/mo><mn>105<\/mn><mo>\u2212<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>252<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">21 = 105 &#8211; 2(252 &#8211; 2 \\times 105) = 105 &#8211; 2 \\times 252 + 4 \\times 105 = 5 \\times 105 &#8211; 2 \\times 252<\/annotation><\/semantics><\/math>21=105\u22122(252\u22122\u00d7105)=105\u22122\u00d7252+4\u00d7105=5\u00d7105\u22122\u00d7252<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>252<\/mn><mo>\u00d7<\/mo><mo stretchy=\"false\">(<\/mo><mo>\u2212<\/mo><mn>2<\/mn><mo stretchy=\"false\">)<\/mo><mo>+<\/mo><mn>105<\/mn><mo>\u00d7<\/mo><mn>5<\/mn><mo>=<\/mo><mn>21<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">252 \\times (-2) + 105 \\times 5 = 21<\/annotation><\/semantics><\/math>252\u00d7(\u22122)+105\u00d75=21.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>x=\u22122x = -2 x=\u22122, y=5y = 5 y=5.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Check:<\/strong> <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>252<\/mn><mo>\u00d7<\/mo><mo stretchy=\"false\">(<\/mo><mo>\u2212<\/mo><mn>2<\/mn><mo stretchy=\"false\">)<\/mo><mo>+<\/mo><mn>105<\/mn><mo>\u00d7<\/mo><mn>5<\/mn><mo>=<\/mo><mo>\u2212<\/mo><mn>504<\/mn><mo>+<\/mo><mn>525<\/mn><mo>=<\/mo><mn>21<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">252 \\times (-2) + 105 \\times 5 = -504 + 525 = 21<\/annotation><\/semantics><\/math>252\u00d7(\u22122)+105\u00d75=\u2212504+525=21 \u2713<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Applications of the Extended Euclidean Algorithm<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. Solving Linear Diophantine Equations<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A <strong>linear Diophantine equation<\/strong> is an equation of the form <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><mi>x<\/mi><mo>+<\/mo><mi>b<\/mi><mi>y<\/mi><mo>=<\/mo><mi>c<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">ax + by = c<\/annotation><\/semantics><\/math>ax+by=c where <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">a<\/annotation><\/semantics><\/math>a, <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>b<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">b<\/annotation><\/semantics><\/math>b, <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>c<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">c<\/annotation><\/semantics><\/math>c are integers and we seek integer solutions <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>x<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">x<\/annotation><\/semantics><\/math>x, <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>y<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">y<\/annotation><\/semantics><\/math>y.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Theorem (B\u00e9zout):<\/strong> <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><mi>x<\/mi><mo>+<\/mo><mi>b<\/mi><mi>y<\/mi><mo>=<\/mo><mi>c<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">ax + by = c<\/annotation><\/semantics><\/math>ax+by=c has integer solutions if and only if <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>b<\/mi><mo stretchy=\"false\">)<\/mo><mo>\u2223<\/mo><mi>c<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(a, b) \\mid c<\/annotation><\/semantics><\/math>gcd(a,b)\u2223c.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Method:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Find <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>b<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(a, b)<\/annotation><\/semantics><\/math>gcd(a,b) using the Euclidean algorithm.<\/li>\n\n\n\n<li>Check if <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>b<\/mi><mo stretchy=\"false\">)<\/mo><mo>\u2223<\/mo><mi>c<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(a, b) \\mid c<\/annotation><\/semantics><\/math>gcd(a,b)\u2223c. If not: no solution.<\/li>\n\n\n\n<li>Use back-substitution to find a particular solution <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mo stretchy=\"false\">(<\/mo><msub><mi>x<\/mi><mn>0<\/mn><\/msub><mo separator=\"true\">,<\/mo><msub><mi>y<\/mi><mn>0<\/mn><\/msub><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">(x_0, y_0)<\/annotation><\/semantics><\/math>(x0\u200b,y0\u200b) to <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><mi>x<\/mi><mo>+<\/mo><mi>b<\/mi><mi>y<\/mi><mo>=<\/mo><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>b<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">ax + by = \\gcd(a,b)<\/annotation><\/semantics><\/math>ax+by=gcd(a,b).<\/li>\n\n\n\n<li>Scale: multiply by <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>c<\/mi><mi mathvariant=\"normal\">\/<\/mi><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>b<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">c \/ \\gcd(a,b)<\/annotation><\/semantics><\/math>c\/gcd(a,b) to get a solution to <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><mi>x<\/mi><mo>+<\/mo><mi>b<\/mi><mi>y<\/mi><mo>=<\/mo><mi>c<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">ax + by = c<\/annotation><\/semantics><\/math>ax+by=c.<\/li>\n\n\n\n<li>The general solution is: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>x<\/mi><mo>=<\/mo><msub><mi>x<\/mi><mn>0<\/mn><\/msub><mo>\u22c5<\/mo><mfrac><mi>c<\/mi><mi>d<\/mi><\/mfrac><mo>+<\/mo><mfrac><mi>b<\/mi><mi>d<\/mi><\/mfrac><mi>t<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">x = x_0 \\cdot \\frac{c}{d} + \\frac{b}{d}t<\/annotation><\/semantics><\/math>x=x0\u200b\u22c5dc\u200b+db\u200bt, <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>y<\/mi><mo>=<\/mo><msub><mi>y<\/mi><mn>0<\/mn><\/msub><mo>\u22c5<\/mo><mfrac><mi>c<\/mi><mi>d<\/mi><\/mfrac><mo>\u2212<\/mo><mfrac><mi>a<\/mi><mi>d<\/mi><\/mfrac><mi>t<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">y = y_0 \\cdot \\frac{c}{d} &#8211; \\frac{a}{d}t<\/annotation><\/semantics><\/math>y=y0\u200b\u22c5dc\u200b\u2212da\u200bt for any integer <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>t<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">t<\/annotation><\/semantics><\/math>t, where <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>d<\/mi><mo>=<\/mo><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>b<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">d = \\gcd(a,b)<\/annotation><\/semantics><\/math>d=gcd(a,b).<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:<\/strong> Solve <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>252<\/mn><mi>x<\/mi><mo>+<\/mo><mn>105<\/mn><mi>y<\/mi><mo>=<\/mo><mn>63<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">252x + 105y = 63<\/annotation><\/semantics><\/math>252x+105y=63.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mn>252<\/mn><mo separator=\"true\">,<\/mo><mn>105<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>21<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(252, 105) = 21<\/annotation><\/semantics><\/math>gcd(252,105)=21 and <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>21<\/mn><mo>\u2223<\/mo><mn>63<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">21 \\mid 63<\/annotation><\/semantics><\/math>21\u222363 \u2713.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">From above: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>252<\/mn><mo stretchy=\"false\">(<\/mo><mo>\u2212<\/mo><mn>2<\/mn><mo stretchy=\"false\">)<\/mo><mo>+<\/mo><mn>105<\/mn><mo stretchy=\"false\">(<\/mo><mn>5<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>21<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">252(-2) + 105(5) = 21<\/annotation><\/semantics><\/math>252(\u22122)+105(5)=21. Multiply by <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>63<\/mn><mi mathvariant=\"normal\">\/<\/mi><mn>21<\/mn><mo>=<\/mo><mn>3<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">63\/21 = 3<\/annotation><\/semantics><\/math>63\/21=3:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>252<\/mn><mo stretchy=\"false\">(<\/mo><mo>\u2212<\/mo><mn>6<\/mn><mo stretchy=\"false\">)<\/mo><mo>+<\/mo><mn>105<\/mn><mo stretchy=\"false\">(<\/mo><mn>15<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>63<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">252(-6) + 105(15) = 63<\/annotation><\/semantics><\/math>252(\u22126)+105(15)=63.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Particular solution: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mo stretchy=\"false\">(<\/mo><msub><mi>x<\/mi><mn>0<\/mn><\/msub><mo separator=\"true\">,<\/mo><msub><mi>y<\/mi><mn>0<\/mn><\/msub><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mo stretchy=\"false\">(<\/mo><mo>\u2212<\/mo><mn>6<\/mn><mo separator=\"true\">,<\/mo><mn>15<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">(x_0, y_0) = (-6, 15)<\/annotation><\/semantics><\/math>(x0\u200b,y0\u200b)=(\u22126,15).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">General solution: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>x<\/mi><mo>=<\/mo><mo>\u2212<\/mo><mn>6<\/mn><mo>+<\/mo><mn>5<\/mn><mi>t<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">x = -6 + 5t<\/annotation><\/semantics><\/math>x=\u22126+5t, <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>y<\/mi><mo>=<\/mo><mn>15<\/mn><mo>\u2212<\/mo><mn>12<\/mn><mi>t<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">y = 15 &#8211; 12t<\/annotation><\/semantics><\/math>y=15\u221212t for any integer <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>t<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">t<\/annotation><\/semantics><\/math>t.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Check with t=1t=1 t=1:<\/strong> <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>252<\/mn><mo stretchy=\"false\">(<\/mo><mo>\u2212<\/mo><mn>1<\/mn><mo stretchy=\"false\">)<\/mo><mo>+<\/mo><mn>105<\/mn><mo stretchy=\"false\">(<\/mo><mn>3<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mo>\u2212<\/mo><mn>252<\/mn><mo>+<\/mo><mn>315<\/mn><mo>=<\/mo><mn>63<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">252(-1) + 105(3) = -252 + 315 = 63<\/annotation><\/semantics><\/math>252(\u22121)+105(3)=\u2212252+315=63 \u2713<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Modular Inverses<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>m<\/mi><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(a, m) = 1<\/annotation><\/semantics><\/math>gcd(a,m)=1, the extended Euclidean algorithm finds the <strong>modular inverse<\/strong> of <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">a<\/annotation><\/semantics><\/math>a modulo <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>m<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">m<\/annotation><\/semantics><\/math>m \u2014 the integer <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>x<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">x<\/annotation><\/semantics><\/math>x such that <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><mi>x<\/mi><mo>\u2261<\/mo><mn>1<\/mn><mspace><\/mspace><mspace width=\"0.4444em\"><\/mspace><mo stretchy=\"false\">(<\/mo><mrow><mi mathvariant=\"normal\">m<\/mi><mi mathvariant=\"normal\">o<\/mi><mi mathvariant=\"normal\">d<\/mi><\/mrow><mspace width=\"0.3333em\"><\/mspace><mi>m<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">ax \\equiv 1 \\pmod{m}<\/annotation><\/semantics><\/math>ax\u22611(modm).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">From <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><mi>x<\/mi><mo>+<\/mo><mi>m<\/mi><mi>y<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">ax + my = 1<\/annotation><\/semantics><\/math>ax+my=1 (B\u00e9zout, since <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>m<\/mi><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(a,m) = 1<\/annotation><\/semantics><\/math>gcd(a,m)=1): <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><mi>x<\/mi><mo>\u2261<\/mo><mn>1<\/mn><mspace><\/mspace><mspace width=\"0.4444em\"><\/mspace><mo stretchy=\"false\">(<\/mo><mrow><mi mathvariant=\"normal\">m<\/mi><mi mathvariant=\"normal\">o<\/mi><mi mathvariant=\"normal\">d<\/mi><\/mrow><mspace width=\"0.3333em\"><\/mspace><mi>m<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">ax \\equiv 1 \\pmod{m}<\/annotation><\/semantics><\/math>ax\u22611(modm).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is foundational to RSA cryptography and appears in competition number theory problems.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:<\/strong> Find the inverse of 7 modulo 11.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mn>7<\/mn><mo separator=\"true\">,<\/mo><mn>11<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(7, 11) = 1<\/annotation><\/semantics><\/math>gcd(7,11)=1. Apply extended Euclidean algorithm:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>11<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>7<\/mn><mo>+<\/mo><mn>4<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">11 = 1 \\times 7 + 4<\/annotation><\/semantics><\/math>11=1\u00d77+4 <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>7<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>4<\/mn><mo>+<\/mo><mn>3<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">7 = 1 \\times 4 + 3<\/annotation><\/semantics><\/math>7=1\u00d74+3 <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>4<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>3<\/mn><mo>+<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">4 = 1 \\times 3 + 1<\/annotation><\/semantics><\/math>4=1\u00d73+1 <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>3<\/mn><mo>=<\/mo><mn>3<\/mn><mo>\u00d7<\/mo><mn>1<\/mn><mo>+<\/mo><mn>0<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">3 = 3 \\times 1 + 0<\/annotation><\/semantics><\/math>3=3\u00d71+0<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Back-substitution: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>1<\/mn><mo>=<\/mo><mn>4<\/mn><mo>\u2212<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>3<\/mn><mo>=<\/mo><mn>4<\/mn><mo>\u2212<\/mo><mo stretchy=\"false\">(<\/mo><mn>7<\/mn><mo>\u2212<\/mo><mn>4<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>4<\/mn><mo>\u2212<\/mo><mn>7<\/mn><mo>=<\/mo><mn>2<\/mn><mo stretchy=\"false\">(<\/mo><mn>11<\/mn><mo>\u2212<\/mo><mn>7<\/mn><mo stretchy=\"false\">)<\/mo><mo>\u2212<\/mo><mn>7<\/mn><mo>=<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>11<\/mn><mo>\u2212<\/mo><mn>3<\/mn><mo>\u00d7<\/mo><mn>7<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">1 = 4 &#8211; 1 \\times 3 = 4 &#8211; (7 &#8211; 4) = 2 \\times 4 &#8211; 7 = 2(11 &#8211; 7) &#8211; 7 = 2 \\times 11 &#8211; 3 \\times 7<\/annotation><\/semantics><\/math>1=4\u22121\u00d73=4\u2212(7\u22124)=2\u00d74\u22127=2(11\u22127)\u22127=2\u00d711\u22123\u00d77<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>7<\/mn><mo>\u00d7<\/mo><mo stretchy=\"false\">(<\/mo><mo>\u2212<\/mo><mn>3<\/mn><mo stretchy=\"false\">)<\/mo><mo>+<\/mo><mn>11<\/mn><mo>\u00d7<\/mo><mn>2<\/mn><mo>=<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">7 \\times (-3) + 11 \\times 2 = 1<\/annotation><\/semantics><\/math>7\u00d7(\u22123)+11\u00d72=1, meaning <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>7<\/mn><mo>\u00d7<\/mo><mo stretchy=\"false\">(<\/mo><mo>\u2212<\/mo><mn>3<\/mn><mo stretchy=\"false\">)<\/mo><mo>\u2261<\/mo><mn>1<\/mn><mspace><\/mspace><mspace width=\"0.4444em\"><\/mspace><mo stretchy=\"false\">(<\/mo><mrow><mi mathvariant=\"normal\">m<\/mi><mi mathvariant=\"normal\">o<\/mi><mi mathvariant=\"normal\">d<\/mi><\/mrow><mspace width=\"0.3333em\"><\/mspace><mn>11<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">7 \\times (-3) \\equiv 1 \\pmod{11}<\/annotation><\/semantics><\/math>7\u00d7(\u22123)\u22611(mod11).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mo>\u2212<\/mo><mn>3<\/mn><mo>\u2261<\/mo><mn>8<\/mn><mspace><\/mspace><mspace width=\"0.4444em\"><\/mspace><mo stretchy=\"false\">(<\/mo><mrow><mi mathvariant=\"normal\">m<\/mi><mi mathvariant=\"normal\">o<\/mi><mi mathvariant=\"normal\">d<\/mi><\/mrow><mspace width=\"0.3333em\"><\/mspace><mn>11<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">-3 \\equiv 8 \\pmod{11}<\/annotation><\/semantics><\/math>\u22123\u22618(mod11).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Modular inverse of 7 mod 11 is 8.<\/strong> Check: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>7<\/mn><mo>\u00d7<\/mo><mn>8<\/mn><mo>=<\/mo><mn>56<\/mn><mo>=<\/mo><mn>5<\/mn><mo>\u00d7<\/mo><mn>11<\/mn><mo>+<\/mo><mn>1<\/mn><mo>\u2261<\/mo><mn>1<\/mn><mspace><\/mspace><mspace width=\"0.4444em\"><\/mspace><mo stretchy=\"false\">(<\/mo><mrow><mi mathvariant=\"normal\">m<\/mi><mi mathvariant=\"normal\">o<\/mi><mi mathvariant=\"normal\">d<\/mi><\/mrow><mspace width=\"0.3333em\"><\/mspace><mn>11<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">7 \\times 8 = 56 = 5 \\times 11 + 1 \\equiv 1 \\pmod{11}<\/annotation><\/semantics><\/math>7\u00d78=56=5\u00d711+1\u22611(mod11) \u2713<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">The Euclidean Algorithm in the Ontario Curriculum<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Euclidean algorithm is not part of the standard Ontario K\u201312 curriculum, but GCD and LCM are:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Grade 8 (Ontario):<\/strong> Students find the GCD and LCM of pairs of numbers using factor lists or prime factorisation. The Euclidean algorithm provides a faster method for large numbers and is worth knowing as a supplement to the curriculum approach. See our <a href=\"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/06\/05\/grade-8-math-curriculum-ontario\/\">Grade 8 math curriculum Ontario guide<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Grade 9 MTH1W (Ontario):<\/strong> Number theory concepts including GCD appear in the curriculum. See our <a href=\"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/05\/15\/grade-9-math-curriculum-parent-guide\/\">Ontario Grade 9 math curriculum guide<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Math 30-1 (Alberta):<\/strong> Divisibility and integer properties underpin the polynomial content. See our <a href=\"https:\/\/blog-admin.thethinkacademy.com\/blog\/math-30-1-alberta-guide\/\">Math 30-1 complete guide<\/a>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Where the Euclidean Algorithm Appears in Competitions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">AMC 8 and Gauss Contest (Grades 7\u20138)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">GCD and LCM problems appear regularly in both contests \u2014 typically using factor lists or prime factorisation rather than the Euclidean algorithm directly. Knowing the algorithm gives a faster method for large numbers. See our <a href=\"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/04\/15\/amc-8-math-competition-guide-for-parents\/\">AMC 8 guide<\/a> and <a href=\"https:\/\/www.thinkacademy.ca\/blog\/blog\/2026\/05\/05\/gauss-math-contest-complete-guide-canada\/\">Gauss math contest guide<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">AMC 10 and Cayley\/Fermat Contests (Grades 9\u201311)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Number theory problems at this level include GCD and coprimality. The extended Euclidean algorithm enables solving linear Diophantine equations that appear as multi-step problems. Recognising when a problem reduces to <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><mi>x<\/mi><mo>+<\/mo><mi>b<\/mi><mi>y<\/mi><mo>=<\/mo><mi>c<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">ax + by = c<\/annotation><\/semantics><\/math>ax+by=c and applying B\u00e9zout&#8217;s lemma is a standard technique.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Euclid Contest (CEMC, Grade 12)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The Euclidean algorithm and its extensions appear in Euclid Part B and Part C number theory problems. Modular inverses (found via the extended algorithm) underpin certain problems involving fractions modulo a prime. See our <a href=\"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/05\/18\/euclid-math-contest-preparation-guide-canada\/\">Euclid math contest guide<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">COMC and CMO<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Linear Diophantine equations, B\u00e9zout&#8217;s identity, and modular inverses \u2014 all rooted in the extended Euclidean algorithm \u2014 are standard tools in COMC Part C and CMO number theory. See our <a href=\"https:\/\/blog-admin.thethinkacademy.com\/blog\/comc-math-contest-guide\/\">COMC math contest guide<\/a> and <a href=\"https:\/\/blog-admin.thethinkacademy.com\/blog\/canadian-mathematical-olympiad-guide\/\">Canadian Mathematical Olympiad guide<\/a>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.thinkacademy.ca\/free-assessment?source_id=6721&amp;source_type=9&amp;utm_medium=website&amp;utm_source=pc_blog\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"409\" src=\"https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_31_16-AM-1-1024x409.png\" alt=\"\" class=\"wp-image-65479\" srcset=\"https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_31_16-AM-1-1024x409.png 1024w, https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_31_16-AM-1-300x120.png 300w, https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_31_16-AM-1-768x307.png 768w, https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_31_16-AM-1-1536x614.png 1536w, https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_31_16-AM-1-1300x520.png 1300w, https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_31_16-AM-1.png 1983w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Common Mistakes with the Euclidean Algorithm<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Mistake 1: Using the wrong pair after each step.<\/strong>After computing <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><mo>=<\/mo><mi>q<\/mi><mi>b<\/mi><mo>+<\/mo><mi>r<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">a = qb + r<\/annotation><\/semantics><\/math>a=qb+r, the next step uses <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mo stretchy=\"false\">(<\/mo><mi>b<\/mi><mo separator=\"true\">,<\/mo><mi>r<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">(b, r)<\/annotation><\/semantics><\/math>(b,r) \u2014 not <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>r<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">(a, r)<\/annotation><\/semantics><\/math>(a,r) or <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mo stretchy=\"false\">(<\/mo><mi>q<\/mi><mo separator=\"true\">,<\/mo><mi>r<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">(q, r)<\/annotation><\/semantics><\/math>(q,r). The larger number is replaced by the smaller, and the smaller by the remainder.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Mistake 2: Stopping too early.<\/strong> The algorithm stops when the remainder is 0, and the GCD is the previous (non-zero) remainder \u2014 not the quotient of the final step.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Mistake 3: Back-substitution direction errors in the extended algorithm.<\/strong> In back-substitution, it is easy to substitute in the wrong direction or to make a sign error. Write each remainder explicitly as a linear combination at every step, checking the arithmetic before proceeding.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Mistake 4: Assuming ax+by=cax + by = c ax+by=c always has solutions.<\/strong>It has solutions if and only if <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>b<\/mi><mo stretchy=\"false\">)<\/mo><mo>\u2223<\/mo><mi>c<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(a, b) \\mid c<\/annotation><\/semantics><\/math>gcd(a,b)\u2223c. If <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>b<\/mi><mo stretchy=\"false\">)<\/mo><mo>\u2224<\/mo><mi>c<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(a, b) \\nmid c<\/annotation><\/semantics><\/math>gcd(a,b)\u2224c, no integer solution exists. Check divisibility before attempting to solve.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Mistake 5: Giving only one solution to a Diophantine equation.<\/strong>Linear Diophantine equations with solutions have infinitely many. The general solution involves a parameter <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>t<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">t<\/annotation><\/semantics><\/math>t. Competition problems sometimes ask for specific solution types (positive integers, smallest positive solution) \u2014 find the general solution first, then filter.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Practice Problems<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Set A \u2014 Euclidean algorithm<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Find each GCD using the Euclidean algorithm (show all steps):<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mn>48<\/mn><mo separator=\"true\">,<\/mo><mn>18<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(48, 18)<\/annotation><\/semantics><\/math>gcd(48,18)<\/li>\n\n\n\n<li><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mn>210<\/mn><mo separator=\"true\">,<\/mo><mn>45<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(210, 45)<\/annotation><\/semantics><\/math>gcd(210,45)<\/li>\n\n\n\n<li><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mn>1000<\/mn><mo separator=\"true\">,<\/mo><mn>256<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(1000, 256)<\/annotation><\/semantics><\/math>gcd(1000,256)<\/li>\n\n\n\n<li><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mn>144<\/mn><mo separator=\"true\">,<\/mo><mn>55<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(144, 55)<\/annotation><\/semantics><\/math>gcd(144,55)<\/li>\n\n\n\n<li><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mn>999<\/mn><mo separator=\"true\">,<\/mo><mn>111<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(999, 111)<\/annotation><\/semantics><\/math>gcd(999,111)<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Set B \u2014 LCM<\/strong><\/p>\n\n\n\n<ol start=\"6\" class=\"wp-block-list\">\n<li>Find <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mtext>lcm<\/mtext><mo stretchy=\"false\">(<\/mo><mn>48<\/mn><mo separator=\"true\">,<\/mo><mn>18<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">\\text{lcm}(48, 18)<\/annotation><\/semantics><\/math>lcm(48,18)<\/li>\n\n\n\n<li>Find <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mtext>lcm<\/mtext><mo stretchy=\"false\">(<\/mo><mn>210<\/mn><mo separator=\"true\">,<\/mo><mn>45<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">\\text{lcm}(210, 45)<\/annotation><\/semantics><\/math>lcm(210,45)<\/li>\n\n\n\n<li>The GCD of two numbers is 12 and their LCM is 360. One number is 36. Find the other.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Set C \u2014 Extended algorithm and Diophantine equations<\/strong><\/p>\n\n\n\n<ol start=\"9\" class=\"wp-block-list\">\n<li>Find integers <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>x<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">x<\/annotation><\/semantics><\/math>x, <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>y<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">y<\/annotation><\/semantics><\/math>y such that <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>48<\/mn><mi>x<\/mi><mo>+<\/mo><mn>18<\/mn><mi>y<\/mi><mo>=<\/mo><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mn>48<\/mn><mo separator=\"true\">,<\/mo><mn>18<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">48x + 18y = \\gcd(48, 18)<\/annotation><\/semantics><\/math>48x+18y=gcd(48,18).<\/li>\n\n\n\n<li>Does <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>210<\/mn><mi>x<\/mi><mo>+<\/mo><mn>45<\/mn><mi>y<\/mi><mo>=<\/mo><mn>15<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">210x + 45y = 15<\/annotation><\/semantics><\/math>210x+45y=15 have integer solutions? If so, find the general solution.<\/li>\n\n\n\n<li>Find the modular inverse of 5 modulo 13.<\/li>\n\n\n\n<li>Find all positive integer solutions to <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>17<\/mn><mi>x<\/mi><mo>+<\/mo><mn>11<\/mn><mi>y<\/mi><mo>=<\/mo><mn>100<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">17x + 11y = 100<\/annotation><\/semantics><\/math>17x+11y=100.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Answers:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Set A:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>48<\/mn><mo>=<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>18<\/mn><mo>+<\/mo><mn>12<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">48 = 2\\times18+12<\/annotation><\/semantics><\/math>48=2\u00d718+12; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>18<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>12<\/mn><mo>+<\/mo><mn>6<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">18=1\\times12+6<\/annotation><\/semantics><\/math>18=1\u00d712+6; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>12<\/mn><mo>=<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>6<\/mn><mo>+<\/mo><mn>0<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">12=2\\times6+0<\/annotation><\/semantics><\/math>12=2\u00d76+0. <strong>gcd\u2061(48,18)=6\\gcd(48,18) = 6 gcd(48,18)=6<\/strong><\/li>\n\n\n\n<li><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>210<\/mn><mo>=<\/mo><mn>4<\/mn><mo>\u00d7<\/mo><mn>45<\/mn><mo>+<\/mo><mn>30<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">210=4\\times45+30<\/annotation><\/semantics><\/math>210=4\u00d745+30; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>45<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>30<\/mn><mo>+<\/mo><mn>15<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">45=1\\times30+15<\/annotation><\/semantics><\/math>45=1\u00d730+15; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>30<\/mn><mo>=<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>15<\/mn><mo>+<\/mo><mn>0<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">30=2\\times15+0<\/annotation><\/semantics><\/math>30=2\u00d715+0. <strong>gcd\u2061(210,45)=15\\gcd(210,45) = 15 gcd(210,45)=15<\/strong><\/li>\n\n\n\n<li><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>1000<\/mn><mo>=<\/mo><mn>3<\/mn><mo>\u00d7<\/mo><mn>256<\/mn><mo>+<\/mo><mn>232<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">1000=3\\times256+232<\/annotation><\/semantics><\/math>1000=3\u00d7256+232; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>256<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>232<\/mn><mo>+<\/mo><mn>24<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">256=1\\times232+24<\/annotation><\/semantics><\/math>256=1\u00d7232+24; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>232<\/mn><mo>=<\/mo><mn>9<\/mn><mo>\u00d7<\/mo><mn>24<\/mn><mo>+<\/mo><mn>16<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">232=9\\times24+16<\/annotation><\/semantics><\/math>232=9\u00d724+16; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>24<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>16<\/mn><mo>+<\/mo><mn>8<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">24=1\\times16+8<\/annotation><\/semantics><\/math>24=1\u00d716+8; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>16<\/mn><mo>=<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>8<\/mn><mo>+<\/mo><mn>0<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">16=2\\times8+0<\/annotation><\/semantics><\/math>16=2\u00d78+0. <strong>gcd\u2061(1000,256)=8\\gcd(1000,256) = 8 gcd(1000,256)=8<\/strong><\/li>\n\n\n\n<li><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>144<\/mn><mo>=<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>55<\/mn><mo>+<\/mo><mn>34<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">144=2\\times55+34<\/annotation><\/semantics><\/math>144=2\u00d755+34; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>55<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>34<\/mn><mo>+<\/mo><mn>21<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">55=1\\times34+21<\/annotation><\/semantics><\/math>55=1\u00d734+21; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>34<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>21<\/mn><mo>+<\/mo><mn>13<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">34=1\\times21+13<\/annotation><\/semantics><\/math>34=1\u00d721+13; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>21<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>13<\/mn><mo>+<\/mo><mn>8<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">21=1\\times13+8<\/annotation><\/semantics><\/math>21=1\u00d713+8; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>13<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>8<\/mn><mo>+<\/mo><mn>5<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">13=1\\times8+5<\/annotation><\/semantics><\/math>13=1\u00d78+5; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>8<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>5<\/mn><mo>+<\/mo><mn>3<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">8=1\\times5+3<\/annotation><\/semantics><\/math>8=1\u00d75+3; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>5<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>3<\/mn><mo>+<\/mo><mn>2<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">5=1\\times3+2<\/annotation><\/semantics><\/math>5=1\u00d73+2; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>3<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>2<\/mn><mo>+<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">3=1\\times2+1<\/annotation><\/semantics><\/math>3=1\u00d72+1; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>2<\/mn><mo>=<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>1<\/mn><mo>+<\/mo><mn>0<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">2=2\\times1+0<\/annotation><\/semantics><\/math>2=2\u00d71+0. <strong>gcd\u2061(144,55)=1\\gcd(144,55) = 1 gcd(144,55)=1<\/strong> (consecutive Fibonacci-adjacent numbers)<\/li>\n\n\n\n<li><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>999<\/mn><mo>=<\/mo><mn>9<\/mn><mo>\u00d7<\/mo><mn>111<\/mn><mo>+<\/mo><mn>0<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">999=9\\times111+0<\/annotation><\/semantics><\/math>999=9\u00d7111+0. <strong>gcd\u2061(999,111)=111\\gcd(999,111) = 111 gcd(999,111)=111<\/strong><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Set B: 6. $\\text{lcm}(48,18) = 48\\times18\/6 = 864\/6 = $ <strong>144<\/strong> 7. $\\text{lcm}(210,45) = 210\\times45\/15 = 9450\/15 = $ <strong>630<\/strong>8. <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><mo>\u00d7<\/mo><mi>b<\/mi><mo>=<\/mo><mi>gcd<\/mi><mo>\u2061<\/mo><mo>\u00d7<\/mo><mtext>lcm<\/mtext><\/mrow><annotation encoding=\"application\/x-tex\">a \\times b = \\gcd \\times \\text{lcm}<\/annotation><\/semantics><\/math>a\u00d7b=gcd\u00d7lcm: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>36<\/mn><mo>\u00d7<\/mo><mi>b<\/mi><mo>=<\/mo><mn>12<\/mn><mo>\u00d7<\/mo><mn>360<\/mn><mo>=<\/mo><mn>4320<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">36 \\times b = 12 \\times 360 = 4320<\/annotation><\/semantics><\/math>36\u00d7b=12\u00d7360=4320; $b = $ <strong>120<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Set C: 9. From steps: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>6<\/mn><mo>=<\/mo><mn>18<\/mn><mo>\u2212<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>12<\/mn><mo>=<\/mo><mn>18<\/mn><mo>\u2212<\/mo><mo stretchy=\"false\">(<\/mo><mn>48<\/mn><mo>\u2212<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>18<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>3<\/mn><mo>\u00d7<\/mo><mn>18<\/mn><mo>\u2212<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>48<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">6 = 18-1\\times12 = 18-(48-2\\times18) = 3\\times18-1\\times48<\/annotation><\/semantics><\/math>6=18\u22121\u00d712=18\u2212(48\u22122\u00d718)=3\u00d718\u22121\u00d748. So <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>48<\/mn><mo>\u00d7<\/mo><mo stretchy=\"false\">(<\/mo><mo>\u2212<\/mo><mn>1<\/mn><mo stretchy=\"false\">)<\/mo><mo>+<\/mo><mn>18<\/mn><mo>\u00d7<\/mo><mn>3<\/mn><mo>=<\/mo><mn>6<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">48\\times(-1)+18\\times3=6<\/annotation><\/semantics><\/math>48\u00d7(\u22121)+18\u00d73=6. <strong>x=\u22121,y=3x=-1, y=3 x=\u22121,y=3<\/strong>10. <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mn>210<\/mn><mo separator=\"true\">,<\/mo><mn>45<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>15<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(210,45)=15<\/annotation><\/semantics><\/math>gcd(210,45)=15 and <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>15<\/mn><mo>\u2223<\/mo><mn>15<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">15\\mid15<\/annotation><\/semantics><\/math>15\u222315 \u2713. From above: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>210<\/mn><mo>\u00d7<\/mo><mo stretchy=\"false\">(<\/mo><mo>\u2212<\/mo><mn>1<\/mn><mo stretchy=\"false\">)<\/mo><mo>+<\/mo><mn>45<\/mn><mo>\u00d7<\/mo><mo stretchy=\"false\">(<\/mo><mo stretchy=\"false\">?<\/mo><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">210\\times(-1)+45\\times(?)<\/annotation><\/semantics><\/math>210\u00d7(\u22121)+45\u00d7(?)&#8230; find particular solution then general. <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>210<\/mn><mo>\u00d7<\/mo><mo stretchy=\"false\">(<\/mo><mo>\u2212<\/mo><mn>2<\/mn><mo stretchy=\"false\">)<\/mo><mo>+<\/mo><mn>45<\/mn><mo>\u00d7<\/mo><mo stretchy=\"false\">(<\/mo><mn>9<\/mn><mo>+<\/mo><mo stretchy=\"false\">?<\/mo><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">210\\times(-2)+45\\times(9+?)<\/annotation><\/semantics><\/math>210\u00d7(\u22122)+45\u00d7(9+?)&#8230; Actually: divide through: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>14<\/mn><mi>x<\/mi><mo>+<\/mo><mn>3<\/mn><mi>y<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">14x+3y=1<\/annotation><\/semantics><\/math>14x+3y=1. Back-sub: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mn>14<\/mn><mo separator=\"true\">,<\/mo><mn>3<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(14,3)=1<\/annotation><\/semantics><\/math>gcd(14,3)=1; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>14<\/mn><mo>=<\/mo><mn>4<\/mn><mo>\u00d7<\/mo><mn>3<\/mn><mo>+<\/mo><mn>2<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">14=4\\times3+2<\/annotation><\/semantics><\/math>14=4\u00d73+2; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>3<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>2<\/mn><mo>+<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">3=1\\times2+1<\/annotation><\/semantics><\/math>3=1\u00d72+1; so <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>1<\/mn><mo>=<\/mo><mn>3<\/mn><mo>\u2212<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>2<\/mn><mo>=<\/mo><mn>3<\/mn><mo>\u2212<\/mo><mo stretchy=\"false\">(<\/mo><mn>14<\/mn><mo>\u2212<\/mo><mn>4<\/mn><mo>\u00d7<\/mo><mn>3<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>5<\/mn><mo>\u00d7<\/mo><mn>3<\/mn><mo>\u2212<\/mo><mn>14<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">1=3-1\\times2=3-(14-4\\times3)=5\\times3-14<\/annotation><\/semantics><\/math>1=3\u22121\u00d72=3\u2212(14\u22124\u00d73)=5\u00d73\u221214. So <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>14<\/mn><mo>\u00d7<\/mo><mo stretchy=\"false\">(<\/mo><mo>\u2212<\/mo><mn>1<\/mn><mo stretchy=\"false\">)<\/mo><mo>+<\/mo><mn>3<\/mn><mo>\u00d7<\/mo><mn>5<\/mn><mo>=<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">14\\times(-1)+3\\times5=1<\/annotation><\/semantics><\/math>14\u00d7(\u22121)+3\u00d75=1. Scale by 15: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>14<\/mn><mo>\u00d7<\/mo><mo stretchy=\"false\">(<\/mo><mo>\u2212<\/mo><mn>15<\/mn><mo stretchy=\"false\">)<\/mo><mo>+<\/mo><mn>3<\/mn><mo>\u00d7<\/mo><mn>75<\/mn><mo>=<\/mo><mn>15<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">14\\times(-15)+3\\times75=15<\/annotation><\/semantics><\/math>14\u00d7(\u221215)+3\u00d775=15, i.e. <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>210<\/mn><mo>\u00d7<\/mo><mo stretchy=\"false\">(<\/mo><mo>\u2212<\/mo><mn>1<\/mn><mo stretchy=\"false\">)<\/mo><mo>+<\/mo><mn>45<\/mn><mo>\u00d7<\/mo><mn>5<\/mn><mo>=<\/mo><mn>15<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">210\\times(-1)+45\\times5=15<\/annotation><\/semantics><\/math>210\u00d7(\u22121)+45\u00d75=15&#8230; <strong>General solution: x=\u22121+3tx=-1+3t x=\u22121+3t, y=5\u221214ty=5-14t y=5\u221214t<\/strong> for any integer <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>t<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">t<\/annotation><\/semantics><\/math>t.<\/p>\n\n\n\n<ol start=\"11\" class=\"wp-block-list\">\n<li><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mn>5<\/mn><mo separator=\"true\">,<\/mo><mn>13<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(5,13)=1<\/annotation><\/semantics><\/math>gcd(5,13)=1: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>13<\/mn><mo>=<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>5<\/mn><mo>+<\/mo><mn>3<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">13=2\\times5+3<\/annotation><\/semantics><\/math>13=2\u00d75+3; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>5<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>3<\/mn><mo>+<\/mo><mn>2<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">5=1\\times3+2<\/annotation><\/semantics><\/math>5=1\u00d73+2; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>3<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>2<\/mn><mo>+<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">3=1\\times2+1<\/annotation><\/semantics><\/math>3=1\u00d72+1. Back-sub: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>1<\/mn><mo>=<\/mo><mn>3<\/mn><mo>\u2212<\/mo><mn>2<\/mn><mo>=<\/mo><mn>3<\/mn><mo>\u2212<\/mo><mo stretchy=\"false\">(<\/mo><mn>5<\/mn><mo>\u2212<\/mo><mn>3<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>3<\/mn><mo>\u2212<\/mo><mn>5<\/mn><mo>=<\/mo><mn>2<\/mn><mo stretchy=\"false\">(<\/mo><mn>13<\/mn><mo>\u2212<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>5<\/mn><mo stretchy=\"false\">)<\/mo><mo>\u2212<\/mo><mn>5<\/mn><mo>=<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>13<\/mn><mo>\u2212<\/mo><mn>5<\/mn><mo>\u00d7<\/mo><mn>5<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">1=3-2=3-(5-3)=2\\times3-5=2(13-2\\times5)-5=2\\times13-5\\times5<\/annotation><\/semantics><\/math>1=3\u22122=3\u2212(5\u22123)=2\u00d73\u22125=2(13\u22122\u00d75)\u22125=2\u00d713\u22125\u00d75. So <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>5<\/mn><mo>\u00d7<\/mo><mo stretchy=\"false\">(<\/mo><mo>\u2212<\/mo><mn>5<\/mn><mo stretchy=\"false\">)<\/mo><mo>+<\/mo><mn>13<\/mn><mo>\u00d7<\/mo><mn>2<\/mn><mo>=<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">5\\times(-5)+13\\times2=1<\/annotation><\/semantics><\/math>5\u00d7(\u22125)+13\u00d72=1, meaning <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><msup><mn>5<\/mn><mrow><mo>\u2212<\/mo><mn>1<\/mn><\/mrow><\/msup><mo>\u2261<\/mo><mo>\u2212<\/mo><mn>5<\/mn><mo>\u2261<\/mo><mn>8<\/mn><mspace><\/mspace><mspace width=\"0.4444em\"><\/mspace><mo stretchy=\"false\">(<\/mo><mrow><mi mathvariant=\"normal\">m<\/mi><mi mathvariant=\"normal\">o<\/mi><mi mathvariant=\"normal\">d<\/mi><\/mrow><mspace width=\"0.3333em\"><\/mspace><mn>13<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">5^{-1}\\equiv -5\\equiv 8\\pmod{13}<\/annotation><\/semantics><\/math>5\u22121\u2261\u22125\u22618(mod13). <strong>Modular inverse of 5 mod 13 is 8.<\/strong> Check: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>5<\/mn><mo>\u00d7<\/mo><mn>8<\/mn><mo>=<\/mo><mn>40<\/mn><mo>=<\/mo><mn>3<\/mn><mo>\u00d7<\/mo><mn>13<\/mn><mo>+<\/mo><mn>1<\/mn><mo>\u2261<\/mo><mn>1<\/mn><mspace><\/mspace><mspace width=\"0.4444em\"><\/mspace><mo stretchy=\"false\">(<\/mo><mrow><mi mathvariant=\"normal\">m<\/mi><mi mathvariant=\"normal\">o<\/mi><mi mathvariant=\"normal\">d<\/mi><\/mrow><mspace width=\"0.3333em\"><\/mspace><mn>13<\/mn><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">5\\times8=40=3\\times13+1\\equiv1\\pmod{13}<\/annotation><\/semantics><\/math>5\u00d78=40=3\u00d713+1\u22611(mod13) \u2713<\/li>\n\n\n\n<li><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mn>17<\/mn><mo separator=\"true\">,<\/mo><mn>11<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>1<\/mn><mo>\u2223<\/mo><mn>100<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(17,11)=1\\mid100<\/annotation><\/semantics><\/math>gcd(17,11)=1\u2223100 \u2713. Find particular solution: back-sub gives <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>17<\/mn><mo>\u00d7<\/mo><mn>2<\/mn><mo>\u2212<\/mo><mn>11<\/mn><mo>\u00d7<\/mo><mn>3<\/mn><mo>=<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">17\\times2-11\\times3=1<\/annotation><\/semantics><\/math>17\u00d72\u221211\u00d73=1&#8230; actually <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>17<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>11<\/mn><mo>+<\/mo><mn>6<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">17=1\\times11+6<\/annotation><\/semantics><\/math>17=1\u00d711+6; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>11<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>6<\/mn><mo>+<\/mo><mn>5<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">11=1\\times6+5<\/annotation><\/semantics><\/math>11=1\u00d76+5; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>6<\/mn><mo>=<\/mo><mn>1<\/mn><mo>\u00d7<\/mo><mn>5<\/mn><mo>+<\/mo><mn>1<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">6=1\\times5+1<\/annotation><\/semantics><\/math>6=1\u00d75+1. So <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>1<\/mn><mo>=<\/mo><mn>6<\/mn><mo>\u2212<\/mo><mn>5<\/mn><mo>=<\/mo><mn>6<\/mn><mo>\u2212<\/mo><mo stretchy=\"false\">(<\/mo><mn>11<\/mn><mo>\u2212<\/mo><mn>6<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>6<\/mn><mo>\u2212<\/mo><mn>11<\/mn><mo>=<\/mo><mn>2<\/mn><mo stretchy=\"false\">(<\/mo><mn>17<\/mn><mo>\u2212<\/mo><mn>11<\/mn><mo stretchy=\"false\">)<\/mo><mo>\u2212<\/mo><mn>11<\/mn><mo>=<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>17<\/mn><mo>\u2212<\/mo><mn>3<\/mn><mo>\u00d7<\/mo><mn>11<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">1=6-5=6-(11-6)=2\\times6-11=2(17-11)-11=2\\times17-3\\times11<\/annotation><\/semantics><\/math>1=6\u22125=6\u2212(11\u22126)=2\u00d76\u221211=2(17\u221211)\u221211=2\u00d717\u22123\u00d711. Scale by 100: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>17<\/mn><mo>\u00d7<\/mo><mn>200<\/mn><mo>+<\/mo><mn>11<\/mn><mo>\u00d7<\/mo><mo stretchy=\"false\">(<\/mo><mo>\u2212<\/mo><mn>300<\/mn><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>100<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">17\\times200+11\\times(-300)=100<\/annotation><\/semantics><\/math>17\u00d7200+11\u00d7(\u2212300)=100. General: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>x<\/mi><mo>=<\/mo><mn>200<\/mn><mo>\u2212<\/mo><mn>11<\/mn><mi>t<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">x=200-11t<\/annotation><\/semantics><\/math>x=200\u221211t, <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>y<\/mi><mo>=<\/mo><mo>\u2212<\/mo><mn>300<\/mn><mo>+<\/mo><mn>17<\/mn><mi>t<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">y=-300+17t<\/annotation><\/semantics><\/math>y=\u2212300+17t. Positive integer solutions: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>x<\/mi><mo>&gt;<\/mo><mn>0<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">x&gt;0<\/annotation><\/semantics><\/math>x>0: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>t<\/mi><mo>&lt;<\/mo><mn>200<\/mn><mi mathvariant=\"normal\">\/<\/mi><mn>11<\/mn><mo>\u2248<\/mo><mn>18.2<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">t&lt;200\/11\\approx18.2<\/annotation><\/semantics><\/math>t&lt;200\/11\u224818.2; <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>y<\/mi><mo>&gt;<\/mo><mn>0<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">y&gt;0<\/annotation><\/semantics><\/math>y>0: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>t<\/mi><mo>&gt;<\/mo><mn>300<\/mn><mi mathvariant=\"normal\">\/<\/mi><mn>17<\/mn><mo>\u2248<\/mo><mn>17.6<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">t&gt;300\/17\\approx17.6<\/annotation><\/semantics><\/math>t>300\/17\u224817.6. So <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>t<\/mi><mo>=<\/mo><mn>18<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">t=18<\/annotation><\/semantics><\/math>t=18: <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>x<\/mi><mo>=<\/mo><mn>200<\/mn><mo>\u2212<\/mo><mn>198<\/mn><mo>=<\/mo><mn>2<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">x=200-198=2<\/annotation><\/semantics><\/math>x=200\u2212198=2, <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>y<\/mi><mo>=<\/mo><mo>\u2212<\/mo><mn>300<\/mn><mo>+<\/mo><mn>306<\/mn><mo>=<\/mo><mn>6<\/mn><\/mrow><annotation encoding=\"application\/x-tex\">y=-300+306=6<\/annotation><\/semantics><\/math>y=\u2212300+306=6. <strong>(x,y)=(2,6)(x,y)=(2,6) (x,y)=(2,6) is the only positive solution.<\/strong><\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What is the Euclidean algorithm?<\/strong> A method for finding the greatest common divisor (GCD) of two integers by repeated division with remainder. At each step, the larger number is replaced by the smaller, and the smaller by the remainder, until the remainder is 0. The last non-zero remainder is the GCD.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Why is the Euclidean algorithm useful?<\/strong> It finds the GCD far more efficiently than prime factorisation for large numbers. It is also the foundation for the extended Euclidean algorithm, which solves linear Diophantine equations and finds modular inverses \u2014 both essential in competition number theory and cryptography.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What is the extended Euclidean algorithm?<\/strong>An extension that, in addition to finding <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>b<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">\\gcd(a, b)<\/annotation><\/semantics><\/math>gcd(a,b), finds integers <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>x<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">x<\/annotation><\/semantics><\/math>x and <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>y<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">y<\/annotation><\/semantics><\/math>y satisfying <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><mi>x<\/mi><mo>+<\/mo><mi>b<\/mi><mi>y<\/mi><mo>=<\/mo><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>b<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">ax + by = \\gcd(a, b)<\/annotation><\/semantics><\/math>ax+by=gcd(a,b) (B\u00e9zout&#8217;s identity). It uses back-substitution through the steps of the standard algorithm.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What is B\u00e9zout&#8217;s lemma?<\/strong>For any integers <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">a<\/annotation><\/semantics><\/math>a and <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>b<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">b<\/annotation><\/semantics><\/math>b, there exist integers <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>x<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">x<\/annotation><\/semantics><\/math>x and <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>y<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">y<\/annotation><\/semantics><\/math>y such that <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><mi>x<\/mi><mo>+<\/mo><mi>b<\/mi><mi>y<\/mi><mo>=<\/mo><mi>gcd<\/mi><mo>\u2061<\/mo><mo stretchy=\"false\">(<\/mo><mi>a<\/mi><mo separator=\"true\">,<\/mo><mi>b<\/mi><mo stretchy=\"false\">)<\/mo><\/mrow><annotation encoding=\"application\/x-tex\">ax + by = \\gcd(a, b)<\/annotation><\/semantics><\/math>ax+by=gcd(a,b). The extended Euclidean algorithm finds these <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>x<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">x<\/annotation><\/semantics><\/math>x and <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>y<\/mi><\/mrow><annotation encoding=\"application\/x-tex\">y<\/annotation><\/semantics><\/math>y explicitly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Does the Euclidean algorithm appear in the Ontario curriculum?<\/strong> GCD and LCM are in the Ontario curriculum from Grade 8 onward, but the Euclidean algorithm specifically is not prescribed. It is taught as a competition mathematics tool and a more efficient alternative to factor-list methods.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>How does the Euclidean algorithm relate to the Euclid Contest?<\/strong> The Euclid Contest (CEMC) is named after Euclid, who described the algorithm around 300 BCE. The algorithm itself \u2014 and its extension to Diophantine equations and modular inverses \u2014 appears in Euclid Contest number theory problems at the Part B and Part C level.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><em>See our related guides: <a href=\"https:\/\/blog-admin.thethinkacademy.com\/blog\/fermats-little-theorem-guide\/\">Fermat&#8217;s Little Theorem guide<\/a> \u00b7 <a href=\"https:\/\/blog-admin.thethinkacademy.com\/blog\/rules-of-divisibility-guide\/\">rules of divisibility guide<\/a> \u00b7 <a href=\"https:\/\/blog-admin.thethinkacademy.com\/blog\/perfect-numbers-guide\/\">perfect numbers guide<\/a> \u00b7 <a href=\"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/05\/18\/euclid-math-contest-preparation-guide-canada\/\">Euclid math contest guide<\/a> \u00b7 <a href=\"https:\/\/blog-admin.thethinkacademy.com\/blog\/comc-math-contest-guide\/\">COMC math contest guide<\/a> \u00b7 <a href=\"https:\/\/blog-admin.thethinkacademy.com\/blog\/canadian-mathematical-olympiad-guide\/\">Canadian Mathematical Olympiad guide<\/a> \u00b7 <a href=\"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/04\/15\/amc-8-math-competition-guide-for-parents\/\">AMC 8 guide<\/a> \u00b7 <a href=\"https:\/\/www.thinkacademy.ca\/blog\/blog\/2026\/05\/05\/gauss-math-contest-complete-guide-canada\/\">Gauss math contest guide<\/a> \u00b7 <a href=\"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/06\/05\/grade-8-math-curriculum-ontario\/\">Grade 8 math curriculum Ontario<\/a> \u00b7 <a href=\"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/06\/23\/math-competition-canada\/\">math competitions in Canada<\/a><\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The Euclidean algorithm is ancient mathematics that still underlies modern cryptography and competition number theory. Know it properly.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.thinkacademy.ca\/trialclass_en?source_id=6721&amp;source_type=9&amp;utm_medium=website&amp;utm_source=pc_blog\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"436\" src=\"https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_33_16-AM-1-1024x436.png\" alt=\"euclidean algorithm cta\" class=\"wp-image-65480\" srcset=\"https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_33_16-AM-1-1024x436.png 1024w, https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_33_16-AM-1-300x128.png 300w, https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_33_16-AM-1-768x327.png 768w, https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_33_16-AM-1-1536x654.png 1536w, https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_33_16-AM-1-1300x553.png 1300w, https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_33_16-AM-1.png 1922w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>The Euclidean algorithm is one of the oldest algorithms in mathematics \u2014 described by Euclid around &hellip; <a title=\"Euclidean Algorithm Explained: Definition, Steps and Applications\" class=\"hm-read-more\" href=\"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/08\/19\/euclidean-algorithm-guide\/\"><span class=\"screen-reader-text\">Euclidean Algorithm Explained: Definition, Steps and Applications<\/span>Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":65477,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1752,5907,17135,17160],"tags":[],"class_list":["post-65476","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-competitions","category-education","category-study-tips-and-tools","category-math-skills"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Euclidean Algorithm: Definition, Steps, Examples and Applications<\/title>\n<meta name=\"description\" content=\"The Euclidean algorithm \u2014 how to apply it step by step, why it works, extended Euclidean algorithm, and where it appears in competitions.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/08\/19\/euclidean-algorithm-guide\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Euclidean Algorithm: Definition, Steps, Examples and Applications\" \/>\n<meta property=\"og:description\" content=\"The Euclidean algorithm \u2014 how to apply it step by step, why it works, extended Euclidean algorithm, and where it appears in competitions.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/08\/19\/euclidean-algorithm-guide\/\" \/>\n<meta property=\"og:site_name\" content=\"Think Academy Canada Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-19T09:37:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-08-19T09:37:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_16_30-AM-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1402\" \/>\n\t<meta property=\"og:image:height\" content=\"1122\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Think Academy\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Think Academy\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"18 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/blog\\\/2026\\\/08\\\/19\\\/euclidean-algorithm-guide\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/blog\\\/2026\\\/08\\\/19\\\/euclidean-algorithm-guide\\\/\"},\"author\":{\"name\":\"Think Academy\",\"@id\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/#\\\/schema\\\/person\\\/5e5752520edd7febcc1056443eab8850\"},\"headline\":\"Euclidean Algorithm Explained: Definition, Steps and Applications\",\"datePublished\":\"2026-08-19T09:37:10+00:00\",\"dateModified\":\"2026-08-19T09:37:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/blog\\\/2026\\\/08\\\/19\\\/euclidean-algorithm-guide\\\/\"},\"wordCount\":2734,\"image\":{\"@id\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/blog\\\/2026\\\/08\\\/19\\\/euclidean-algorithm-guide\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/ChatGPT-Image-Aug-19-2026-10_16_30-AM-1.png\",\"articleSection\":[\"Competitions\",\"Education\",\"Study Tips And Tools\",\"Math Skills\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/blog\\\/2026\\\/08\\\/19\\\/euclidean-algorithm-guide\\\/\",\"url\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/blog\\\/2026\\\/08\\\/19\\\/euclidean-algorithm-guide\\\/\",\"name\":\"Euclidean Algorithm: Definition, Steps, Examples and Applications\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/blog\\\/2026\\\/08\\\/19\\\/euclidean-algorithm-guide\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/blog\\\/2026\\\/08\\\/19\\\/euclidean-algorithm-guide\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/ChatGPT-Image-Aug-19-2026-10_16_30-AM-1.png\",\"datePublished\":\"2026-08-19T09:37:10+00:00\",\"dateModified\":\"2026-08-19T09:37:12+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/#\\\/schema\\\/person\\\/5e5752520edd7febcc1056443eab8850\"},\"description\":\"The Euclidean algorithm \u2014 how to apply it step by step, why it works, extended Euclidean algorithm, and where it appears in competitions.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/blog\\\/2026\\\/08\\\/19\\\/euclidean-algorithm-guide\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/blog\\\/2026\\\/08\\\/19\\\/euclidean-algorithm-guide\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/blog\\\/2026\\\/08\\\/19\\\/euclidean-algorithm-guide\\\/#primaryimage\",\"url\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/ChatGPT-Image-Aug-19-2026-10_16_30-AM-1.png\",\"contentUrl\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/ChatGPT-Image-Aug-19-2026-10_16_30-AM-1.png\",\"width\":1402,\"height\":1122},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/blog\\\/2026\\\/08\\\/19\\\/euclidean-algorithm-guide\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Euclidean Algorithm Explained: Definition, Steps and Applications\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/#website\",\"url\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/\",\"name\":\"Think Academy Canada Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/#\\\/schema\\\/person\\\/5e5752520edd7febcc1056443eab8850\",\"name\":\"Think Academy\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f79e3f7bff09863820040f04b26b5731542ae3733cf505c30733842df6e7ff82?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f79e3f7bff09863820040f04b26b5731542ae3733cf505c30733842df6e7ff82?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f79e3f7bff09863820040f04b26b5731542ae3733cf505c30733842df6e7ff82?s=96&d=mm&r=g\",\"caption\":\"Think Academy\"},\"sameAs\":[\"https:\\\/\\\/blog-admin.thethinkacademy.com\"],\"url\":\"https:\\\/\\\/blog-admin.thethinkacademy.com\\\/blog\\\/author\\\/thinkacademy\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Euclidean Algorithm: Definition, Steps, Examples and Applications","description":"The Euclidean algorithm \u2014 how to apply it step by step, why it works, extended Euclidean algorithm, and where it appears in competitions.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/08\/19\/euclidean-algorithm-guide\/","og_locale":"en_US","og_type":"article","og_title":"Euclidean Algorithm: Definition, Steps, Examples and Applications","og_description":"The Euclidean algorithm \u2014 how to apply it step by step, why it works, extended Euclidean algorithm, and where it appears in competitions.","og_url":"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/08\/19\/euclidean-algorithm-guide\/","og_site_name":"Think Academy Canada Blog","article_published_time":"2026-08-19T09:37:10+00:00","article_modified_time":"2026-08-19T09:37:12+00:00","og_image":[{"width":1402,"height":1122,"url":"https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_16_30-AM-1.png","type":"image\/png"}],"author":"Think Academy","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Think Academy","Est. reading time":"18 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/08\/19\/euclidean-algorithm-guide\/#article","isPartOf":{"@id":"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/08\/19\/euclidean-algorithm-guide\/"},"author":{"name":"Think Academy","@id":"https:\/\/blog-admin.thethinkacademy.com\/#\/schema\/person\/5e5752520edd7febcc1056443eab8850"},"headline":"Euclidean Algorithm Explained: Definition, Steps and Applications","datePublished":"2026-08-19T09:37:10+00:00","dateModified":"2026-08-19T09:37:12+00:00","mainEntityOfPage":{"@id":"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/08\/19\/euclidean-algorithm-guide\/"},"wordCount":2734,"image":{"@id":"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/08\/19\/euclidean-algorithm-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_16_30-AM-1.png","articleSection":["Competitions","Education","Study Tips And Tools","Math Skills"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/08\/19\/euclidean-algorithm-guide\/","url":"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/08\/19\/euclidean-algorithm-guide\/","name":"Euclidean Algorithm: Definition, Steps, Examples and Applications","isPartOf":{"@id":"https:\/\/blog-admin.thethinkacademy.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/08\/19\/euclidean-algorithm-guide\/#primaryimage"},"image":{"@id":"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/08\/19\/euclidean-algorithm-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_16_30-AM-1.png","datePublished":"2026-08-19T09:37:10+00:00","dateModified":"2026-08-19T09:37:12+00:00","author":{"@id":"https:\/\/blog-admin.thethinkacademy.com\/#\/schema\/person\/5e5752520edd7febcc1056443eab8850"},"description":"The Euclidean algorithm \u2014 how to apply it step by step, why it works, extended Euclidean algorithm, and where it appears in competitions.","breadcrumb":{"@id":"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/08\/19\/euclidean-algorithm-guide\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/08\/19\/euclidean-algorithm-guide\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/08\/19\/euclidean-algorithm-guide\/#primaryimage","url":"https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_16_30-AM-1.png","contentUrl":"https:\/\/blog-admin.thethinkacademy.com\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-Aug-19-2026-10_16_30-AM-1.png","width":1402,"height":1122},{"@type":"BreadcrumbList","@id":"https:\/\/blog-admin.thethinkacademy.com\/blog\/2026\/08\/19\/euclidean-algorithm-guide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog-admin.thethinkacademy.com\/"},{"@type":"ListItem","position":2,"name":"Euclidean Algorithm Explained: Definition, Steps and Applications"}]},{"@type":"WebSite","@id":"https:\/\/blog-admin.thethinkacademy.com\/#website","url":"https:\/\/blog-admin.thethinkacademy.com\/","name":"Think Academy Canada Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog-admin.thethinkacademy.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog-admin.thethinkacademy.com\/#\/schema\/person\/5e5752520edd7febcc1056443eab8850","name":"Think Academy","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f79e3f7bff09863820040f04b26b5731542ae3733cf505c30733842df6e7ff82?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f79e3f7bff09863820040f04b26b5731542ae3733cf505c30733842df6e7ff82?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f79e3f7bff09863820040f04b26b5731542ae3733cf505c30733842df6e7ff82?s=96&d=mm&r=g","caption":"Think Academy"},"sameAs":["https:\/\/blog-admin.thethinkacademy.com"],"url":"https:\/\/blog-admin.thethinkacademy.com\/blog\/author\/thinkacademy\/"}]}},"yoast_meta_description":"The Euclidean algorithm \u2014 how to apply it step by step, why it works, extended Euclidean algorithm, and where it appears in competitions.","yoast_focus_keyword":"euclidean algorithm","yoast_seo_title":"Euclidean Algorithm: Definition, Steps, Examples and Applications","_links":{"self":[{"href":"https:\/\/blog-admin.thethinkacademy.com\/wp-json\/wp\/v2\/posts\/65476","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog-admin.thethinkacademy.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog-admin.thethinkacademy.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog-admin.thethinkacademy.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog-admin.thethinkacademy.com\/wp-json\/wp\/v2\/comments?post=65476"}],"version-history":[{"count":1,"href":"https:\/\/blog-admin.thethinkacademy.com\/wp-json\/wp\/v2\/posts\/65476\/revisions"}],"predecessor-version":[{"id":65481,"href":"https:\/\/blog-admin.thethinkacademy.com\/wp-json\/wp\/v2\/posts\/65476\/revisions\/65481"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog-admin.thethinkacademy.com\/wp-json\/wp\/v2\/media\/65477"}],"wp:attachment":[{"href":"https:\/\/blog-admin.thethinkacademy.com\/wp-json\/wp\/v2\/media?parent=65476"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog-admin.thethinkacademy.com\/wp-json\/wp\/v2\/categories?post=65476"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog-admin.thethinkacademy.com\/wp-json\/wp\/v2\/tags?post=65476"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}