I don't know if this is not solvable by math, and if not I am sorry to have wasted your time.
I have this formula:
x=a + (b * (b - 1) / 2)
and I know these facts: all numbers are integers, a & b are in the range 0-63, and a < b.
Using the above formula, I get a x as a unique number between 0 and 2015 for each (a,b) pair.
To solve for a & b for a given x I use this (from a computer program):
b = Truncate((0.5 + Sqrt(1 + (8 * x)) / 2))
a = x - (b * (b - 1) / 2)
So far so good.
I am trying to do the same with 3 variables a,b,c, and that is where the trouble starts.
I have the formula:
x=a + (b * (b - 1) / 2) +(c * (c - 1) * (c - 2)) / 6)
Which works fine for all tested sets from (0,1,2) -> (62,63,64). Verified with x between 0 and 41663.
How do I solve for a,b,c in this case ?
I have this formula:
x=a + (b * (b - 1) / 2)
and I know these facts: all numbers are integers, a & b are in the range 0-63, and a < b.
Using the above formula, I get a x as a unique number between 0 and 2015 for each (a,b) pair.
To solve for a & b for a given x I use this (from a computer program):
b = Truncate((0.5 + Sqrt(1 + (8 * x)) / 2))
a = x - (b * (b - 1) / 2)
So far so good.
I am trying to do the same with 3 variables a,b,c, and that is where the trouble starts.
I have the formula:
x=a + (b * (b - 1) / 2) +(c * (c - 1) * (c - 2)) / 6)
Which works fine for all tested sets from (0,1,2) -> (62,63,64). Verified with x between 0 and 41663.
How do I solve for a,b,c in this case ?