In: Computer Science
Show that any number that ends in 9 if squared ends at 1.
The numbers ending in 9 are of the form 10x + 9, where x is any integer.
Now on squaring,
(10x + 9)2 = 100x2 + 180x + 81
Let us divide the expression into 3 parts, first one is 100x2 , second one is 180x and the third one is 81.
The first one definitely ends with 0 because any number multiplied by 10 or its multiple has zeros at the end.
So the first and second terms ends with 0.
As we are concerned only about the the last digit, we dont bother about the remaining digits except the last digit on adding 81 to the other terms. 81 ends with 1.So the result ends with 1.
Therefore any number ending with 9, has its square ending in 1.
Example:
Let us consider the value of x as 1. The number will be 10 + 9 = 19.
(10 + 9)2 = 100 + 180 + 81 = 361.
19 ends with 9 and it's square 361 ends in 1.
Please appreciate the solution if you find it helpful. If you have any doubts in the solution, feel free to ask me in the comment section.