to get 27 possible combinations out of 3 numbers per positions do this
pos.1 pos.2 pos.3
0 1 2
3 4 5
6 7 8
so, you get: 012,015,018 - 042,045,048 - 072,075,078 - 312,315,318 - 342,345,348 - 372,375,378, 612,615,618 - 642,645,648 - 672,675,678 = 27 combinations
good luck!
source
pos.1 pos.2 pos.3
0 1 2
3 4 5
6 7 8
so, you get: 012,015,018 - 042,045,048 - 072,075,078 - 312,315,318 - 342,345,348 - 372,375,378, 612,615,618 - 642,645,648 - 672,675,678 = 27 combinations
good luck!
source