Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C by ai1 ( 15 years ago )
fprim := proc(n :: nonnegint)
local i;
if ( n=1)
then return(false)
fi;
for i from 2 to floor(sqrt(n)) do
if (n mod i) = 0
then return(false)
fi
od;
return true;
end:

p:= 3001 : counter := 0:

for n from 1 to 3001 do
if (fprim(n) = true)
then m := (p-n);
if ((m mod 3) = 0)
then
counter := counter +1;
fi
fi
od;
counter;

 

Revise this Paste

Your Name: Code Language: