Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sage: K.<a> = QuadraticField(47)
- sage: c = a.continued_fraction()
- sage: c
- [6; (1, 5, 1, 12)*]
- sage: c.convergents()
- lazy list [6, 7, 41/6, ...]
- sage: for k in [0..10]:
- ....: ck = c.convergent(k)
- ....: print "%s. convergent = %s = %s" % (k, ck, ck.n())
- ....:
- 0. convergent = 6 = 6.00000000000000
- 1. convergent = 7 = 7.00000000000000
- 2. convergent = 41/6 = 6.83333333333333
- 3. convergent = 48/7 = 6.85714285714286
- 4. convergent = 617/90 = 6.85555555555556
- 5. convergent = 665/97 = 6.85567010309278
- 6. convergent = 3942/575 = 6.85565217391304
- 7. convergent = 4607/672 = 6.85565476190476
- 8. convergent = 59226/8639 = 6.85565458965158
- 9. convergent = 63833/9311 = 6.85565460208356
- 10. convergent = 378391/55194 = 6.85565460013770
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement