Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. sage: K.<a> = QuadraticField(47)
  2. sage: c = a.continued_fraction()
  3. sage: c
  4. [6; (1, 5, 1, 12)*]
  5.  
  6. sage: c.convergents()
  7. lazy list [6, 7, 41/6, ...]
  8.  
  9. sage: for k in [0..10]:
  10. ....: ck = c.convergent(k)
  11. ....: print "%s. convergent = %s = %s" % (k, ck, ck.n())
  12. ....:
  13. 0. convergent = 6 = 6.00000000000000
  14. 1. convergent = 7 = 7.00000000000000
  15. 2. convergent = 41/6 = 6.83333333333333
  16. 3. convergent = 48/7 = 6.85714285714286
  17. 4. convergent = 617/90 = 6.85555555555556
  18. 5. convergent = 665/97 = 6.85567010309278
  19. 6. convergent = 3942/575 = 6.85565217391304
  20. 7. convergent = 4607/672 = 6.85565476190476
  21. 8. convergent = 59226/8639 = 6.85565458965158
  22. 9. convergent = 63833/9311 = 6.85565460208356
  23. 10. convergent = 378391/55194 = 6.85565460013770
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement