#4163: tut -- improve factorial / valuation example
---------------------------+------------------------------------------------
 Reporter:  was            |       Owner:  tba       
     Type:  enhancement    |      Status:  new       
 Priority:  minor          |   Milestone:  sage-3.1.3
Component:  documentation  |    Keywords:            
---------------------------+------------------------------------------------
 {{{
 That's a good point.

 2008/9/20 pong <wypong00>:
 >
 > This is not a bug report. But I'm not sure where to post a suggestion.
 >
 > In the SAGE tutorial, http://www.sagemath.org/doc/tut/node27.html
 >
 > there is an example:
 >
 > sage: c = factorial(25); c
 > 15511210043330985984000000
 > sage: [valuation(c,p) for p in prime_range(2,23)]
 > [22, 10, 6, 3, 2, 1, 1, 1]
 >
 > Since prime_range(2,23) does not include 23 itself, maybe it's better
 > to change it to prime_range(2,25). In that case, the product of primes
 > to the corresponding powers will actually give the factorial of 25.

 I would also include
 sage: c.factor()
 2^22 * 3^10 * 5^6 * 7^3 * 11^2 * 13 * 17 * 19 * 23
 (which would be helpful to people who might know know this meaning of
 "valuation", standard in number theory), and even perhaps
 sage: list(c.factor())
 [(2, 22), (3, 10), (5, 6), (7, 3), (11, 2), (13, 1), (17, 1), (19, 1),
 (23, 1)]

 John Cremona
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4163>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
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-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to