Let's write the first few terms in a table to get a better sense for what's happening:

iEquationApproximation
1+ 4/14
2+ 4/1 - 4/3~2.666
3+ 4/1 - 4/3 + 4/5~3.466
4+ 4/1 - 4/3 + 4/5 - 4/7~2.895
5+ 4/1 - 4/3 + 4/5 - 4/7 + 4/9~3.339
6+ 4/1 - 4/3 + 4/5 - 4/7 + 4/9 - 4/11~2.976

Okay. Two things stand out:

  1. The equation goes back and forth between adding and subtracting the next term. That's similar to multiplying by 1 or -1 ... or maybe multiplying each term by -1 * (loop + 1)?
  2. As i goes up by 1, the fraction's denominator increases by 2. How can we turn 1 --> 1, 2 --> 3, 3 --> 5, etc.?