I can tell you now to avoid it being after the fact.
Step 1) Take the last 10 digits of the block hash (in hex)
Step 2) Convert that to a decimal number.
Step 3a) If the number is 1099511622840 or larger the draw is void. Repeat steps #1 to #3 on the next block.
Step 3b) If the number is < 1099511622840 then you have a valid random number. Continue to step #4
Step 4) Winning Ticket = (random number) mod 40270
The only change is "Voiding" random # 1099511622840 and up because they are "uneven". The odds of that happening are ~ 1 in 222 million.
Like I said if you do something else I won't mind as I trust you. I just think it is useful example of using the blockchain to avoid needing implicit trust. Kinda an extension of the rational for creation Bitcoin in the first place.