Update p_nun

Add Tail recursion and recursion