Arithmetic function exercise