--- from: http://rosettacode.org/wiki/EKG_sequence_convergence