Summation of primes: Difference between revisions
no edit summary
(Initial FutureBasic task solution added) |
No edit summary |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 468:
142913828922
</pre>
=={{header|Maxima}}==
<syntaxhighlight lang="maxima">
block(primes(2,2000000),apply("+",%%));
</syntaxhighlight>
Output
<syntaxhighlight lang="maxima">
/* 142913828922 */
</syntaxhighlight>
=={{header|Nim}}==
Line 738 ⟶ 748:
142,913,828,922
done...
</pre>
=={{header|RPL}}==
{{works with|HP|49}}
≪ 0 1
'''WHILE''' NEXTPRIME DUP 2E6 <
'''REPEAT''' SWAP OVER + SWAP
'''END''' DROP
≫ '<span style="color:blue">TASK</span>' STO
{{out}}
<pre>
1: 142913828922
</pre>
Line 744 ⟶ 766:
{{out}}
<pre>142913828922
</pre>
=={{header|Rust}}==
<syntaxhighlight lang="Rust">use primes::is_prime ;
fn main() {
println!("{}" , (2u64..2000000u64).filter( | &d | is_prime( d )).sum::<u64>() ) ;
}</syntaxhighlight>
{{out}}
<pre>
142913828922
</pre>
Line 795 ⟶ 828:
{{libheader|Wren-math}}
{{libheader|Wren-fmt}}
<syntaxhighlight lang="
import "./fmt" for Fmt
|