OEIS A229580 mini challenge (RPL)
|
05-02-2018, 08:59 PM
Post: #28
|
|||
|
|||
RE: OEIS A229580 mini challenge (RPL)
(05-02-2018 04:59 PM)Valentin Albillo Wrote: You're welcome, thanks for the explanation. Dealing with continued fractions and their theory is a math topic I find remarkably interesting so I welcome any challenge or problem having to do with them. However I think you were right in the first place, a recursive formula could have indeed been of help for my particular application. In the program below I have used a closed-form formula to compute the last denominator of the continued fraction, but I might as well have computed it using a recursive formula, every term being computed at each step of the first FOR-NEXT loop. Regards, Gerson. =============== >list 10 DESTROY ALL 15 INPUT N 20 S1=0 @ S2=0 @ P=1 25 FOR I=1 TO N 30 P=4*P @ S1=S1+1/(2*I-1)^2 35 NEXT I 40 P=P/4 @ A=2*N-1 @ B=8*N+4 @ D=(2*N+1)*P 45 FOR I=N TO 1 STEP -1 47 PRINT D*A/B 50 S2=I^4/(D*N+S2) @ D=D*A/B @ A=A-2 @ B=B-8 55 NEXT I 60 S2=1/(4*N+S2) 65 PRINT 8*(S1+S2) >run ? 12 24117248 5505024 1245184 278528 61440 13312 2816 576 112 20 3 .25 9.86960440168 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)