recursion with numpy