On Sun, May 3, 2009 at 9:23 AM, Dr. David Kirkby <david.kir...@onetel.net> wrote: > > Here's a table of PrimePi[2^n], with n ranging from 0 to 47. It took > roughly 20 minutes or so to compute the table. > > In[19]:= Table[{n,PrimePi[2^n]},{n,0,47}] > > Out[19]= {{0, 0}, {1, 1}, {2, 2}, {3, 4}, {4, 6}, {5, 11}, {6, 18}, {7, 31}, > > > {8, 54}, {9, 97}, {10, 172}, {11, 309}, {12, 564}, {13, 1028}, > > > {14, 1900}, {15, 3512}, {16, 6542}, {17, 12251}, {18, 23000}, > > > {19, 43390}, {20, 82025}, {21, 155611}, {22, 295947}, {23, 564163}, > > > {24, 1077871}, {25, 2063689}, {26, 3957809}, {27, 7603553}, > > > {28, 14630843}, {29, 28192750}, {30, 54400028}, {31, 105097565}, > > > {32, 203280221}, {33, 393615806}, {34, 762939111}, {35, 1480206279}, > > > {36, 2874398515}, {37, 5586502348}, {38, 10866266172}, > > > {39, 21151907950}, {40, 41203088796}, {41, 80316571436}, > > > {42, 156661034233}, {43, 305761713237}, {44, 597116381732}, > > > {45, 1166746786182}, {46, 2280998753949}, {47, 4461632979717}} >
For the record, here's the same thing in Sage. As you can see, it took slightly less than 30 minutes on a macbook. sage: time [[n, prime_pi(2^n)] for n in range(48)] CPU times: user 1727.90 s, sys: 0.78 s, total: 1728.69 s Wall time: 1737.05 s [[0, 0], [1, 1], [2, 2], [3, 4], [4, 6], [5, 11], [6, 18], [7, 31], [8, 54], [9, 97], [10, 172], [11, 309], [12, 564], [13, 1028], [14, 1900], [15, 3512], [16, 6542], [17, 12251], [18, 23000], [19, 43390], [20, 82025], [21, 155611], [22, 295947], [23, 564163], [24, 1077871], [25, 2063689], [26, 3957809], [27, 7603553], [28, 14630843], [29, 28192750], [30, 54400028], [31, 105097565], [32, 203280221], [33, 393615806], [34, 762939111], [35, 1480206279], [36, 2874398515], [37, 5586502348], [38, 10866266172], [39, 21151907950], [40, 41203088796], [41, 80316571436], [42, 156661034233], [43, 305761713237], [44, 597116381732], [45, 1166746786182], [46, 2280998753949], [47, 4454203917918]] And as mentioned before, the values up to 46 are correct, and the value at 47 is wrong. > PS, Mathematica computes PrimePi[some_negative_number] as 0. Does Sage > handle that case ok? > sage: prime_pi(-20) 0 -- Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne -- Australia -- http://www.ms.unimelb.edu.au/~aghitza/ --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---