Summarize primes: Difference between revisions
Content added Content deleted
Line 595: | Line 595: | ||
The sum of 162 primes in [2, 953] is 70241 which is also prime |
The sum of 162 primes in [2, 953] is 70241 which is also prime |
||
There are 21 summerized primes in [1, 1000)</pre> |
There are 21 summerized primes in [1, 1000)</pre> |
||
=={{header|EasyLang}}== |
|||
<syntaxhighlight lang="easylang"> |
|||
proc prime x . r . |
|||
for i = 2 to sqrt x |
|||
if x mod i = 0 |
|||
r = 0 |
|||
break 2 |
|||
. |
|||
. |
|||
r = 1 |
|||
. |
|||
for i = 2 to 999 |
|||
call prime i r |
|||
if r = 1 |
|||
ind += 1 |
|||
sum += i |
|||
call prime sum r |
|||
if r = 1 |
|||
print ind & ": " & sum |
|||
. |
|||
. |
|||
. |
|||
</syntaxhighlight> |
|||
=={{header|Delphi}}== |
=={{header|Delphi}}== |