Running time of a function $P$ calling itself via $P(P(n/2))$
There is an unwritten assumption that the input is always at least $1$ (otherwise your function never terminates). Under this assumption, it is easy to prove by induction that the function does terminate, and always returns $1$. Therefore in the expression $P(P(n/2))$, we are first invoking $P$ with the input $n/2$, and then with the input $1$. It follows that the running time $T(n)$ of your function satisfies the recurrence $$ T(n) = T(\lfloor n/2 \rfloor) + \Theta(1), $$ with initial condition $T(1) = \Theta(1)$. The solution is $T(n) = \Theta(\log n)$.