Recursively defined functions

Given the following definition for the length of a list
length(L)=ifL=<> then 0 else 1+length(tail(L))
What are the steps in evaluation of length (<r,s,t,u>)

Construct a recursive definition for the function

f(n)=floor(0/2)+floor(1/2)+...+floor(n/2)
and
f(n) = (0mod2)+(1mod3)+...+(n mod(n+2)).