Quadrat special primes: Difference between revisions

m
imported>Maxima enthusiast
No edit summary
m (→‎{{header|Wren}}: Minor tidy)
 
(One intermediate revision by one other user not shown)
Line 1,246:
 
done...</pre>
 
=={{header|RPL}}==
{{works with|HP|49}}
≪ <span style="color:red">{ 2 } 2</span> DUP
'''DO'''
DUP NEXTPRIME
'''IF''' DUP2 SWAP - √ FP NOT '''THEN''' NIP SWAP OVER + SWAP DUP '''END'''
'''UNTIL''' DUP <span style="color:red">16000</span> ≥ '''END'''
DROP2
≫ '<span style="color:blue">TASK</span>' STO
{{out}}
<pre>
1: {2 3 7 11 47 83 227 263 587 911 947 983 1019 1163 1307 1451 1487 1523 1559 2459 3359 4259 4583 5483 5519 5843 5879 6203 6779 7103 7247 7283 7607 7643 8219 8363 10667 11243 11279 11423 12323 12647 12791 13367 13691 14591 14627 14771 15671}
</pre>
Runs in 6 minutes 25 seconds on a HP-50g.
 
=={{header|Ruby}}==
Line 1,261 ⟶ 1,276:
<pre>2 3 7 11 47 83 227 263 587 911 947 983 1019 1163 1307 1451 1487 1523 1559 2459 3359 4259 4583 5483 5519 5843 5879 6203 6779 7103 7247 7283 7607 7643 8219 8363 10667 11243 11279 11423 12323 12647 12791 13367 13691 14591 14627 14771 15671
</pre>
 
=={{header|Sidef}}==
<syntaxhighlight lang="ruby">func quadrat_primes(callback) {
Line 1,288 ⟶ 1,304:
{{libheader|Wren-math}}
{{libheader|Wren-fmt}}
<syntaxhighlight lang="ecmascriptwren">import "./math" for Int
import "./fmt" for Fmt
 
var isSquare = Fn.new { |n|
9,477

edits