modular arithmetic python site:stackoverflow.com - Search