Jump to content

Calmo numbers: Difference between revisions

add RPL
(add RPL)
Line 867:
done...
</pre>
 
=={{header|RPL}}==
≪ DUP FACTORS
'''IF''' DUP SIZE 3 MOD '''THEN''' DROP2 0 '''ELSE'''
{} 1 3 PICK SIZE '''FOR''' j
OVER j GET +
2 '''STEP'''
NIP SWAP OVER / + SORT
1 CF
1 OVER SIZE '''FOR''' j
DUP j DUP 2 + SUB ∑LIST
'''IF''' ISPRIME? NOT '''THEN''' 1 SF DUP SIZE 'j' STO '''END'''
3 '''STEP''' DROP
1 FC?
'''END'''
≫ '<span style="color:blue">CALMO?</span>' STO
≪ { } 2 1000 '''FOR''' j '''IF''' j <span style="color:blue">CALMO?</span> '''THEN''' j + '''END NEXT''' ≫ '<span style="color:blue">TASK</span>' STO
{{out}}
<pre>
1: { 165 273 385 399 561 595 665 715 957 }
</pre>
Runs in 2 minutes 54 seconds on a HP-50g.
 
=={{header|Wren}}==
1,151

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.