A question goes like :
Find the HCF of $\underbrace{111\ldots 11}_{100\text{ ones}}$ and $\underbrace{111\ldots11}_{60 \text{ ones}}$.
The answer is $\underbrace{111\ldots11}_{20 \text{ ones}}$
I'd like to know how this question is solved along with the logic behind the steps.
All help is appreciated
Cheers!
3 steps of Euclid's algorithm will get you there:
$$\begin{align} & \gcd(\underbrace{11\cdots11}_{100},\underbrace{11\cdots11}_{60}) \\ ={}& \gcd(\underbrace{11\cdots11}_{40},\underbrace{11\cdots11}_{60}) \\ ={}& \gcd(\underbrace{11\cdots11}_{40},\underbrace{11\cdots11}_{20}) \\ ={}& \gcd(\underbrace{11\cdots11}_{20},\underbrace{11\cdots11}_{20}) = \underbrace{11\cdots11}_{20} \end{align} $$
First subtract $10^{40}$ times the right number from the left, then $10^{20}$ times the left number from the right, then $10^{20}$ times the right number from the left again.
This example generalizes to seeing that $$ \gcd(\underbrace{11\cdots11}_{a\text{ ones}},\underbrace{11\cdots11}_{b\text{ ones}}) = \underbrace{11\cdots11}_{\gcd(a,b)\text{ ones}} $$