Get our expert's

answer on brainly

SEE EXPERT ANSWER

Get your **free** account and access **expert** answers to this and **thousands** of other questions.

I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!

I forgot not to include definition xD!

Turing's gives the first 1000 primes, mine give you the # you want (n).

Idk why schools give such useless assignments such at this, they are NEVER used in the real world; however from what I'm posting it will help you think mathematically and help you with problem solving.
Trivial Cases
We learned numbers are prime if the only divisors they have are 1 and itself. Trivially, we can check every integer from 1 to itself (exclusive) and test whether it divides evenly.
For example, one might be tempted to run this algorithm:
//checks whether an int is prime or not.
boolean isPrime(int n) {
for(int i=2;i

Well that's a big argument this is how my face look like now :P ....
|dw:1353791266808:dw|

Not at all, what they teach yo in school is mostly useless.

|dw:1353793840818:dw|