С помощью алгоритма Евклида найдите наибольший общий делитель чисел \(\displaystyle 5\) и \(\displaystyle 30{\small :}\)
\(\displaystyle \text{НОД}(5,30)=\)
Алгоритм Евклида для НОД(a, b)
1. Пусть \(\displaystyle b>a{\small .}\) Делим большее \(\displaystyle b\) на меньшее \(\displaystyle a\) с остатком:
\(\displaystyle b=a\cdot n+ {\bf r}{\small .}\)
2. \(\displaystyle \text{НОД}(a,b)=\text{НОД}(a,{\bf r}){\small .}\)
3. Если \(\displaystyle {\bf r}=0{\small ,}\) то \(\displaystyle \text{НОД}(a,{\bf r})=a{\small .}\) Если \(\displaystyle {\bf r}=\not 0{\small ,}\) то ищем \(\displaystyle \text{НОД}(a,{\bf r})\) (но теперь \(\displaystyle a>{\bf r}\)).
В нашем случае нам надо найти наибольший общий делитель чисел \(\displaystyle 5\) и \(\displaystyle 30{\small :}\)
\(\displaystyle \text{НОД}(5,30)= \, ?\)
1. Так как \(\displaystyle 30 > 5{\small ,}\) то делим \(\displaystyle 30\) на \(\displaystyle 5\) с остатком: \(\displaystyle 30=5\cdot 6+{\bf 0}{\small .}\)
2. \(\displaystyle \text{НОД}(5,30)=\text{НОД}(5,{\bf 0}){\small .}\)
3. \(\displaystyle \text{НОД}(5,{\bf 0})=5{\small .}\)
Ответ: \(\displaystyle \text{НОД}(5,30)=5{\small .}\)