When, how & who first gave this calculation of $\pi$

I came across this interesting method to calculate $\pi$. Why is it true and who first presented it?

To calculate $\pi$, multiply by $4$, the product of fractions formed by using, as the numerators. the sequence of primes $> 2$ ..i.e. $3,5,7,11,13,17$ etc and use as denominators the multiple of $4$ that is closest to the numerator and you will get as accurate value of $\pi$ that you like. In other words,

$$ \frac \pi 4 = \frac 3 4 \cdot \frac 5 4 \cdot \frac 7 8 \cdot \frac{11}{12} \cdot \frac{13}{12} \cdot \frac{17}{16}\cdots $$


This result is due to Euler, in a paper published in $1744$, entitled "Variae observationes circa series infinitas".

An English translation of the paper may be found here, and the quoted result on page $11$ in that link.

enter image description here

The proof follows from the series expansion for $\arctan$, giving: $$\frac{\pi}{4}=1-\frac{1}{3}+\frac{1}{5}-\frac{1}{7}+\frac{1}{9}-\ldots$$ So that: $$\frac{1}{3}\cdot\frac{\pi}{4}=\frac{1}{3}-\frac{1}{9}+\frac{1}{15}-\frac{1}{21}+\ldots$$ Adding the two together, we get rid of the $1/3, 1/9$ and all other multiples of $1/3$. $$\frac{4}{3}\cdot\frac{\pi}{4} = \left(1+\frac{1}{3}\right)\frac{\pi}{4} =1+\frac{1}{5}-\frac{1}{7}-\frac{1}{11}+\ldots$$ Repeat the same trick to get rid of the $1/5, 1/10, 1/15$ etc.: $$\frac{4}{5}\cdot\frac{4}{3}\cdot\frac{\pi}{4} = \left(1-\frac{1}{5}\right)\frac{4}{3}\cdot\frac{\pi}{4} =1-\frac{1}{7}-\frac{1}{11}+\frac{1}{13}+\ldots$$ If you continue this sequence, all compound factors get removed, and you are left with only with prime values in the denominator, and either one above or one below the prime in the numerator: $$\cdots\frac{12}{11}\cdot\frac{8}{7}\cdot\frac{4}{5}\cdot\frac{4}{3}\cdot\frac{\pi}{4} = 1$$ Inverting gives the desired result: $$\frac{\pi}{4} = \frac{3}{4}\cdot\frac{5}{4}\cdot\frac{7}{8}\cdot\frac{11}{12}\cdot\ldots$$


Wikipedia attributes it to Euler, but they don't have a reference to any resource. It's hard to google a formula, so I had to search for "pi identities" and "Euler pi identities." I checked a handful of more sites and they all ascribe the identity to Euler. But I can't find any information on the date or publication/letter where this identity first appears.