Program for computing the first n terms in a sequence - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Program for computing the first n terms in a sequence

a-teama-team Posts: 2Member
Hey everyone,

I have to write a program to generate the first n terms in the sequence given by the difference equation:

xk+1=111-(1130-3000/xk-1)/xk,

with starting values x1=11/2 and x2=61/11

I have to use n=10 if I am working with single precision and n=20 if I am working with double precision.

By the way, k+1, k-1, and k are all subscripts. So, xk+1 is really x "subscript" k+1, not 1 added to xk, and xk-1 is really x "subscript" k-1, not 1 subtracted from xk. Thank you very much for your help.
Sign In or Register to comment.