Well, the first step to debug your solution was to print after each iteration, k, iteration result (delta) and cumulative sum (pi).
double pi = 0;
for (int k = 0; k <= 25; k++)
{
double delta = ((Math.Pow((-1), k)) / (Math.Pow(2, (10 * k)))) *
(-(Math.Pow(2, 5) / ((4 * k) + 1))
- (1 / ((4 * k) + 3))
+ (Math.Pow(2, 8) / ((10 * k) + 1))
- (Math.Pow(2, 6) / ((10 * k) + 3))
- (Math.Pow(2, 2) / ((10 * k) + 5))
- (Math.Pow(2, 2) / ((10 * k) + 7))
+ (1 / ((10 * k) + 9)));
delta /= (Math.Pow(2, 6));
pi += delta;
Console.WriteLine(string.Format("k={0}, delta={1}, pi={2}", k, delta, pi));
}
The result look like:
k=0, delta= 3,14523809523809, pi=3,14523809523809
k=1, delta=-0,000174677880330454, pi=3,14506341735776
k=2, delta= 8,26144783365773E-08, pi=3,14506349997224
k=3, delta=-5,28924035141653E-11, pi=3,14506349991935
k=4, delta= 3,83576851413217E-14, pi=3,14506349991939
k=5, delta=-2,97726903990637E-17, pi=3,14506349991939
k=6, delta= 2,41181903757061E-20, pi=3,14506349991939
k=7, delta=-2,01195711199672E-23, pi=3,14506349991939
k=8, delta= 1,71468942661398E-26, pi=3,14506349991939
The first problem with your code is that you are incorectly doing some computation in integer arithmetic instead of double.
double d1 = 1 / 3;
double d2 = 1 / 3.0;
double d3 = 1.0 / 3;
double d4 = 1.0 / 3.0;
If you replace some integer constants with double, you will have more sensible result. Here is the modified code (I have changed only a few value to double for demonstration purpose.
double pi = 0;
for (int k = 0; k <= 25; k++)
{
double delta = ((Math.Pow((-1), k)) / (Math.Pow(2, (10 * k)))) *
(-(Math.Pow(2, 5) / ((4 * k) + 1.0))
- (1.0 / ((4 * k) + 3))
+ (Math.Pow(2, 8) / ((10 * k) + 1.0))
- (Math.Pow(2, 6) / ((10 * k) + 3.0))
- (Math.Pow(2, 2) / ((10 * k) + 5.0))
- (Math.Pow(2, 2) / ((10.0 * k) + 7))
+ (1 / ((10 * k) + 9.0)));
delta /= (Math.Pow(2, 6));
pi += delta;
Console.WriteLine(string.Format("k={0}, delta={1}, pi={2}", k, delta, pi));
}
The result would look like:
k=0, delta= 3,14176587301587, pi=3,14176587301587
k=1, delta=-0,000173301147482709, pi=3,14159257186839
k=2, delta= 8,17736604635702E-08, pi=3,14159265364205
k=3, delta=-5,22954018637708E-11, pi=3,14159265358975
k=4, delta= 3,78997628626364E-14, pi=3,14159265358979
k=5, delta=-2,94045250629684E-17, pi=3,14159265358979
k=6, delta= 2,38126583625258E-20, pi=3,14159265358979
k=7, delta=-1,98601694415512E-23, pi=3,14159265358979
k=8, delta= 1,69228385223704E-26, pi=3,14159265358979
k=9, delta=-1,46572566668089E-29, pi=3,14159265358979
Finally, as you can notice from this sample, after a few iterations, the displayed result won't change anymore. As it was mentionned in some comments above, you would have to somehow use large numbers to do the computation.
I have not read carefully the whole explanation in the provided links. But for task like this one, you must uses appropriate data type and also have some basic understanding on how floating point works and such.