The first row of squares for general k

Share this page

Let $k$ be a positive integer. Look at the first row of larger squares in the complement of the blue grid you get from colouring squares corresponding to multiples of $k$ blue. First, we are going to prove that the numbers within the $nth$ larger square from the left add to

  \[ (2n-1)T_{k-1}^2, \]    

where $T_{k-1}$ is the $(k-1)st$ triangular number.

Let’s call the square in question $S.$ First note that the numbers within the top row of $S$ are

  \[ 1+k(n-1), 2+k(n-1), 3+k(n-1), ... , \left((k-1)+k(n-1)\right). \]    

Adding those up we get the sum

  \[ 1+k(n-1)+2+k(n-1)+3+k(n-1)+...+(k-1)+k(n-1)\right), \]    

which we can rearrange to give

  \begin{equation} \left[1+2+...+(k-1)\right] + \left[(k-1)k(n-1)\right].\end{equation}   (1)

As we mentioned in the main article, there’s a formula for the sum of the first $k-1$ integers:

  \begin{equation} 1+2+...+(k-1) = \frac{(k-1)k}{2}. \end{equation}   (2)

Substituting this into the left part of expression (1) gives

  \begin{equation} \frac{(k-1)k}{2} + (k-1)k(n-1) = \frac{(k-1)k+2(k-1)(n-1)k}{2}=\frac{(k-1)k\left(1+2(n-1)\right)}{2}=\frac{(k-1)k}{2}\left(2n-1).\end{equation}   (3)

Now the $(k-1)st$ triangular number is equal to the sum of the first $k-1$ integers, so it’s also equal to the right hand side of equation (2). This means that expression (3) is equal to

  \[ (2n-1)T_{k-1}. \]    

Now notice that the numbers in the second row of $S$ are 2 times the numbers in the first row, so their sum is equal to

  \[ 2(2n-1)T_{k-1}. \]    

The numbers in the second row of $S$ are 3 times the numbers in the first row, so their sum is equal to

  \[ 3(2n-1)T_{k-1}. \]    

We can continue in this vein until we come to the sum of the last row of $S$, which is equal to

  \[ (k-1)(2n-1)T_{k-1}. \]    

Adding up the sums of all the rows in $S$ therefore gives

  \begin{equation} (2n-1)T_{k-1}+2(2n-1)T_{k-1}+ ... +(k-1)(2n-1)T_{k-1}.\end{equation}   (4)

Factoring out the $(2n-1)T_{k-1}$ transforms this sum to

  \begin{equation} (2n-1)T_{k-1}\left(1+2+3+...+(k-1)\right).\end{equation}   (5)

Now the second bracket here is equal to $T_{k-1}$, the $(k-1)st$ triangular number. Therefore our sum (5) is equal to

  \[ (2n-1)T_{k-1}^2, \]    

as we claimed.

Return to the main article

  • Want facts and want them fast? Our Maths in a minute series explores key mathematical concepts in just a few words.

  • What do chocolate and mayonnaise have in common? It's maths! Find out how in this podcast featuring engineer Valerie Pinfield.

  • Is it possible to write unique music with the limited quantity of notes and chords available? We ask musician Oli Freke!

  • How can maths help to understand the Southern Ocean, a vital component of the Earth's climate system?

  • Was the mathematical modelling projecting the course of the pandemic too pessimistic, or were the projections justified? Matt Keeling tells our colleagues from SBIDER about the COVID models that fed into public policy.

  • PhD student Daniel Kreuter tells us about his work on the BloodCounts! project, which uses maths to make optimal use of the billions of blood tests performed every year around the globe.