import Image x=p=141 i=Image.new('1',(x,11)) while~-p:x=p/2*x/p+2*10**19;p-=2 for c in str(x):[i.putpixel((j%7/5*4-~j%7/4*~j/7+p,j%7*3%14%8+j%14/10+2),1&ord('}`7gjO_a\177o'[int`7gjO_ao'[int(c)])>>j%7)for j in range(17)];p+=7 i.show() The byte count assumes that the escaped character \177`` is replaced with its literal equivalent (char 127).
import Image n=input() x=p=n*7|1 i=Image.new('1',(x,11)) while~-p:x=p/2*x/p+2*10**(n-1);p-=2 for c in str(x):[i.putpixel((j%7/5*4-~j%7/4*~j/7+p,j%7*3%14%8+j%14/10+2),1&ord('}`7gjO_a\177o'[int`7gjO_ao'[int(c)])>>j%7)for j in range(17)];p+=7 i.show() $$\frac{\pi}{4}=\sum\limits_{n=0}^\infty\frac{(-1)^n}{2n+1}=1-\frac{1}{3}+\frac{1}{5}-\frac{1}{7}+\frac{1}{9}-\frac{1}{11}+\frac{1}{13}-\dots$$
$$\frac{\pi}{4}=\frac{1}{2}+(\frac{1}{2}-\frac{1}{6})-(\frac{1}{6}-\frac{1}{10})+(\frac{1}{10}-\frac{1}{14})-(\frac{1}{14}-\frac{1}{18})+(\frac{1}{18}-\frac{1}{22})-(\frac{1}{22}-\frac{1}{26})+\dots$$
$$\frac{\pi}{4}=\frac{1}{2}+\frac{1}{3}-\frac{1}{15}+\frac{1}{35}-\frac{1}{63}+\frac{1}{99}-\frac{1}{143}+\dots$$
$$\frac{\pi}{4}=\frac{1}{2}+\sum\limits_{n=0}^\infty\frac{(-1)^n}{(2n+1)(2n+3)}$$
$$\frac{\pi}{4}=\frac{1}{2}+\frac{1}{6}+(\frac{1}{6}-\frac{1}{30})-(\frac{1}{30}-\frac{1}{70})+(\frac{1}{70}-\frac{1}{126})-(\frac{1}{126}-\frac{1}{198})+(\frac{1}{198}-\frac{1}{286})-\dots$$
$$\frac{\pi}{4}=\frac{1}{2}+\frac{1}{6}+\frac{2}{15}-\frac{2}{105}+\frac{2}{315}-\frac{2}{693}+\frac{2}{1287}-\dots$$
$$\frac{\pi}{4}=\frac{1}{2}+\frac{1}{6}+\frac{1}{15}+(\frac{1}{15}-\frac{1}{105})-(\frac{1}{105}-\frac{1}{315})+(\frac{1}{315}-\frac{1}{693})-(\frac{1}{693}-\frac{1}{1287})+\dots$$
$$\frac{\pi}{4}=\frac{1}{2}+\frac{1}{6}+\frac{1}{15}+\frac{2}{35}-\frac{2}{315}+\frac{2}{1155}-\frac{2}{3003}+\dots$$
$$\frac{\pi}{4}=\frac{1}{2}+\frac{1}{6}+\frac{1}{15}+\frac{1}{35}+(\frac{1}{35}-\frac{1}{315})-(\frac{1}{315}-\frac{1}{1155})+(\frac{1}{1155}-\frac{1}{3003})-\dots$$
$$\frac{\pi}{4}=\frac{1}{2}+\frac{1}{6}+\frac{1}{15}+\frac{1}{35}+\frac{8}{315}-\frac{8}{3465}+\frac{8}{15015}-\dots$$
$$\frac{\pi}{4}=\frac{1}{2}+\frac{1}{6}+\frac{1}{15}+\frac{1}{35}+\frac{4}{315}+(\frac{4}{315}-\frac{4}{3465})-(\frac{4}{3465}-\frac{4}{15015})+\dots$$
$$\frac{\pi}{4}=\frac{1}{2}+\frac{1}{6}+\frac{1}{15}+\frac{1}{35}+\frac{4}{315}+\frac{8}{693}-\frac{8}{9009}+\dots$$
$$\frac{\pi}{4}=\frac{1}{2}+\frac{1}{2\cdot+3}+\frac{1}{3\cdot+5}+\frac{1}{5\cdot+7}+\frac{2^2}{3^2\cdot+5\cdot+7}+\frac{2^2}{3^2\cdot+7\cdot+11}+\dots$$
$$\frac{\pi}{4}=\frac{1}{2}+\frac1{2\cdot+3}+\frac1{3\cdot+5}+\frac{3}{3\cdot+5\cdot+7}+\frac{2^2\cdot+3}{3\cdot+5\cdot+7\cdot+9}+\frac{2^2\cdot+3\cdot+5}{3\cdot+5\cdot+7\cdot+9\cdot+11}+\dots$$
$$\frac{\pi}{2}=1+\frac{1}{3}+\frac{2}{3\cdot+5}+\frac{2\cdot+3}{3\cdot+5\cdot+7}+\frac{2^3\cdot+3}{3\cdot+5\cdot+7\cdot+9}+\frac{2^3\cdot+3\cdot+5}{3\cdot+5\cdot+7\cdot+9\cdot+11}+\dots$$
$$\frac{\pi}{2}=1+\frac{1}{3}+\frac{2}{3\cdot+5}+\frac{2\cdot+3}{3\cdot+5\cdot+7}+\frac{2\cdot+3\cdot+4}{3\cdot+5\cdot+7\cdot+9}+\frac{2\cdot+3\cdot+4\cdot+5}{3\cdot+5\cdot+7\cdot+9\cdot+11}+\dots$$
$$\frac{\pi}{2}=1+\frac{1}{3}(1+\frac{2}{5}+\frac{2\cdot+3}{5\cdot+7}+\frac{2\cdot+3\cdot+4}{5\cdot+7\cdot+9}+\frac{2\cdot+3\cdot+4\cdot+5}{5\cdot+7\cdot+9\cdot+11}+\dots$$
$$\frac{\pi}{2}=1+\frac{1}{3}(1+\frac{2}{5}(1+\frac{3}{7}+\frac{3\cdot+4}{7\cdot+9}+\frac{3\cdot+4\cdot+5}{7\cdot+9\cdot+11}+\dots$$
$$\frac{\pi}{2}=1+\frac{1}{3}(1+\frac{2}{5}(1+\frac{3}{7}(1+\frac{4}{9}+\frac{4\cdot+5}{9\cdot+11}+\dots$$
$$\frac{\pi}{2}=1+\frac{1}{3}(1+\frac{2}{5}(1+\frac{3}{7}(1+\frac{4}{9}(1+\frac{5}{11}(1+\dots+\frac{n}{2n+1}(1+\dots$$
$$x_{n}=1+\frac{n}{2n+1}x_{n+1}$$