Archive for December 31st, 2023

On the N Days Of Christmas, part 2

December 31, 2023

The yellow row of the table above highlights an example of one of the days: the 21 gifts given on the sixth day: 6 geese a-laying, 5 golden rings, 4 calling birds, 3 french hens, 2 turtle doves, and a partridge in a pear tree.

The right-most column (green) is the sum of each day’s gift total using the approach described in part 1.

The bottom right-most cell (purple) shows the addition of the numbers in the green cells to give the total number of gifts for the 12 days of Christmas.

The final row (blue) shows that there are:

  • 12 lots of gift 1 = 12
  • 11 lots of gift 2 = 22
  • 10 lots of gift 3 = 30
  • 9 lots of gift 4 = 36
  • 8 lots of gift 5 = 40
  • 7 lots of gift 6 = 42
  • 6 lots of gift 7 = 42
  • 5 lots of gift 8 = 40
  • 4 lots of gift 9 = 36
  • 3 lots of gift 10 = 30
  • 2 lots of gift 11 = 22
  • 1 lot of gift 12 = 12

These values also add to 364.

This amounts to multiplying each value in the sequence 12 to 1 by those numbers in reverse order, 1 to 12, then adding the resulting products:

You may notice that the first six terms in the addition above repeat, but in reverse, after the first occurrence of 42 (the meaning of life!), so the calculation can be shortened to:

This seems like a nice simplification.

But as nice as this is, it doesn’t help us with generalising to any value of n, such as 100, since even if the summation sequence can be halved for any sequence, for large values of n, that’s still a lot of numbers to multiply and add.

We’ll start exploring how to generalise to any value of n in part 3.