$ python2.5 Python 2.5.6 (r256:88840, Oct 11 2012, 20:14:10) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> magic = chr(17)+chr(11)+chr(119)+chr(60)+chr(47)+chr(44)+chr(78)+chr(103)+chr(125)+chr(48) >>> for r in ["M", "D", "C", "L", "X", "V", "I"]: ... n = hash(r + magic) % 1001 ... print r, n ... M 1000 D 500 C 100 L 50 X 10 V 5 I 1