I coded a solution that can compute the ordering numbers for random.shuffle(range(1, 1000001)) in 2.5 seconds (typical, Win 2K Pro, Pentium 4 2.40GHz 785Meg RAM)
Are you sure that this is not a homework problem? -- http://mail.python.org/mailman/listinfo/python-list