The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Noob requests help with recursive formula
Replies: 2   Last Post: Mar 16, 2013 3:13 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Ray Koopman

Posts: 3,383
Registered: 12/7/04
Re: Noob requests help with recursive formula
Posted: Mar 14, 2013 7:13 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Mar 13, 1:18 am, wrote:
> I have two lists, each with 99 elements; A and B. Real numbers.
> I want to form a list, C, whose elements are functions (F[])
> of A and B, and also previous elements of C itself.
> C = {F[A1/B1], F[A2/(B2-A1/C1)], F[A3/(B3-A1/C1-A2/C2)], ...,
> F[A99/(B99-A1/C1 ... -A98/C98.)}

...where the integers after A,B,C are element indices.

First define a helper function:

cr[{c_,r_},{a_,b_}] := {#, r+a/#}& @ f[a/(b-r)]

Then use FoldList. Here is an example with 3 elements:

{{a1,a2,a3},{b1,b2,b3}}][[All,1]] //InputForm

f[a2/(b2 - a1/f[a1/b1])],
f[a3/(b3 - a1/f[a1/b1] - a2/f[a2/(b2 - a1/f[a1/b1])])]}

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.