added LCM to eulerlib, rearranged slightly.
reimplemented 5