HACKER Q&A
📣 lnyan

Why does Google fail to judge whether X is prime


If you type "is 1000000007 prime" into google, you'll find that google suggests that 1000000007 is not a prime. See https://i.imgur.com/ZWyoxLx.png

However, 1000000007 is a well-known prime used in many programming competitions or online judges.

The same thing will happen if you type "is 15485863 prime" into google. (which is the 1000000th prime) See https://i.imgur.com/vrCKqL7.png

Perhaps, starting with 1299709 (the 100000th prime), the answers might be all wrong.

It seems that determining whether an input number is prime should not go wrong easily. So, why does google fail to do that?


  👤 PaulHoule Accepted Answer ✓
I think Wolfram Alpha would try to parse the query and turn it into a statement like:

PrimeQ[1000000007]

https://reference.wolfram.com/language/ref/PrimeQ.html

I think Google is not doing that, instead they are scraping the web for spam sites that have automatically generated answers such as

https://bloodpressureok.com/reading/172-over-67/

which is bound to be less reliable.


👤 lnyan
Here are the screenshots used in the post 1000000007: https://i.imgur.com/ZWyoxLx.png 15485863: https://i.imgur.com/vrCKqL7.png