just guess that I can generate a wierd array with the bad numbers like 171.
so I construct this formula: x = (i+17)*71+177171 then it is accepted..
just guess that I can generate a wierd array with the bad numbers like 171.
so I construct this formula: x = (i+17)*71+177171 then it is accepted..
I prefer learning
Sieve of Erathostenesfor this question.You can refer to this — the Sieve of Eratosthenes is a very efficient way to handle such problems.
Sieve of Eratosthenes