Grandfather's Math - clever scheme

Grandson's Math - algorithm.