Hi,
The formula you are after is actually a summation of the term you mentioned for n = O to infinity.
The (-1)^n is not difficult since you can use -1 if n is odd ot +1 if n is even. Or since you need to increment n every time, you can toggle the sign for every n.
The biggest issue you will have is the division.
If you need a bright new idea to calculate pi, don't start with Liebniz, since
--- Quote Start ---
Calculating π to 10 correct decimal places using Leibniz' formula requires over 10,000,000,000 mathematical operations, and will take longer for most computers to calculate than calculating π to millions of digits using more efficient formulas.
--- Quote End ---
Stefaan