Sundaram's Sieve

Issue 50
March 2009

Step 1 — Solution

The first row starts with the number 4. The starting number of any other row is 3 steps on from that of the previous one. This tells us that the first number in row m is of the form

4 + 3(m-1) = 3m + 1.

The difference between successive numbers in the first row is 3, and the difference between successive numbers in any other row is 2 greater than the difference in the previous row. This means that the difference between successive numbers in row m is

3 + 2(m-1) = 2m + 1.

The nth entry in row m is equal to the first entry plus (n-1) times the difference in that row, so the nth entry in row m is

3m + 1 + (n-1) (2m + 1) = (2n+1)m + n.

Got it, on to the next step;
Back to the main article