Introducción a la teoría de números. Ejemplos y - TEC-Digital
Introducción a la teoría de números. Ejemplos y - TEC-Digital
Introducción a la teoría de números. Ejemplos y - TEC-Digital
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
78 = 32 · 2 + 14 −→ 14 = 78 − 32 · 2<br />
32 = 14 · 2 + 4 −→ 4 = 32 − 14 · 2 _↑<br />
14 = 4 · 3 + 2 −→ 2 = 14 − 4 · 3 _↑<br />
4 = 2 · 2 + 0<br />
EJERCICIOS 27<br />
Ahora hacemos sustitución hacia atrás, sustituyendo <strong>la</strong>s expresiones <strong>de</strong> los residuos. En<br />
cada paso se ha subraya el residuo que se sustituye<br />
EJEMPLO 2.19<br />
2 = 14 − 4 · 3<br />
= 14 − (32 − 14 · 2)3<br />
= 14 · 7 − 32 · 3<br />
= (78 − 32 · 2)7 − 32 · 3<br />
= 7 · 78 − 17 · 32<br />
Calcu<strong>la</strong>r s,t ∈ Z tal que s · −8 + t · 22 = mcd(−8,22).<br />
Solución:<br />
Calcu<strong>la</strong>r mcd(−8,22) Cálculo <strong>de</strong> s y t<br />
−8 = −1 · 22 + 14<br />
22 = 1 · 14 + 8<br />
14 = 1 · 8 + 6<br />
8 = 1 · 6 + 2<br />
6 = 3 · 2 + 0<br />
2.5.1 Algoritmo e implementación.<br />
2 = 6 − 8<br />
= 14 − 8 − (22 − 14)<br />
= (−8 + 22) − 8 − (22 − (−8 + 22))<br />
= −3 · −8 − 1 · 22<br />
∴ s = −3 y t = −1<br />
Observación: En este contexto, a/b <strong>de</strong>nota el cociente <strong>de</strong> dividir a y b.<br />
1<br />
Algoritmo 2.3: Algoritmo Extendido <strong>de</strong> Eucli<strong>de</strong>s<br />
Datos: a, b enteros no ambos nulos<br />
Salida: mcd(a,b), t y s<br />
c = |a|, d = |b|;<br />
2 c1 = 1, d1 = 0;<br />
3 c2 = 0, d2 = 1;<br />
4<br />
5<br />
6<br />
while d �= 0 do<br />
q = c/d, r = c − qd,<br />
r1 = c1 − qd1, r2 = c2 − qd2,<br />
c = d, c1 = d1, c2 = d2,<br />
d = r, d1 = r1, d2 = r2,<br />
return mcd (a,b) = |c|, s = c1/sgn(a) · sgn(c), t = c2/sgn(b) · sgn(c);