base 3 numbers look like this:
0,1,2,10,11,12,20,21,22,100
But they are grouped in fives so
00000, 00001, 00002, 00010, 00011, 00012, 00020, 00021, 00022, 00100
In base 3 the number 00100 = 9
So the DS On the move has 24 five-trip codes.
Look for patterns in that.
But you really should write code to take each of the small squares and average the colors to check that there really are only 3 colors in use.