In this post, I'll discuss some simple tricks I use to square numbers
that begin or end with the digit 5. Let me illustrate each trick with
two examples for 2-digit numbers. Later, in this post, I'll generalize
the trick for n-digit numbers where n ≥ 2 after explaining why the
tricks work using algebra.

Squaring a 2-digit number that ends with 5

I learnt this from a book when I was in 5th standard. For a 2-digit
number that ends with 5, let us assume that the first digit is A. So,
the number can be written as A5. The square is: A × (A + 1)
followed by 25, i.e. the first few digits of the square is given by A
× (A + 1) and the last two digits are 25. Let us try some
examples.

25^{2} = 625. (2 × 3 = 6.)
85^{2} = 7225. (8 × 9 = 72.)

Squaring a 2-digit number that begins with 5

After learning that trick from the book, I wondered if I could make more
tricks for myself. This is the first one I could come up with. If the
first digit of a 2-digit number is 5 and the second digit is A, i.e. if
the number is of the form 5A, the square is given by the sum of 25 and A
followed by square of A. In other words, the first two digits of the
square are obtained from 25 + A and the last two digits are obtained
from A^{2}. Let us try some examples.

52^{2} = 2704. (25 + 2 = 27 and 2^{2} = 4.)
57^{2} = 3249. (25 + 7 = 32 and 7^{2} = 49.)

Squaring an n-digit number that ends with 5

Let us represent all digits except the last one as A. So, the number is
of the form A5 where A represents one or more digits. e.g. if the number
is 115, A = 11.

So, we can say that the number of the form A5 can be algebraically
expressed as 10A + 5. Now, (10A + 5)^{2} = 100A^{2} +
100A + 25 = 100A(A + 1) + 25. This amounts to writing A(A + 1) followed
by 25.

Let us try some examples:

115^{2} = 13225. (11 × 12 = 132.)
9995^{2} = 99900025. (999 × 1000 = 999000.)

Squaring an n-digit number that begins with
5.

Let us represent all digits except the first one as A. So the number is
of the form 5A where A represents one or more digits. e.g. if the number
is 512, A = 12.

So, we can say that the number of the form 5A can be algebraically
expressed as 5 × 10^{n} + A where n is the number of digits
in A, i.e. the number of digits after the first digit which is 5. Now,
(5 × 10^{n} + A)^{2} = 25 × 10^{2n} +
10^{n + 1}A + A^{2}. This amounts to writing 25 as the
first two digits followed by A^{2} as the last 2n digits and
then adding A to it by placing it just below the second digit which is
5. Some examples follow.

502^{2}

= 250004 (2^{2} = 4.)
+02 (02 placed under 5.)
---------
252004
---------

512

^{2}
= 250144 (12^{2} = 144.)
+12 (12 placed under 5.)
---------
262144
---------

Using both tricks together
5195^{2}

= 25038025 (195^{2} =
38025; 19 × 20 = 380.)
+195 (195 placed under 5.)
-----------
26988025
-----------

Note that in the problem above, we use the second trick to square 5195
because it begins with the digit 5. However, while doing so, we need to
figure the square of 195 and we use the first trick to do this.