Skip to content

Instantly share code, notes, and snippets.

@icyflame
Created July 24, 2013 07:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icyflame/6068586 to your computer and use it in GitHub Desktop.
Save icyflame/6068586 to your computer and use it in GitHub Desktop.
Code for the solution of the fourth problem
def pseudoRandomGen():
X = 42
a = 25
c = 31
m = 2 ** 20
for i in range(1,2001):
X = (a * X + c) % m
return X
print 'The 200th number is:', pseudoRandomGen()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment