Practice problems for the week of Feb 14

Note: This is a set of problems that will help you in preparing for the lab next week. However, the lab assignment are not going to be identical to these problems.
  1. Write a procedure that takes an integer n and returns the number of digits in n. Use only commands covered in class.
  2. Write a procedure that takes in integers n and i and returns the ith least significant digit of n.
  3. Apply the seq() command and the previous procedures to make a set of the digits used in an integer.
  4. Use set minus to compute what digits do not appear in an integer.
  5. Write a procedure that takes as input an integer n and returns all integers in 1..n that are not factorials. E.g. in the range 1..10, 1, 2, 6 are factorials (equal to 1!,2!,3! respectively).