Find squares n where n+1 is prime: Difference between revisions

add RPL
(Created Nim solution.)
(add RPL)
Line 914:
Found 10 numbers
done...
</pre>
 
=={{header|RPL}}==
≪ { }
1 1000 √ '''FOR''' j
'''IF''' j SQ 1 + ISPRIME? '''THEN''' j SQ + '''END'''
'''NEXT'''
≫ '<span style="color:blue>TASK</span>' STO
{{out}}
<pre>
1: { 1 4 16 36 100 196 256 400 576 676 }
</pre>
 
Line 924 ⟶ 935:
[1, 4, 16, 36, 100, 196, 256, 400, 576, 676]
</pre>
 
=={{header|Sidef}}==
<syntaxhighlight lang="ruby">1..1000.isqrt -> map { _**2 }.grep { is_prime(_+1) }.say</syntaxhighlight>
1,150

edits