indexes are just representation of number n-1 in notation with base 3 - so laserlight's formulas are just one of ways to convert the number to this notation...