Recurrence relations when function call is made inside loop
First, those two summation are not equivalet, the reason that the $1$ is outside is because this line in your code: 

 int x=1,k;


Try to run this "by hand" and you will understand why you are addidng $1$ only once.

$\text{fun}(1)=1\\
\text{fun}(2)=2\\
\text{fun}(3)=5\\
\text{fun}(4)=15$

$$\Longrightarrow \text{fun}(n)=\begin{cases}
1;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;n=1\\
\color{red}1+\displaystyle\sum\limits_{k=1}^{n-1}\text{fun}(k)\times \text{fun}(n-k)&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;n&gt;1
\end{cases}$$



EDIT:

Step by step for n=3:

int fun (int 3)
{
  int x=1, k;
  if (3==1) return x;
  for (k=1; k&lt;3; ++k)
     x = x + fun(k) * fun(3 – k);
  return x;
}


First loop $k=1:$

$x=\color{green}1+\underbrace{\text{fun(1)}}_{=1}\times \underbrace{\text{fun(3-1)}}_{=2}=\color{red}3$

Second loop $k=2:$

$x=\color{red}3+\underbrace{\text{fun(2)}}_{=2}\times \underbrace{\text{fun(3-2)}}_{=1}=\color{blue}5$