The answer to life, the universe, and everything Introduction: Deep Thought calculated The answer to life the universe and everything in a period of 7.5 million years, the solution was 42.

Write a program in any programming language that takes approx 75 seconds to calculate, starting from whatever you want, and output the number 42.

N.B. The number 42 must be calculated somehow (random numbers, whatever you prefer), not just hard-coded in your script.  

As suggested, you can't use sleep or equivalent functions. Be inventive.
This takes about 75s on a raspberry pi overclocked to 1GHz

#!/usr/bin/env python
from itertools import product, count

for n in count(1):
    i = 0
    for a, b, c, d in product(range(n), repeat=4):
        if a &gt; b &gt; c &gt; d &gt; 0 == (a*b-c*d)%n == (a*c-b*d)%n == (a*d-b*c)%n:
            i += 1
    if i == n:
        break
print i


It works because:


  42 is the only known value that is the number of sets of four
  distinct positive integers a,b,c,d, each less than the value itself,
  such that ab-cd, ac-bd, and ad-bc are each multiples of the value.
  Whether there are other values remains an open question


http://www.mathpages.com/home/kmath255.htm