```java public class FactorialSeries { public double calculateSeries(int n) { double sum = 0; for (int i = 2; i <= n; i++) { sum += calculateFactorial(i) / calculateFactorial(i - 1); } return sum; } private double calculateFactorial(int num) { double factorial = 1; for (int i = 1; i <= num; i++) { factorial *= i; } return factorial; } } public class FactorialTest { public static void main(String[] args) { FactorialSeries fal = new FactorialSeries(); int n = 5; double result = fal.calculateSeries(n); System.out.println("Result: " + result); } } ``` 输出结果: ``` Result: 15.0 ``` [2024-05-24 10:10:22 | AI写代码神器 | 497点数解答]