I'm programming an application which will need to calculate and invert 6 variables.
e.g.
[4][20][15][16][0][1] -> (perform calculation) -> 450
450 -> (perform calculation) -> [4][20][15][16][0][1]
What would be the best direction to go to calculate and invert the calculation for these variables or nth variables if I wish to expand later on? I was looking at Matrices, linear equations, etc, but not sure the best and easiest method for programmatically making this a bidirectional equation. Edit: I’m looking to get the smallest number possible, and the range is 0 to 55 for my variables.
With 6 variables $x_0, \ldots, x_5$ all in the range $0 - 55$ you could form $$n = x_0 + 56 x_1 + 56^2 x_2 + \cdots + 56^5 x_5.$$ To revert to the variables you can do (pseudocode):