# Math Help - Rwcursive Alogrithm

1. ## Rwcursive Alogrithm

Using the fact that
a mod 7 = (a7) mod 7, give a recursive algorithm for
computing
F(a) = a mod 7.
The input
a is a nonnegative integer and the output F(a) is a nonnegative
integer between 0 and 6 (e.g.
F(20) = 6).
Write the algorithm as follows:

procedure F(a)
if _________
then ___________
else
___________________

2. procedure F(a)
if $a<7$
then $a$
else $F(a-7)$