In a book (The nuts and bolts of Proofs) there is the exercise:
If $n$ is a three-digit number, whose unit digit is at most 4, whose hundred digit is between 1 and 5, and whose tens digit is the sum of the other two digits, then n is divisible by 11.
My attempt of proving this statement.
Since n is a three-digit number, $n= a_2a_1a_0 = a_2 \times 100+ a_1 \times 10+a_0$. By hypothesis, $0\leq a_0 \leq 4$, $1\leq a_2 \leq 5$, and $a_1 = a_2 + a_0$. Therefore
\begin{align*} n& = a_2 \times 100+ a_1 \times 10+ a_0 = a_2\times 100+(a_2+a_0)\times 10+a_0\\ &= a_2\times 100+a_2\times 10+a_0\times 10+a_0=a_2\times 110+a_0\times 11\\ &=11(10a_2+a_0) \end{align*}
I do not get where the part of the hypothesis $[0\leq a_0 \leq 4,~ 1\leq a_2 \leq 5]$ has been used. I apologize if I am missing something trivial. By the way, with the following code Python
lst = range(100,1000)
lst1 = []
lst2 = []
for i in lst:
n = i
digit_3 = n//100
n = n % 100
digit_2 = n // 10
n = n % 10
digit_1 = n
if digit_2 == digit_1+digit_3:
lst1.append(i)
print(lst1)
for i in lst1:
if i%11 == 0:
lst2.append(i)
print(lst2 == lst1)
I get the following set of 3-digits number whose tens digit is the sum of the other two digits, and they are divisible by 11: $[110, 121, 132, 143, 154, 165, 176, 187, 198, 220, 231, 242, 253, 264, 275, 286, 297, 330, 341, 352, 363, 374, 385, 396, 440, 451, 462, 473, 484, 495, 550, 561, 572, 583, 594, 660, 671, 682, 693, 770, 781, 792, 880, 891, 990]$.
Some (but not all) of them verify the $[0\leq a_0 \leq 4,~ 1\leq a_2 \leq 5]$ hypothesis part.
