This is easy. The calculations you make in the beginning will always give one number from a pre-set list of results. Let me explain: if the chosen number is between 10 and 19, the result will always be 9; If the chosen number is between 20 and 29, the result will always be 18; If 30~39 = 27; If 40~49 = etc... etc... etc...
Now the funny part, try the game and read which prizes are in the numbers 9, 18, 27, 36, 45, etc... You'll understand how it works right away.
EDIT: Damn, geXXos beat me to it... I hate you, bro!