Some good practice with defining iterations and linear recursions in scm can be done playing around with the digits in numbers. Each positive number n can be written in decimal as d{k} d{k-1} ... d{1} d{0}, where d{k} is nonzero. for example, for n = 123, k is 2 and d{2} is 1, d{1} is 2, and d{0} is 3. A program can access the individual digits starting with the following basic functions: (define (d0 n) (remainder n 10)) (define (dk..d1 n) (quotient n 10)) With those definitions in place, for example, (d0 123) -> 3 and (dk..d1 123) --> 12 Thru combinations of these, you can access the second, third digits, etc, ultimately reaching the most significant (leftmost) digit. By the way, if (dk..d1 n) is zero, you know n is a one digit number. Using these digit access functions, define the following functions: (decimal-length n) --> k+1, where d{k} is the leading digit of n. For example (decimal-length 12321) --> 5. (i-th-digit n i) --> d{i} of n. For example (i-th-digit 1234 1) --> 3. (leading-digit n) --> d{k}, the most significant digit. (occurrences d n) --> the number of times digit d occurs in n For example (occurrences 7 123455666677799997754757377781070) --> 11. (digit-sum n) --> the sum of the digits in n. For example (digit-sum 5) --> 5, (digit-sum 123) --> 6, etc. (digital-root n) --> repeatedly apply digit-sum until the result is a single digit. For example (digital-root 123454) --> 1 (via 19 then 10 then 1). (trailing-zeroes n) --> j such that d{j} is not zero, but d{j-1} down to d{0} are zero.