tag:blogger.com,1999:blog-4667528901979447244.post4086157401194135973..comments2017-03-22T04:02:46.419-07:00Comments on Math and Hats: Things are Better in ParallelSimon Spicernoreply@blogger.comBlogger3125tag:blogger.com,1999:blog-4667528901979447244.post-25779507256956184052014-08-15T12:50:36.897-07:002014-08-15T12:50:36.897-07:00Thanks!
I've realized that perhaps a better c...Thanks!<br /><br />I've realized that perhaps a better code would be _sum_from_to(lower_bound, upper_bound) where the bounds would be approximated from the prime number theorem. The advantage being that the primes would be generated in different threads and not in only one. Of course, it all depends on the actual method used to generating primes. I see that the code currently uses a FLINT function n_is_prime(). It may be interesting to try get rid of the overhead of calling an external function. After all, Miller-Rabin test needs to be run only six times in order to be deterministic for numbers up to 10^12 (see https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test#Deterministic_variants_of_the_test).Vít Tučekhttps://www.blogger.com/profile/05289656520361260691noreply@blogger.comtag:blogger.com,1999:blog-4667528901979447244.post-27221591571615250242014-08-15T07:22:00.768-07:002014-08-15T07:22:00.768-07:00This is not obvious. It's not even obvious th...This is not obvious. It's not even obvious that there is at least one prime in each residue class. But, this follows from a more sophisticated version of the prime number theorem:<br />http://terrytao.wordpress.com/2009/09/24/the-prime-number-theorem-in-arithmetic-progressions-and-dueling-conspiracies/Nathan Kaplanhttps://www.blogger.com/profile/12532665181479357609noreply@blogger.comtag:blogger.com,1999:blog-4667528901979447244.post-53379745724474943232014-08-15T02:54:18.614-07:002014-08-15T02:54:18.614-07:00I know almost nothing about number theory. Is it c...I know almost nothing about number theory. Is it clear that the numbers of primes in different residue classes are more or less the same?<br /><br />Also, I'm not sure if it matters in cython, but usually branching is quite expensive. Wouldn't it be better to just write a function _sum_over(list_of_primes)?Vít Tučekhttps://www.blogger.com/profile/05289656520361260691noreply@blogger.com