User blog comment:I am a McCree God/Number of Possible Combinations in 1,000,000x1,000,000x1,000,000 Rubik's Cube/@comment-5529393-20171215043217/@comment-5529393-20171215184100

That first formula gives the correct value for n = 3. Did you apply the mod and floor functions correctly?