title: Continued fraction, serie and the Ramanujan Easiest Theorem
body: <p>Based on <a href="https://math.ucr.edu/home/baez/ramanujan/ramanujan_whittier_web.pdf" rel="nofollow noreferrer">this</a> interesting presentation on the web, I tried to prove by programming that</p>
  <p><img src="https://latex.codecogs.com/png.latex?%5Cbg_white&space;%5Cleft(&space;%5Cfrac%7B1%7D%7B1%7D&space;&plus;&space;%5Cfrac%7B1%7D%7B1&space;%5Ccdot&space;3%7D&space;&plus;&space;%5Cfrac%7B1%7D%7B1&space;%5Ccdot&space;3&space;%5Ccdot&space;5%7D&space;&plus;&space;%5Ccdots&space;%5Cright&space;)&space;&plus;&space;%5Cfrac%7B1%7D%7B1&plus;&space;%5Cfrac%7B1%7D%7B1&plus;&space;%5Cfrac%7B2%7D%7B1&space;&plus;&space;%5Cfrac%7B3%7D%7B1&space;&plus;&space;%5Cfrac%7B4%7D%7B%5Cddots%7D%7D%7D%7D%7D&space;=&space;%5Csqrt%7B%5Cfrac%7B%5Cpi&space;e%7D%7B2%7D%7D" title="\left( \frac{1}{1} + \frac{1}{1 \cdot 3} + \frac{1}{1 \cdot 3 \cdot 5} + \cdots \right ) + \frac{1}{1+ \frac{1}{1+ \frac{2}{1 + \frac{3}{1 + \frac{4}{\ddots}}}}} = \sqrt{\frac{\pi e}{2}}" /></p>
  <p>I used Octave but I faced a large error in the computation. Where is my mistake?</p>
  <p><a href="https://i.stack.imgur.com/pC0wB.gif" rel="nofollow noreferrer">Diagram</a></p>
  <p>Here is the code:</p>
  <pre><code>function [ref, reali, err] = rama(n)
    a(1) = 1;
    for i=2:n
      a(i) = (2*i+1)*a(i-1);
    endfor
    b = 1./a;
    S = sum(b);
  
    p = '1';
    for k = n:-1:1
      s = int2str(k);
      p = ['1+' s '/( ' p ' )'];
    endfor
    P = str2num(p);
    P ^=(-1);
  
    ref = S + P;
    reali = sqrt(pi*exp(1)*0.5);
    err = abs(reali - ref);
  endfunction
  </code></pre>