Talk:Emirp primes: Difference between revisions

Content added Content deleted
Line 56: Line 56:


:: For the specific number you mention I would use the Sieve of Atkin (to show off) to generate prime numbers up to 41, then test the number by trial division of these primes. More relevant to this task is how would I find all 4 digit emirps. Using the Sieve of Atkin I would generate all primes up to 99. Then test each odd number not ending in 5 in the ranges 1001-1999 (using primes up to 45), 3001-3999(using primes up to 63), 7001-7999(using primes up to 89), and 9001-9999(using primes up to 99). Then for each of these 4 lists of candidates test if the reversed number is in the appropriate other list. For all 5 digit emirps use Atkin to generate all primes up to 361. Then test each odd number not ending in 5 in the ranges 10001-19999 (using primes up to 141), 30001-39999(using primes up to 199), 70001-79999(using primes up to 282), and 90001-99999(using primes up to 316). Then for each of these 4 lists of candidates test if the reversed number is in the appropriate other list. etc, etc, ....--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 13:30, 27 March 2014 (UTC)
:: For the specific number you mention I would use the Sieve of Atkin (to show off) to generate prime numbers up to 41, then test the number by trial division of these primes. More relevant to this task is how would I find all 4 digit emirps. Using the Sieve of Atkin I would generate all primes up to 99. Then test each odd number not ending in 5 in the ranges 1001-1999 (using primes up to 45), 3001-3999(using primes up to 63), 7001-7999(using primes up to 89), and 9001-9999(using primes up to 99). Then for each of these 4 lists of candidates test if the reversed number is in the appropriate other list. For all 5 digit emirps use Atkin to generate all primes up to 361. Then test each odd number not ending in 5 in the ranges 10001-19999 (using primes up to 141), 30001-39999(using primes up to 199), 70001-79999(using primes up to 282), and 90001-99999(using primes up to 316). Then for each of these 4 lists of candidates test if the reversed number is in the appropriate other list. etc, etc, ....--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 13:30, 27 March 2014 (UTC)

:: It is probably faster not to calculate the list starting with 9 but to test for primeality when a Candidate in the 3 lists starting with 1, 3, or 7 ends in a 9.--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 13:51, 27 March 2014 (UTC)