Efficient way to check a prime of Prime digits
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I was trying to solve a question on number theory. It says, given a range (start, end $ le 10^15$ and end - start $ le 10^9$), how many prime digit prime numbers exist? Generating prime digits numbers is easy but to check whether this number is prime, it runs out of time. I discarded numbers ending with $2$ or $5$, still a large number to go through primality test. So is there an efficient way to do primality test for prime digits prime number.
Note: I tried with sieve but failed for large number typically $ge10^7$.
number-theory prime-numbers computational-mathematics
 |Â
show 3 more comments
up vote
1
down vote
favorite
I was trying to solve a question on number theory. It says, given a range (start, end $ le 10^15$ and end - start $ le 10^9$), how many prime digit prime numbers exist? Generating prime digits numbers is easy but to check whether this number is prime, it runs out of time. I discarded numbers ending with $2$ or $5$, still a large number to go through primality test. So is there an efficient way to do primality test for prime digits prime number.
Note: I tried with sieve but failed for large number typically $ge10^7$.
number-theory prime-numbers computational-mathematics
1
I assume that a "prime digit" number means a number that, in base $10$, is written using only $2,3,5,7$? If so, I really can't imagine that there is a primality test that works especially well on this category.
â lulu
Sep 3 at 11:30
In that case how can we efficiently compute the solution of above stated problem?
â Debasis Jana
Sep 3 at 11:35
2
Those numbers are all quite small. $15$ digits is well within the range of rapid computation by standard methods. That is to say, this is a programming problem, not a math problem.
â lulu
Sep 3 at 11:38
Or does it mean a prime with a prime number of decimal digits? That's how I understood it before reading lulu's comment.
â saulspatz
Sep 3 at 12:46
1
I think I need to test with Millar Rabin approach.
â Debasis Jana
Sep 3 at 14:45
 |Â
show 3 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I was trying to solve a question on number theory. It says, given a range (start, end $ le 10^15$ and end - start $ le 10^9$), how many prime digit prime numbers exist? Generating prime digits numbers is easy but to check whether this number is prime, it runs out of time. I discarded numbers ending with $2$ or $5$, still a large number to go through primality test. So is there an efficient way to do primality test for prime digits prime number.
Note: I tried with sieve but failed for large number typically $ge10^7$.
number-theory prime-numbers computational-mathematics
I was trying to solve a question on number theory. It says, given a range (start, end $ le 10^15$ and end - start $ le 10^9$), how many prime digit prime numbers exist? Generating prime digits numbers is easy but to check whether this number is prime, it runs out of time. I discarded numbers ending with $2$ or $5$, still a large number to go through primality test. So is there an efficient way to do primality test for prime digits prime number.
Note: I tried with sieve but failed for large number typically $ge10^7$.
number-theory prime-numbers computational-mathematics
number-theory prime-numbers computational-mathematics
edited Sep 3 at 12:07
Bernard
112k635104
112k635104
asked Sep 3 at 11:26
Debasis Jana
113
113
1
I assume that a "prime digit" number means a number that, in base $10$, is written using only $2,3,5,7$? If so, I really can't imagine that there is a primality test that works especially well on this category.
â lulu
Sep 3 at 11:30
In that case how can we efficiently compute the solution of above stated problem?
â Debasis Jana
Sep 3 at 11:35
2
Those numbers are all quite small. $15$ digits is well within the range of rapid computation by standard methods. That is to say, this is a programming problem, not a math problem.
â lulu
Sep 3 at 11:38
Or does it mean a prime with a prime number of decimal digits? That's how I understood it before reading lulu's comment.
â saulspatz
Sep 3 at 12:46
1
I think I need to test with Millar Rabin approach.
â Debasis Jana
Sep 3 at 14:45
 |Â
show 3 more comments
1
I assume that a "prime digit" number means a number that, in base $10$, is written using only $2,3,5,7$? If so, I really can't imagine that there is a primality test that works especially well on this category.
â lulu
Sep 3 at 11:30
In that case how can we efficiently compute the solution of above stated problem?
â Debasis Jana
Sep 3 at 11:35
2
Those numbers are all quite small. $15$ digits is well within the range of rapid computation by standard methods. That is to say, this is a programming problem, not a math problem.
â lulu
Sep 3 at 11:38
Or does it mean a prime with a prime number of decimal digits? That's how I understood it before reading lulu's comment.
â saulspatz
Sep 3 at 12:46
1
I think I need to test with Millar Rabin approach.
â Debasis Jana
Sep 3 at 14:45
1
1
I assume that a "prime digit" number means a number that, in base $10$, is written using only $2,3,5,7$? If so, I really can't imagine that there is a primality test that works especially well on this category.
â lulu
Sep 3 at 11:30
I assume that a "prime digit" number means a number that, in base $10$, is written using only $2,3,5,7$? If so, I really can't imagine that there is a primality test that works especially well on this category.
â lulu
Sep 3 at 11:30
In that case how can we efficiently compute the solution of above stated problem?
â Debasis Jana
Sep 3 at 11:35
In that case how can we efficiently compute the solution of above stated problem?
â Debasis Jana
Sep 3 at 11:35
2
2
Those numbers are all quite small. $15$ digits is well within the range of rapid computation by standard methods. That is to say, this is a programming problem, not a math problem.
â lulu
Sep 3 at 11:38
Those numbers are all quite small. $15$ digits is well within the range of rapid computation by standard methods. That is to say, this is a programming problem, not a math problem.
â lulu
Sep 3 at 11:38
Or does it mean a prime with a prime number of decimal digits? That's how I understood it before reading lulu's comment.
â saulspatz
Sep 3 at 12:46
Or does it mean a prime with a prime number of decimal digits? That's how I understood it before reading lulu's comment.
â saulspatz
Sep 3 at 12:46
1
1
I think I need to test with Millar Rabin approach.
â Debasis Jana
Sep 3 at 14:45
I think I need to test with Millar Rabin approach.
â Debasis Jana
Sep 3 at 14:45
 |Â
show 3 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2903774%2fefficient-way-to-check-a-prime-of-prime-digits%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
I assume that a "prime digit" number means a number that, in base $10$, is written using only $2,3,5,7$? If so, I really can't imagine that there is a primality test that works especially well on this category.
â lulu
Sep 3 at 11:30
In that case how can we efficiently compute the solution of above stated problem?
â Debasis Jana
Sep 3 at 11:35
2
Those numbers are all quite small. $15$ digits is well within the range of rapid computation by standard methods. That is to say, this is a programming problem, not a math problem.
â lulu
Sep 3 at 11:38
Or does it mean a prime with a prime number of decimal digits? That's how I understood it before reading lulu's comment.
â saulspatz
Sep 3 at 12:46
1
I think I need to test with Millar Rabin approach.
â Debasis Jana
Sep 3 at 14:45