On Jul 9, 1:47 am, "William Stein" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> This number theory book that I wrote uses Sage throughout:
>
> http://sage.math.washington.edu/papers/ent/ent-stein/ent.pdf
>
> It will be published by Springer-Verlag as a UTM book sometime
> in the next 6 months. Comments welcome before it's too late :-)
In
[quote]
SAGE Example 1.2.5. We can compute the decimal expansion of p in
Sage,
though watch out as this is a serious computation that may take
around
a minute on your computer. Also, do not print out p or s below,
because
both would take a very long time to scroll by.
sage: p = 2^32582657 - 1 # this is easy
sage: int(RR(p).log10()+1) # number of digits
9808358
noindentNext we convert p to a decimal string and look at some of the
digits.
sage: s = p.str(10) # this takes a long time
sage: len(s) # s is a very long string (long time)
9808358
sage: s[:20] # the first 20 digits of p (long time)
’12457502601536945540’
sage: s[-20:] # the last 20 digits (long time)
’11752880154053967871’
[end quote]
notice the "noindent"
> -- William
Cheers,
Michael
> --
> William Stein
> Associate Professor of Mathematics
> University of Washingtonhttp://wstein.org
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---