My question is the following: I want to write a program that can calculate how many combinations in a given digit.
How many number combinations in 5 digits?
Which is 5 x 4 x 3 x 2 = 120 combinations!
If i understand you right, i Think this is what you want:
var n = <number> Math.pow(9,n);
This calculates how many deferent combinations you can have in n digits