before I start asking, I will tell what I did. there was a problem, problem 3, you can go to that link and see what it requires. To solve it, i just wrote a function to find if that number is prime or not. Simple.

But, problem 10 requires sum of all prime number under 2 million(2000000), I solve this by simply checking all numbers until 2m and see if its prime then add it to some variable.(if its prime)

However, doing that takes so much time. and with so much time i mean hours. lots of hours. so I dont think my answer was right :)

I googled the question before asking here, but I found no c#. closest one i can found was java and fortran, which i cant seem to realize the algorithm.

Here I am, asking this. how you could do this ? checking every number till 2m and notice it if its prime is not fast way.(also this questions supposed to be calculated under 1 minute(by problem i mean, not by you lol) afaik)

Thanks.

. Once you've checked a number, you wont need to check multiples. Half of the numbersnot check every number`< 2,000,000`

are multiples of 2.