A Common example of a recursive formula is one to compute the sum of the first n integers, 1 + 2 + 3 + …+ n. The recursive formula can be expressed as
1 + 2 + 3 + … + n = n + (1 + 2 + 3 + …+ (n – 1))
Write a static method that implements this recursive formula to compute the sum of the first n integers. Place the method in a test program that allows the user to enter the values of n until signaling an end to execution. Your method definition should not use a loop to add the first n integers.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.