866 views
2 votes
Write a recursive method to compute the following series: 1 + 1/2 + 1/3 + 1/i ... Write a test program that displays m(i) for i = 1, 2, . . ., 10. You are not allowed to construct any structured objects (no array, ArrayList, String, StringBuilder, etc) and you may not use a while loop, for loop, or do/while loop to solve this problem; you must use recursion.

User Amaya
by
4.2k points

1 Answer

4 votes

We will assume that i / 1 is constant and i express i = 1 / n while n = 1,2,3,4,5,6,7 ..

Write a recursive method to compute the following series: 1 + 1/2 + 1/3 + 1/i ... Write-example-1
User Ed Barbu
by
4.8k points