Garmin interview question

A recursion problem with prime numbers