A double recursive function (ping-pong) between function to itself complexity analysis
Notice that the outer RecFunc call is just a &quot;decoy&quot; thrown in there to make the exercise seem more complicate than it is.
Indeed, it is irrelevant as far as the asymptotic time complexity is concerned. This is because every call to RecFunc eventually returns $1$ (that's the only possible returned value, you can prove by induction that RecFunc eventually returns), and therefore the last (outer) call to RecFunc will just be RecFun(3), which terminates in constant time. We can charge this constant time to the caller function.
Since the caller is going to spend $\Theta(1)$ time anyway, this doesn't change anything.
Then you want to analyze:
def RecFunc(n):
   if n &lt;= 3:
      return 1

   return RecFunc(n/3) + RecFunc(n/2) + RecFunc(n/2)

Whose running time is described by the recurrence equation:
$$
T(n)=2T(n/2) + T(n/3) + \Theta(1),
$$
which can be solved using the Akra–Bazzi method. Let $p$ such that:
$
2 \cdot \frac{1}{2^p} + \frac{1}{3^p} = 1.
$
Clearly $p&gt;0$. Then:
$$
\int_{u=1}^n \frac{1}{u^{p+1}} \mathrm{d}u =
\int_{u=1}^n {u^{-p-1}} \mathrm{d}u =
-\frac{1}{p} \cdot  \left| u^{-p} \right|_{u=1}^n 
= \frac{1}{p} \cdot \left( 1 - \frac{1}{n^p} \right)
= \Theta(1),
$$
and you have:
$T(n) = \Theta(n^p)$. An approximation of $p$ is $1.3646$.
The space complexity is clearly $\Theta(\log n)$ since this is the maximum recursion depth.