Minimum primes: Difference between revisions
Content added Content deleted
m (→{{header|Wren}}: Changed to Wren S/H) |
(Added Easylang) |
||
Line 308: | Line 308: | ||
=={{header|EasyLang}}== |
|||
{{trans|Ring}} |
|||
<syntaxhighlight> |
|||
func nxtprim p . |
|||
j = 2 |
|||
while j * j <= p |
|||
if p mod j = 0 |
|||
j = 1 |
|||
p += 1 |
|||
. |
|||
j += 1 |
|||
. |
|||
return p |
|||
. |
|||
num1[] = [ 5 45 23 21 67 ] |
|||
num2[] = [ 43 22 78 46 38 ] |
|||
num3[] = [ 9 98 12 54 53 ] |
|||
n = len num1[] |
|||
len nums[] n |
|||
for i to n |
|||
nums[i] = nxtprim higher higher num1[i] num2[i] num3[i] |
|||
. |
|||
print nums[] |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
[ 43 101 79 59 67 ] |
|||
</pre> |
|||
=={{header|F_Sharp|F#}}== |
=={{header|F_Sharp|F#}}== |
||
Line 321: | Line 350: | ||
[43; 101; 79; 59; 67] |
[43; 101; 79; 59; 67] |
||
</pre> |
</pre> |
||
=={{header|Factor}}== |
=={{header|Factor}}== |
||
<syntaxhighlight lang="factor">USING: math math.order math.primes prettyprint sequences ; |
<syntaxhighlight lang="factor">USING: math math.order math.primes prettyprint sequences ; |