Determine whether each of these proposed definitions is a valid recursive definition of a function from the set $f$ of nonnegative integers to the set of integers. If $f$ is well defined, find a formula for $f(n)$ when $n$ is a nonnegative integer and prove that your formula is valid.
$a) f(0) = 1, f(1)=0, f(2)=2, f(n)=2f(n-3)$ for $n\geq3$
$b) f(0) = 2, f(n)=f(n-1)$ if $n$ is odd and $n \geq 1$ and $f(n) = 2f(n-2)$ if $n \geq 2$
I'm having trouble with these two mostly because they might involve a floor or a ceiling function and I have no idea how to do induction on that. any help would be appreciated!
hint for the first
for $k\ge 0$,
$$f (3k)=2f (3 (k-1))=2^kf (0)=2^k $$
$$f (3k+1)=2f (3 (k-1)+1)=2^kf (1)=0$$
$$f (3k+2)=2f (3 (k-1)+2)=2^kf (2)=2^{k+1} $$