The maths behind life