How to find Triangular Numbers I read that Gauss's Eureka Theorem says that any positive integer can be represented by at most 3 triangular numbers.  So say I have some positive integer X, how do I find which 3 triangular numbers added together make that Number X?
edit: if there isn't a way to do this without just guessing and combining all combinations of 3 triangular numbers less than X, then is there a program that can do it for me?
edit 2: It looks like for some integers that there is more than 1 way to describe them using 3 triangular numbers. The way to calculate the possible number of ways is using this formula: 
http://www.3quarksdaily.com/3quarksdaily/2015/03/last-month-at-3qd-we-discovered-that-while-it-was-invented-to-solve-problems-in-counting-and-probability-pascals-triangle-c.html
I still don't know if there is a formula to find which triangular numbers though :(
 A: ( partial answer/hint) A few things, will help along the way, to make guessing easier:


*

*odd+odd=even

*even+even= even

*odd+even= odd

*squares are the sum of two consecutive triangular numbers

*At most: means it may not always be necessary, for that upper bound to occur in any given example. 


If we allow 0 to be counted as a triangular number,we can just add 0 until we hit 3.
1 is odd. From 1,2 and 3 above, we can deduce that, at least an odd number of the triangular numbers in the sum, will be odd (which happens to mean it's of odd index if you count 0 as the 0th triangular number).
2 is even. From 1,2,and 3 above, we can deduce that, There are an even number of odd index triangular numbers, in the sum ( includes the possibility of 0 of them). 
we can work out the highest index a triangular number could be using $\lfloor sqrt(2X)\rfloor$. So, in conclusion, you can find which three allow you to solve for X, by using restrictions at the very least. 
A: For all natural numbers $x$, $$\sum_{n=1}^x n$$ only create triangular numbers.
Does that answer your question?
