# Squaring Numbers That Begin or End With 5

By Susam Pal on 21 Dec 2010

In this post, I will discuss some simple tricks I use to square numbers that begin or end with the digit $$5$$. Let us illustrate each trick with two examples for 2-digit numbers. Then we will generalize the trick for any number that begins or ends with the digit $$5$$.

## Squaring a 2-Digit Number That Ends With 5

I learnt this from an arithmetic book during my childhood days. If the first digit of a 2-digit number is $$a$$ and the second digit is $$5$$ in decimal representation, then its square can then be written as $$a \times (a + 1)$$ followed by $$25$$ in decimal representation, i.e., the first few digits of the square is given by $$a \times (a + 1)$$ and the last two digits are $$25$$. Here are some examples:

• $$25^2 = 625.$$ (Note that $$2 \times 3 = 6.$$)
• $$85^2 = 7225.$$ (Note that $$8 \times 9 = 72.$$)

## Squaring a 2-Digit Number That Begins With 5

After learning the previous trick, I wondered if I could make more such 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$$, then its square can be written as $$25 + a$$ followed by $$a^2$$. In other words, the first two digits of the square are obtained from the result of $$25 + a$$ and the last two digits are obtained from the result of $$a^2$$. Here are some examples:

• $$52^2 = 2704.$$ (Note that $$25 + 2 = 27$$ and $$2^2 = 4.$$)
• $$57^2 = 3249.$$ (Note that $$25 + 7 = 32$$ and $$7^2 = 49.$$)

## Squaring Any Number That Ends with 5

Let us represent all digits except the last one as $$a$$, e.g., if we are given the number $$115$$, we say, $$a = 11$$. Then we can express the given number algebraically as $$10a + 5$$. Note that the square of this number is $(10a + 5)^2 = 100a(a + 1) + 25.$ In decimal representation, this amounts to writing the result of $$a(a + 1)$$ followed by $$25.$$ Here are some examples:

• $$115^2 = 13225.$$ (Note that $$11 \times 12 = 132.$$)
• $$9995^2 = 99900025.$$ (Note that $$999 \times 1000 = 999000.$$)

## Squaring Any Number That Begins With 5

Let us represent all digits except the first one as $$a$$, e.g., if we are given the number $$512$$, we say, $$a = 12$$. Then we can express the given number algebraically as $$5 \times 10^n + a$$ where $$n$$ is the number of digits in $$a$$. Note that $(5 \times 10^n + a)^2 = 25 \times 10^{2n} + 10^{n + 1} a + a^2.$ In decimal reprensetation, this amounts to performing the following steps:

1. Write $$25$$ as the first two digits.
2. Then write $$a^2$$ as a $$2n$$-digit number immediately after $$25$$. Prefix $$a^2$$ with appropriate number of $$0$$s so that $$a^2$$ is written with $$2n$$ digits.
3. Write the $$+$$-sign directly below the first digit, that is, write the $$+$$-sign directly before the first $$2$$.
4. Write every digit of $$a$$ including any preceding $$0$$s immediately after the $$+$$-sign.
5. Finally add the numbers in both rows column by column performing the carrying operation whenever necessary.

Here are some examples: $502^2 = \\ \left\{ \begin{array}{cccccc} 2 & 5 & 0 & 0 & 0 & 4 \\ + & 0 & 2 \\ \hline 2 & 5 & 2 & 0 & 0 & 4 \end{array} \right\} = 252004.$ $512^2 = \\ \left\{ \begin{array}{cccccc} 2 & 5 & 0 & 1 & 1 & 4 \\ + & 1 & 2 \\ \hline 2 & 6 & 2 & 1 & 1 & 4 \end{array} \right\} = 262114.$ $564^2 = \\ \left\{ \begin{array}{cccccc} 2 & 5 & 4 & 0 & 9 & 6 \\ + & 6 & 4 \\ \hline 3 & 1 & 8 & 0 & 9 & 6 \\ \end{array} \right\} = 318096.$

## Applying Both Tricks Together

Let us now see an example where we use both the tricks together. Let us find $$5195^2$$. This is a number that begins with the digit $$5$$ as well as ends with the digit $$5$$. We need to use the second trick to find $$5195^2$$. But the second trick begins with writing $$25$$ immediately followed by the result of $$195^2$$, so we use the first trick to calculate $$195^2$$.

To write the result of $$195^2$$, we first write $$380$$ which we obtain as the result of $$19 \times 20$$ and then we write $$25$$ immediately after it. Thus $$195^2 = 38025$$. Now we perform the second trick as follows: \begin{align*} 5195^2 = \left\{ \begin{array}{cccccccc} 2 & 5 & 0 & 3 & 8 & 0 & 2 & 5 \\ + & 1 & 9 & 5 \\ \hline 2 & 6 & 9 & 8 & 8 & 0 & 2 & 5 \end{array} \right\} = 26988025. \end{align*}