>job interview
>white board walks in
>sum all primes to 2 million
>back to the drawing board
sigma notation you insufferable meme spouting brainlet
>>8809339
>define "sum all primes to 2 million" as shitting on the white board
>please my primate ancestors
>>8809339
>loop through all numbers 1 to 2 mil
>loop inside first loop dividing number by previous numbers except 1
>if only divisible by 1, add number to sum vector
>sum all the numbers inside the sum vector
>????
>profit
come on dude, I'm not even a programmer and I can do dat shit
>>8809455
>write a program that counts down from 2 trillion (2e12 = 2e6 * (2e6 - 1) / 2)
>one of the numbers must be the answer
long long int are at least 64 bits
2^64 = 1.8e19 (you'll want unsigned)
"Tell Pajet to do it"
>>8809339
Newfag here, is this supposed to be /sci/'s meme or something?
>>8809714
it's the retarded offspring of /g/ and /sci/
>>8809445
if you're going to brute force it you should probably instantiate an extra array where you store all previously found primes and just iterate through that as the divisor. also skip over all even numbers.
I'm a python programmer so something like:
found = [2]
for i in range(3,2000000,2):
k=0
for j in found:
if i%j==0:
k=1
break
if k = 0:
found.append(i)
print(sum(found))
>>8811052
damn, it fucked up all of my formatting :(