Pātuhitia tēnei: Elementary number theory with applications