package Recursive;
public class Exercise18_05 {
public static void main(String[] args) {
for (int i = 1; i <= 10; i++) //计算m(i),i = 1,2,...10
System.out.println("m(" + i + ") is " + m(i));
}
/** 返回数列和 */
public static double m(int i) {
double value = i / (2.0*i + 1);
return (i == 1) ? value : (value + m(i - 1));
}
}