4-1 recursive solution