Add common number theory functions