Question: Write a Fortran program geom.f95 which accepts r as input, and evaluates the partial sums Sn for n 0, 1 , until Sn and Soo

 Write a Fortran program geom.f95 which accepts r as input, and

Write a Fortran program geom.f95 which accepts r as input, and evaluates the partial sums Sn for n 0, 1 , until Sn and Soo agree to 5 decimal places. NB: You can evaluate the partial sums using the closed form 2, you don't need to manually sum the series using equation 1. (Although using equation 1 to check equation 2 would be some additional Fortran practice...) Your program should check that the value of r entered is in the requested range, and print a suitable message (and avoid doing any calculations) if it is not. It should write to the screen the value of n for which this agreement is reached, together with S and S in (non-exponential) decimal notation with 6 decimal places. What value of n is required for r 0.5? 2.6 In a famous anecdote, Srinivasa Ramanujan noted to G. H. Hardy that 1729 is the smallest number program that can be expressed as the sum of two cubes in two different ways. Write a fortran ramanujan.f95 that writes to the screen the two pairs of positive integers, a and b, that satisfy 3 1729 Hint: You should define nested do loops that consider all possible values of and b. over suitable ranges; inside the inner loop you should test for cascs that satisfy the required relation Harder (optional): adapt your Fortran program from above to find the next smallest integer that can similarly be expressed as the sum of cubes in two different ways. If you've done all of the above, please continue exploring Fortran via the Introduction to Fortran' bookle, the more comprehensive Detailed Fortran Notes', and/or some of the Fortran books on the course reading list

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!