[ create a new paste ] login | about

Link: http://codepad.org/ht3M6XJw    [ raw code | output | fork ]

Perl, pasted on Dec 3:
1
2
3
4
5
6
for (0..60) {
  @a=($_%4-1,$_<2)x$_;
  @a=map$_*($a[$_-1]+$a[$_+1])/2,0..@a-3for 2..$_;
  $_=!$_||$_/(4**$_-2**$_)*$a[1];
  print $_, $/
}


Output:
1
0.5
0.166666666666667
0
-0.0333333333333333
0
0.0238095238095238
0
-0.0333333333333333
0
0.0757575757575758
0
-0.253113553113553
0
1.16666666666667
0
-7.0921568627451
0
54.9711779448622
0
-529.124242424242
0
6192.1231884058
0
-86580.2531135531
0
1425517.16666667
0
-27298231.0678161
0
601580873.900643
0
-15116315767.0922
0
429614643061.167
0
-13711655205088.3
0
488332318973593
0
-1.92965793419401e+16
0
8.41693047573683e+17
0
-4.03380718540595e+19
0
2.1150748638082e+21
0
-1.20866265222965e+23
0
7.50086674607696e+24
0
-5.03877810148107e+26
0
3.65287764848181e+28
0
-2.84987693024509e+30
0
2.38654274996836e+32
0
-2.13999492572253e+34


Create a new paste based on this one


Comments: