Triangle Numbers

A triangle number is the number of consecutive numbers, starting with one, e.g. 1, 3 (1 + 2), 6 (1 + 2 + 3), 10 (1 + 2 + 3 + 4 + 5), etc. German mathematician Carl Friedrich Gauss said that every natural number is the sum of at most three triangular numbers. "Natural number" is the mathematical term for a positive integer.

Task

Start with the first numbered point below and attempt as many as you can. Write a program that:

  1. asks the user for a natural number
  2. calculates the triangle numbers up to the number entered
  3. check Gauss' theory by trying to find a combination of three triangle numbers that adds up to the number.

That's it, but free free to add any additional features that you think would be useful or helpful.