Formula for the perfect boiled egg (letter in the current issue of New Scientist):
Cooking time = (m 2/3) * [In(2 × (t - 100)) / (45 - 100)]/c
t = initial egg temperature in celsius
m = mass of egg in grams
C = a constant (3.758)
Alternative method: throw in boiling-ish water and take out when you don't want to wait any longer.