Post Reply 
Continuous fractions in CAS
09-23-2020, 11:22 AM
Post: #1
Continuous fractions in CAS
I wanted to improve my knowledge about continuous fractions, to be able to compete with Gerson and Albert. Smile
I noticed that the CAS of the Prime has the two functions dfc and dfc2f, really fun to use to simplify the comprehension of continuous fractions.

Well indeed it works well, ie. dfc(π) returns [3,7,15,1,292,1,1,1,2], and dfc2f([3,7,15,1,292,1,1,1,2]) returns 833719/265381, which is a good approximation for π (3.14159265358).

Let’s continue with sqrt(2)
dfc(sqrt(2)) returns [1,2,2,2,2,2,2,2,2,2,2,2,2,2,2] (good!) and dfc(sqrt(2),5) returns... [1,2,[2]]

Here are my questions!
1- What does this last result [1,2,[2]] mean? I guess it means “repeat 2 until the end of times”, but I just discover this syntax. And why isn’t it also the answer for dfc(sqrt(2)) (I let the default epsilon value in CAS params) ?
2- How can I create such an array? I tried to edit it manually: (shift) (5[]) (1) (right) (2) (shift) (5[]) but it doesn’t open new brackets. When I use an external editor, as simple as the Notes app of the Prime, I can textually create [1,2,[2]], and with the copy-paste function I can paste it in the CAS environnement.

Thanks!

Thibault - not collector but in love with the few HP models I own - Also musician : http://walruspark.co
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Continuous fractions in CAS - pinkman - 09-23-2020 11:22 AM
RE: Continuous fractions in CAS - pinkman - 09-23-2020, 09:28 PM
RE: Continuous fractions in CAS - pinkman - 09-23-2020, 10:05 PM
RE: Continuous fractions in CAS - Joe Horn - 09-24-2020, 01:12 AM
RE: Continuous fractions in CAS - pinkman - 09-24-2020, 07:14 AM
RE: Continuous fractions in CAS - Han - 03-05-2021, 01:38 AM



User(s) browsing this thread: 1 Guest(s)