# How can I compute how many primes of this kind are up to $N$?

https://oeis.org/A079796/b079796.txt

we can see the first 10,000 prime numbers $p$ with the property that both

$(3p)^2 + p^2 + 3^2$

and

$(3p)^2 - p^2 - 3^2$ are primes

The primes $p$ with this property satisfie that both $10p^2 + 9$ and $8p^2-9$ are also primes. How can I extend the list to find how many primes are up to $N$ beyond the $10,000$ such primes listed in the link, using Wolfram Alpha?

I don't have mathematica, so maybe there's a limitation in the computational power available in Wolfram Alpha for this kind of operation.

If someone can find quickly how many such primes there are, let's say, up to $100,000,000$, I will appreciate the help.

• WolframAlpha understands this Select[Range[1,1000], PrimeQ[#]&& PrimeQ[(3*#)^2+#^2+3^2]&& PrimeQ[(3*#)^2-#^2-3^2]&] and checks numbers from 1 up to 1000 to see which of those qualify. If you change that range then you can check other numbers. I don't know how large a range your WolframAlpha will accept. – Bill Aug 18 '18 at 3:38

I don't know how to do this on WolframAlpha, but in Mathematica it is straightforward:

myList = Table[Prime[k], {k, 10^4}];

Length@Select[myList,
PrimeQ[(3 #)^2 + #^2 + 9] && PrimeQ[(3 #)^2 - #^2 - 9] &]


(*

127

*)

This is the number of your special primes up to the $10000^{th}$ prime.

The $5761455^{th}$ prime is just over $10^8$ and substituting this into the above shows that the number of your special primes up to $10^8$ is $25,372$.

• (Haven't tried, but...) I would think the free version of the Wolfram Cloud platform could also handle this computation. Mentioning that since poster does not have desktop Mathematica, and W|A might time out on this. – Daniel Lichtblau Aug 18 '18 at 13:46