0

I recall that there is a formula for calculating an arithmetic series (the sum of an arithmetic sequence). But is there a shortcut for calculating the sum, from n=1 to k, of n(a1 + an)/2 (shortcut, as in something more computationally efficient than evaluating n(a1 + an)/2 at each n and summing the results)

To use an obvious example given the current season: According to the song, "The Twelve Days of Christmas," at the end of the 12 days, the recipient should have received 364 gifts. Is there a formula where I'd plug in n=12 and get 364?

  • These answers seem to hint at a possible formula, but don't seem to really give one: https://math.stackexchange.com/questions/1578221/calculating-the-12-days-of-christmas-by-hand\ – moonman239 Dec 24 '21 at 21:44
  • 1
    They don't just hint at the answer, they give you the answer. – Rushabh Mehta Dec 24 '21 at 21:46
  • @DonThousand Sort of, but not really. They seem to jump to the answer without really explaining how they got there. – moonman239 Dec 24 '21 at 22:13
  • That being said, I've come up with somewhat of a formula of my own. n(n+1)/2 + (n-1)((n-1)+1)/2 = (n^2 + n) / 2 + (n^2 - n)/2 = 2n^2 = n^2, so a possible solution is k^2 + (k-2)^2 + (k-4)^2+...+(k-k)^2 – moonman239 Dec 24 '21 at 22:16

0 Answers0