Secret code in Ex Machina

###Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#BlueBook code decryption
import sys
def sieve(n):
x = [1] * n
x[1] = 0
for i in range(2,n/2):
j = 2 * i
while j < n:
x[j]=0
j = j+i
return x
def prime(n,x):
i = 1
j = 1
while j <= n:
if x[i] == 1:
j = j + 1
i = i + 1
return i - 1
x=sieve(10000)
code = [1206,301,384,5]
key =[1,1,2,2,]
sys.stdout.write("".join(chr(i) for i in [73,83,66,78,32,61,32]))
for i in range (0,4):
sys.stdout.write(str(prime(code[i],x)-key[i]))
print

Which when you run with python2.7 you get the following:

ISBN = 9780199226559

Which is Embodiment and the inner life: Cognition and Consciousness in the Space of Possible Minds. and so now I have a lot more respect for the Director.

for anyone wondering, the isbn number is generated by concatenating the 1206th 301st 384th and 5th prime number of which each was subtracted 1, 1, 2, 2 …i.e.
The 1,206th prime is 9,781. -1
The 301st prime is 1,993. -1
The 384th prime is 2,657. -2
The 5th prime is 11. -2
= 9780 1992 2655 9
73,83,66,78,32,61,32 are the ascii characters for ‘ISBN = ‘
sieve is a reference to http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes which is used to reduce the number of prime candidates (here from 1 to 10000).


###References: