BTW, the 6 minutes included printing out the answer!
 
HTH,
A.  Jorge Garcia

Teacher & Professor
Applied Mathematics,  Physics & Computer Science
Baldwin Senior High School & Nassau  Community College

[email protected]_ (mailto:[email protected]) 
_http://calcpage.tripod.com_ (http://calcpage.tripod.com/) 
_ftp://centauri.baldwinschools.net_ (ftp://centauri.baldwinschools.net/) 


In a message dated 1/15/2009 7:18:53 P.M. Eastern Standard Time,  
[email protected] writes:


On  Thu, Jan 15, 2009 at 4:10 PM,  <[email protected]> wrote:
>  That's interesting because I calculated M
> 37 = 2^3021377-1 (909526  digits) on a 2.6 GHz pentium 4 using my own C++
> class to represent  large ints and it about 2 hours.
>
> I calculated the same thing  on www.sagenb.org and it took about 6 minutes!
>
> Well, I suppose  4 Xeon cores is a mini cluster of sorts.

That doesn't matter, since  Sage's code for doing integer arithmetic
doesn't take advantage of multiple  cores.  It's only doing that using
one core.   When you  write "my own C++ class to represent large ints",
this suggests that you're  using an entirely different algorithm than
Sage to do arithmetic with large  integers.

Computing M with Sage takes less than *one second* for me on  sagenb.org:

sage: time s =  2^3021377-1
CPU time: 0.00 s,   Wall time: 0.00 s
sage: time k = str(s)
CPU time: 0.67 s,  Wall  time: 0.67 s

The same computation on some other new hardware I recently  got from
Sun with big caches is even faster:

sage: time s =   2^3021377-1
CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
Wall  time: 0.00 s
sage: time k = str(s)
CPU times: user 0.40 s, sys: 0.01 s,  total: 0.41 s
Wall time: 0.41 s
sage: len(k)
909526
sage:  timeit('s =  2^3021377-1')
625 loops, best of 3: 83.3 µs per  loop

Why don't you try using Sage on your 2.6Ghz Pentium 4 to do the  computation?

>
> Regards,
> A. Jorge  Garcia
>
> Teacher & Professor
> Applied Mathematics,  Physics & Computer Science
> Baldwin Senior High School & Nassau  Community College
>
> [email protected]
>  http://calcpage.tripod.com
>  ftp://centauri.baldwinschools.net
>
>
>
>
>  ________________________________
> A Good Credit Score is 700 or Above.  See yours in just 2 easy steps!
> >
>



--  
William Stein
Associate Professor of Mathematics
University of  Washington
http://wstein.org




**************A Good Credit Score is 700 or Above. See yours in just 2 easy 
steps! 
(http://pr.atwola.com/promoclk/100000075x1215855013x1201028747/aol?redir=http://www.freecreditreport.com/pm/default.aspx?sc=668072%26hmpgID=62%26bcd=De
cemailfooterNO62)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-edu" 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-edu?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to