On Wed, Apr 30, 2008 at 8:51 PM, Dan Drake <[EMAIL PROTECTED]> wrote:
> On Wed, 30 Apr 2008 at 09:10AM -0700, bill.p wrote:
>  > > My present thought is that I'd need a list of integers plus another
>  > > integer - the integer could either be the number of non-recurring
>  > > terms, or it could be the number of recurring terms. Given the way
>  > > that Python handles negative indices I guess the second option could
>  > > amount to the same thing by making it negative. Again, feedback
>  > > welcomed.
>  > >
>  > > Bill
>  > Hmmm, I'll take that as 'No Interest' then....
>
>  I haven't been following this carefully, but I'd like to see a format
>  for quadratic irrationals that is along the same lines as Mathematica:
>
>   ContinuedFraction[Sqrt[15]]
>
>  yields
>
>   {3, {1, 6}}.


BTW, you can do this in GAP via SAGE:

sage: gap.eval("x := Indeterminate(Integers);;")
''
sage: eval(gap.eval("ContinuedFractionExpansionOfRoot(x^2-15,20)"))
[3, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1]

http://www.gap-system.org/Manuals/doc/htm/ref/CHAP015.htm#SECT005

It would probably be straightforward to write a pexpect wrapper....

>
>  The first entry is the integer part, and after that, we'd have a tuple
>  or list that gives you the periodic stuff. Rational numbers would be
>  just a list of integers:
>
>   {3, 7, 15, 1, 292, 1, 1, 1, 2, 1}
>
>  It would also be nice if you could do symbolic expressions as entries in
>  the list.
>
>  Dan
>
>  --
>  ---  Dan Drake <[EMAIL PROTECTED]>
>  -----  KAIST Department of Mathematical Sciences
>  -------  http://math.kaist.ac.kr/~drake
>
> -----BEGIN PGP SIGNATURE-----
>  Version: GnuPG v1.4.6 (GNU/Linux)
>
>  iD8DBQFIGRQjr4V8SljC5LoRAqr4AKC6RNAFBhBCkilu0tzy3qzGUVyWMQCgzDZL
>  IsNOy5VwOE2sENvbAZ7kXc8=
>  =jGFv
>  -----END PGP SIGNATURE-----
>
>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to