我必须写一个简单的递归方法来计算m(i) = (1/2) + (2/3) + ... + i/(i+1)。我觉得这应该非常简单,但我无法弄清楚。我知道我必须通过递减来循环,但我就是无法得到它。到目前为止,我有以下内容,我知道这是完全错误的。
public class Recursion {
    public static void main(String[] args) {
        double n = run(10);
        System.out.print("Result: " + n);
    }
    public static double run(double nb) {
        double result = 0;
        if(nb == 2){
            return 1/2;
        }
        result += run(nb - 2) / run(nb - 1);
        return result;
    }
}