# Square of an Number

1. Sep 1, 2009

### Martin Bashir

How can i prove that square of an integer ends with 0,1,4,5,6,9 ?

2. Sep 1, 2009

### ramsey2879

What base is your number system in ? If it is ten then you have to show that with all ten possible endings, n squared will not give a number with a different ending.
As another thought since n squared = -n squared in any base the maximum number of possible endings is [(B + 1)/2] where [] is the next higher integer and B is the base. In base 10 you will only need to look at numbers from 0 to 10/2 to find the possible endings since 5 to10 are the same as - (-5 to 0) mod 10.

Last edited: Sep 1, 2009
3. Sep 1, 2009

### HallsofIvy

You can write any number, in base 10, as n= 10i+ j for integers i and j with j the "last digit", from 0 to 9.
$10i+ 0= 100i^2$ which ends with 0.
$10i+ 1= 100i^2 + 20i+ 1= 10(10i^2+ i)+ 1$ which ends with 1.
$10i+ 2= 100i^2+ 40i+ 4= 10(10i^2+ 4i)+ 4$ which ends with 4.
$10i+ 3= 100i^2+ 60i+ 9= 10(10i^2+ 6i)+ 9$ which ends with 9.
$10i+ 4= 100i^2+ 80i+ 16= 10(10i^2+ 8i+ 1)+ 6$ which ends with 6.
$10i+ 5= 100i^2+ 100i+ 25= 10(10i^2+ 10i+ 2)+ 5$ which ends with 5.
$10i+ 6= 100i^2+ 120i+ 36= 10(10i^2+ 12i+ 3)+ 6$ which ends with 6.
$10i+ 7= 100i^2+ 140i+ 49= 10(10i^2+ 14i+ 4)+ 9$ which ends with 9.
$10i+ 8= 100i^2+ 160i+ 64= 10(10i^2+ 16i+ 6)+ 4$ which ends with 4.
$10i+ 9= 100i^2+ 180i+ 81= 10(10i^2+ 18i+ 8)+ 1$ which ends with 1.