How to finds primes $p$ with the property that both $10p^2+9$ and $8p^2-9$ are also primes using Wolfram Alpha?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I want to know the number of primes $p$ that satisfies the condition that



$10p^2 + 9$



and



$8p^2 - 9$



are both primes, for primes $p$ only.



How can I do it using Wolfram Alpha (or any other online math software)?







share|cite|improve this question


















  • 1




    There is a separate site for Mathematica, but if you want to ask about any other maths software (such as Maple), this is the right place.
    – Toby Mak
    Aug 18 at 2:25










  • There probably are an infinite number of primes that satisfy this...
    – Rushabh Mehta
    Aug 18 at 2:30














up vote
1
down vote

favorite












I want to know the number of primes $p$ that satisfies the condition that



$10p^2 + 9$



and



$8p^2 - 9$



are both primes, for primes $p$ only.



How can I do it using Wolfram Alpha (or any other online math software)?







share|cite|improve this question


















  • 1




    There is a separate site for Mathematica, but if you want to ask about any other maths software (such as Maple), this is the right place.
    – Toby Mak
    Aug 18 at 2:25










  • There probably are an infinite number of primes that satisfy this...
    – Rushabh Mehta
    Aug 18 at 2:30












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I want to know the number of primes $p$ that satisfies the condition that



$10p^2 + 9$



and



$8p^2 - 9$



are both primes, for primes $p$ only.



How can I do it using Wolfram Alpha (or any other online math software)?







share|cite|improve this question














I want to know the number of primes $p$ that satisfies the condition that



$10p^2 + 9$



and



$8p^2 - 9$



are both primes, for primes $p$ only.



How can I do it using Wolfram Alpha (or any other online math software)?









share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Aug 18 at 7:34









Asaf Karagila♦

293k31407735




293k31407735










asked Aug 18 at 2:19









John Finkelstein

656




656







  • 1




    There is a separate site for Mathematica, but if you want to ask about any other maths software (such as Maple), this is the right place.
    – Toby Mak
    Aug 18 at 2:25










  • There probably are an infinite number of primes that satisfy this...
    – Rushabh Mehta
    Aug 18 at 2:30












  • 1




    There is a separate site for Mathematica, but if you want to ask about any other maths software (such as Maple), this is the right place.
    – Toby Mak
    Aug 18 at 2:25










  • There probably are an infinite number of primes that satisfy this...
    – Rushabh Mehta
    Aug 18 at 2:30







1




1




There is a separate site for Mathematica, but if you want to ask about any other maths software (such as Maple), this is the right place.
– Toby Mak
Aug 18 at 2:25




There is a separate site for Mathematica, but if you want to ask about any other maths software (such as Maple), this is the right place.
– Toby Mak
Aug 18 at 2:25












There probably are an infinite number of primes that satisfy this...
– Rushabh Mehta
Aug 18 at 2:30




There probably are an infinite number of primes that satisfy this...
– Rushabh Mehta
Aug 18 at 2:30










2 Answers
2






active

oldest

votes

















up vote
5
down vote













Using Wolfram Alpha/Mathematica, this is what I have so far:



10 * Prime[n]^2 + 9 


calculates your expression for the $n$th prime.



PrimeQ[ 10 * Prime[n]^2 + 9 ]


checks if that expression is prime.



Table[ PrimeQ[ 10 * Prime[n]^2 + 9 ], n,20 ]


makes a table of if that expression is prime or not from $1$ to $20$.



I tried:



Count [ Table[ PrimeQ[ 10 * Prime[n]^2 + 9 ], n, 20 ], True ]


to count how many 'True's there were from $1$ to $20$.



This works on Wolfram Cloud.






share|cite|improve this answer






















  • Unquote True, it's a built-in symbol.
    – Robert Soupe
    Aug 18 at 5:12










  • @RobertSoupe Wolfram Alpha still doesn't give an answer.
    – Toby Mak
    Aug 18 at 9:17










  • Oh, yeah, sorry, I should have directed you to sandbox.open.wolframcloud.com instead.
    – Robert Soupe
    Aug 19 at 3:03

















up vote
2
down vote













If you want to know how many such primes there are total, you're going to have to apply some good old fashioned human mathematical reasoning. Sometimes it's easy, sometimes it's hard.



e.g., how many primes consist of all 9s? That's easy, none in base 10. How many primes are of the form $2^p - 1$? That's hard. At least forty, but maybe not too many more than that.



But if you just want to know how many such of a given form there are in a reasonably small finite range, like, say, 1 to $10^20$, you can use Wolfram Alpha.



Many ways to skin a cat, Toby Mak has shown you a couple. Here's how I'd do it: first,



Select[10Prime[Range[100]]^2 + 9, PrimeQ]



Oops, I forgot you need to be a little more explicit in Wolfram Alpha:



Select[10Prime[Range[100]]^2 + 9, PrimeQ[#] &]



First one should be 499, last one 2714419. Wrap that in Length like so:



Length[Select[10Prime[Range[100]]^2 + 9, PrimeQ[#] &]]



In Wolfram Mathematica you can also do Length[%], which I read in my mind as "length of previous."



Answer is 21. Meaning that among the first hundred primes $p$, 21 of them are such that $10p^2 + 9$ is also prime.



You can push Wolfram Alpha a little higher than that, but not as high as you can push Wolfram Mathematica. Unless maybe you have a paid Wolfram Alpha subscription.



EDIT: Yong Hao Ng correctly points out that the asker wants $10p^2 + 9$ and $8p^2 - 9$. And also that that can be easily accommodated with an AND, e.g., Length[Select[Prime[Range[100]], PrimeQ[10#^2 + 9] && PrimeQ[8#^2 - 9] &]].






share|cite|improve this answer


















  • 1




    A remark that for both conditions one could do Length[Select[Prime[Range[100]], PrimeQ[10#^2+9]&&PrimeQ[8#^2-9]&]]
    – Yong Hao Ng
    Aug 18 at 7:55










Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2886354%2fhow-to-finds-primes-p-with-the-property-that-both-10p29-and-8p2-9-are-a%23new-answer', 'question_page');

);

Post as a guest






























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
5
down vote













Using Wolfram Alpha/Mathematica, this is what I have so far:



10 * Prime[n]^2 + 9 


calculates your expression for the $n$th prime.



PrimeQ[ 10 * Prime[n]^2 + 9 ]


checks if that expression is prime.



Table[ PrimeQ[ 10 * Prime[n]^2 + 9 ], n,20 ]


makes a table of if that expression is prime or not from $1$ to $20$.



I tried:



Count [ Table[ PrimeQ[ 10 * Prime[n]^2 + 9 ], n, 20 ], True ]


to count how many 'True's there were from $1$ to $20$.



This works on Wolfram Cloud.






share|cite|improve this answer






















  • Unquote True, it's a built-in symbol.
    – Robert Soupe
    Aug 18 at 5:12










  • @RobertSoupe Wolfram Alpha still doesn't give an answer.
    – Toby Mak
    Aug 18 at 9:17










  • Oh, yeah, sorry, I should have directed you to sandbox.open.wolframcloud.com instead.
    – Robert Soupe
    Aug 19 at 3:03














up vote
5
down vote













Using Wolfram Alpha/Mathematica, this is what I have so far:



10 * Prime[n]^2 + 9 


calculates your expression for the $n$th prime.



PrimeQ[ 10 * Prime[n]^2 + 9 ]


checks if that expression is prime.



Table[ PrimeQ[ 10 * Prime[n]^2 + 9 ], n,20 ]


makes a table of if that expression is prime or not from $1$ to $20$.



I tried:



Count [ Table[ PrimeQ[ 10 * Prime[n]^2 + 9 ], n, 20 ], True ]


to count how many 'True's there were from $1$ to $20$.



This works on Wolfram Cloud.






share|cite|improve this answer






















  • Unquote True, it's a built-in symbol.
    – Robert Soupe
    Aug 18 at 5:12










  • @RobertSoupe Wolfram Alpha still doesn't give an answer.
    – Toby Mak
    Aug 18 at 9:17










  • Oh, yeah, sorry, I should have directed you to sandbox.open.wolframcloud.com instead.
    – Robert Soupe
    Aug 19 at 3:03












up vote
5
down vote










up vote
5
down vote









Using Wolfram Alpha/Mathematica, this is what I have so far:



10 * Prime[n]^2 + 9 


calculates your expression for the $n$th prime.



PrimeQ[ 10 * Prime[n]^2 + 9 ]


checks if that expression is prime.



Table[ PrimeQ[ 10 * Prime[n]^2 + 9 ], n,20 ]


makes a table of if that expression is prime or not from $1$ to $20$.



I tried:



Count [ Table[ PrimeQ[ 10 * Prime[n]^2 + 9 ], n, 20 ], True ]


to count how many 'True's there were from $1$ to $20$.



This works on Wolfram Cloud.






share|cite|improve this answer














Using Wolfram Alpha/Mathematica, this is what I have so far:



10 * Prime[n]^2 + 9 


calculates your expression for the $n$th prime.



PrimeQ[ 10 * Prime[n]^2 + 9 ]


checks if that expression is prime.



Table[ PrimeQ[ 10 * Prime[n]^2 + 9 ], n,20 ]


makes a table of if that expression is prime or not from $1$ to $20$.



I tried:



Count [ Table[ PrimeQ[ 10 * Prime[n]^2 + 9 ], n, 20 ], True ]


to count how many 'True's there were from $1$ to $20$.



This works on Wolfram Cloud.







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited Aug 19 at 9:43

























answered Aug 18 at 2:40









Toby Mak

2,7751925




2,7751925











  • Unquote True, it's a built-in symbol.
    – Robert Soupe
    Aug 18 at 5:12










  • @RobertSoupe Wolfram Alpha still doesn't give an answer.
    – Toby Mak
    Aug 18 at 9:17










  • Oh, yeah, sorry, I should have directed you to sandbox.open.wolframcloud.com instead.
    – Robert Soupe
    Aug 19 at 3:03
















  • Unquote True, it's a built-in symbol.
    – Robert Soupe
    Aug 18 at 5:12










  • @RobertSoupe Wolfram Alpha still doesn't give an answer.
    – Toby Mak
    Aug 18 at 9:17










  • Oh, yeah, sorry, I should have directed you to sandbox.open.wolframcloud.com instead.
    – Robert Soupe
    Aug 19 at 3:03















Unquote True, it's a built-in symbol.
– Robert Soupe
Aug 18 at 5:12




Unquote True, it's a built-in symbol.
– Robert Soupe
Aug 18 at 5:12












@RobertSoupe Wolfram Alpha still doesn't give an answer.
– Toby Mak
Aug 18 at 9:17




@RobertSoupe Wolfram Alpha still doesn't give an answer.
– Toby Mak
Aug 18 at 9:17












Oh, yeah, sorry, I should have directed you to sandbox.open.wolframcloud.com instead.
– Robert Soupe
Aug 19 at 3:03




Oh, yeah, sorry, I should have directed you to sandbox.open.wolframcloud.com instead.
– Robert Soupe
Aug 19 at 3:03










up vote
2
down vote













If you want to know how many such primes there are total, you're going to have to apply some good old fashioned human mathematical reasoning. Sometimes it's easy, sometimes it's hard.



e.g., how many primes consist of all 9s? That's easy, none in base 10. How many primes are of the form $2^p - 1$? That's hard. At least forty, but maybe not too many more than that.



But if you just want to know how many such of a given form there are in a reasonably small finite range, like, say, 1 to $10^20$, you can use Wolfram Alpha.



Many ways to skin a cat, Toby Mak has shown you a couple. Here's how I'd do it: first,



Select[10Prime[Range[100]]^2 + 9, PrimeQ]



Oops, I forgot you need to be a little more explicit in Wolfram Alpha:



Select[10Prime[Range[100]]^2 + 9, PrimeQ[#] &]



First one should be 499, last one 2714419. Wrap that in Length like so:



Length[Select[10Prime[Range[100]]^2 + 9, PrimeQ[#] &]]



In Wolfram Mathematica you can also do Length[%], which I read in my mind as "length of previous."



Answer is 21. Meaning that among the first hundred primes $p$, 21 of them are such that $10p^2 + 9$ is also prime.



You can push Wolfram Alpha a little higher than that, but not as high as you can push Wolfram Mathematica. Unless maybe you have a paid Wolfram Alpha subscription.



EDIT: Yong Hao Ng correctly points out that the asker wants $10p^2 + 9$ and $8p^2 - 9$. And also that that can be easily accommodated with an AND, e.g., Length[Select[Prime[Range[100]], PrimeQ[10#^2 + 9] && PrimeQ[8#^2 - 9] &]].






share|cite|improve this answer


















  • 1




    A remark that for both conditions one could do Length[Select[Prime[Range[100]], PrimeQ[10#^2+9]&&PrimeQ[8#^2-9]&]]
    – Yong Hao Ng
    Aug 18 at 7:55














up vote
2
down vote













If you want to know how many such primes there are total, you're going to have to apply some good old fashioned human mathematical reasoning. Sometimes it's easy, sometimes it's hard.



e.g., how many primes consist of all 9s? That's easy, none in base 10. How many primes are of the form $2^p - 1$? That's hard. At least forty, but maybe not too many more than that.



But if you just want to know how many such of a given form there are in a reasonably small finite range, like, say, 1 to $10^20$, you can use Wolfram Alpha.



Many ways to skin a cat, Toby Mak has shown you a couple. Here's how I'd do it: first,



Select[10Prime[Range[100]]^2 + 9, PrimeQ]



Oops, I forgot you need to be a little more explicit in Wolfram Alpha:



Select[10Prime[Range[100]]^2 + 9, PrimeQ[#] &]



First one should be 499, last one 2714419. Wrap that in Length like so:



Length[Select[10Prime[Range[100]]^2 + 9, PrimeQ[#] &]]



In Wolfram Mathematica you can also do Length[%], which I read in my mind as "length of previous."



Answer is 21. Meaning that among the first hundred primes $p$, 21 of them are such that $10p^2 + 9$ is also prime.



You can push Wolfram Alpha a little higher than that, but not as high as you can push Wolfram Mathematica. Unless maybe you have a paid Wolfram Alpha subscription.



EDIT: Yong Hao Ng correctly points out that the asker wants $10p^2 + 9$ and $8p^2 - 9$. And also that that can be easily accommodated with an AND, e.g., Length[Select[Prime[Range[100]], PrimeQ[10#^2 + 9] && PrimeQ[8#^2 - 9] &]].






share|cite|improve this answer


















  • 1




    A remark that for both conditions one could do Length[Select[Prime[Range[100]], PrimeQ[10#^2+9]&&PrimeQ[8#^2-9]&]]
    – Yong Hao Ng
    Aug 18 at 7:55












up vote
2
down vote










up vote
2
down vote









If you want to know how many such primes there are total, you're going to have to apply some good old fashioned human mathematical reasoning. Sometimes it's easy, sometimes it's hard.



e.g., how many primes consist of all 9s? That's easy, none in base 10. How many primes are of the form $2^p - 1$? That's hard. At least forty, but maybe not too many more than that.



But if you just want to know how many such of a given form there are in a reasonably small finite range, like, say, 1 to $10^20$, you can use Wolfram Alpha.



Many ways to skin a cat, Toby Mak has shown you a couple. Here's how I'd do it: first,



Select[10Prime[Range[100]]^2 + 9, PrimeQ]



Oops, I forgot you need to be a little more explicit in Wolfram Alpha:



Select[10Prime[Range[100]]^2 + 9, PrimeQ[#] &]



First one should be 499, last one 2714419. Wrap that in Length like so:



Length[Select[10Prime[Range[100]]^2 + 9, PrimeQ[#] &]]



In Wolfram Mathematica you can also do Length[%], which I read in my mind as "length of previous."



Answer is 21. Meaning that among the first hundred primes $p$, 21 of them are such that $10p^2 + 9$ is also prime.



You can push Wolfram Alpha a little higher than that, but not as high as you can push Wolfram Mathematica. Unless maybe you have a paid Wolfram Alpha subscription.



EDIT: Yong Hao Ng correctly points out that the asker wants $10p^2 + 9$ and $8p^2 - 9$. And also that that can be easily accommodated with an AND, e.g., Length[Select[Prime[Range[100]], PrimeQ[10#^2 + 9] && PrimeQ[8#^2 - 9] &]].






share|cite|improve this answer














If you want to know how many such primes there are total, you're going to have to apply some good old fashioned human mathematical reasoning. Sometimes it's easy, sometimes it's hard.



e.g., how many primes consist of all 9s? That's easy, none in base 10. How many primes are of the form $2^p - 1$? That's hard. At least forty, but maybe not too many more than that.



But if you just want to know how many such of a given form there are in a reasonably small finite range, like, say, 1 to $10^20$, you can use Wolfram Alpha.



Many ways to skin a cat, Toby Mak has shown you a couple. Here's how I'd do it: first,



Select[10Prime[Range[100]]^2 + 9, PrimeQ]



Oops, I forgot you need to be a little more explicit in Wolfram Alpha:



Select[10Prime[Range[100]]^2 + 9, PrimeQ[#] &]



First one should be 499, last one 2714419. Wrap that in Length like so:



Length[Select[10Prime[Range[100]]^2 + 9, PrimeQ[#] &]]



In Wolfram Mathematica you can also do Length[%], which I read in my mind as "length of previous."



Answer is 21. Meaning that among the first hundred primes $p$, 21 of them are such that $10p^2 + 9$ is also prime.



You can push Wolfram Alpha a little higher than that, but not as high as you can push Wolfram Mathematica. Unless maybe you have a paid Wolfram Alpha subscription.



EDIT: Yong Hao Ng correctly points out that the asker wants $10p^2 + 9$ and $8p^2 - 9$. And also that that can be easily accommodated with an AND, e.g., Length[Select[Prime[Range[100]], PrimeQ[10#^2 + 9] && PrimeQ[8#^2 - 9] &]].







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited Aug 18 at 8:37

























answered Aug 18 at 5:33









Robert Soupe

10.1k21947




10.1k21947







  • 1




    A remark that for both conditions one could do Length[Select[Prime[Range[100]], PrimeQ[10#^2+9]&&PrimeQ[8#^2-9]&]]
    – Yong Hao Ng
    Aug 18 at 7:55












  • 1




    A remark that for both conditions one could do Length[Select[Prime[Range[100]], PrimeQ[10#^2+9]&&PrimeQ[8#^2-9]&]]
    – Yong Hao Ng
    Aug 18 at 7:55







1




1




A remark that for both conditions one could do Length[Select[Prime[Range[100]], PrimeQ[10#^2+9]&&PrimeQ[8#^2-9]&]]
– Yong Hao Ng
Aug 18 at 7:55




A remark that for both conditions one could do Length[Select[Prime[Range[100]], PrimeQ[10#^2+9]&&PrimeQ[8#^2-9]&]]
– Yong Hao Ng
Aug 18 at 7:55












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2886354%2fhow-to-finds-primes-p-with-the-property-that-both-10p29-and-8p2-9-are-a%23new-answer', 'question_page');

);

Post as a guest













































































這個網誌中的熱門文章

How to combine Bézier curves to a surface?

Mutual Information Always Non-negative

Why am i infinitely getting the same tweet with the Twitter Search API?