recursively find paths whose sum is certain value