Math, factorization
Simulation, ad hoc
Ad hoc
Extended Euclidean algorithm
Ad hoc, time waster