Elementary Number Theory with Applications