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:
I still don't know if there is a formula to find which triangular numbers though :(
No comments:
Post a Comment