Thread: Silliness Quiz
View Single Post
Old 09-27-2012, 09:40 AM   #9337
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 71,508
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
Quote:
Originally Posted by Hamlet53 View Post
Not my place at all to pose a question, but since for the moment this seems to be in a interlude to discuss golf . . .

When I see series like this I am always interested in a general formula. So suppose instead of 12 days, your true love gives you 365 days of gifts, under the same sort of progression. First day one gift, second day two gifts and repeat of the first day gift, etc. How many total gifts at the end?

This is not the official question so do not let it interrupt the next in line.
Rambling real-time working out of formula in spoiler tags for brevity.
Spoiler:
OK, the way to work it out is like this:

On the 1st day you get 1
On the 2nd day you get 2 + 1
On the 3rd day you get 3 + 2 + 1
.
.
On the nth day you get n+(n-1)+...+1

Now the sum n+(n-1)+...+1 = n(n+1)/2

So to get the total we need to add up

1*2/2, 2*3/2, 3*4/2, ... , n(n+1)/2

Obviously the factor of two is common, so we can simplify to

(1*2 + 2*3 + 3*4 + ... + n*(n+1))/2

Which looks complex, and we'll make it more complex still by remembering the general formula for each term and expanding that.

((1*1+1) + (2*2+2) + (3*3+3) + .... + (n*n + n))/2

But now we can split it into two sequences

((1*1) + (2*2) + (3*3) + .... (n*n))/2 + (1 + 2 + 3 + ... + n)/2

Now the second bit is just n(n+1)/4 (we used the same formula above).

And there is a formula for the sum of squares, so the first bit is just n(n+1)(2n+1)/12 (Proof of the sum of squares formula can be found here.)

So the total number of presents for any n days is

n(n+1)(2n+1)/12 + n(n+1)/4 which simplifies to

n(n+1)(2n+4)/12 which simplifies to:


n(n+1)(n+2)/6

A remarkably pleasing result, which could probably be derived more simply.

Check for 12: 12*13*14/6 = 364.

So for 364 days: 364*365*366/6 = 8,104,460

Last edited by pdurrant; 09-27-2012 at 01:53 PM.
pdurrant is online now   Reply With Quote