Numbers with prime digits whose sum is 13: Difference between revisions

m
→‎{{header|REXX}}: simplified code.
(Realize in F#)
m (→‎{{header|REXX}}: simplified code.)
Line 309:
=={{header|REXX}}==
<lang rexx>/*REXX pgm finds and displays all decimal numbers whose digits are prime and sum to 13. */
LO= 337; HI= 322222; #= 0 /*define the low and &high range for #s.; # count*/
pDigs= 2357; #= 0 /*define prime digits; found #s count.*/
$= /*variable to hold the list of #s found*/
do j=LO for HI-LO+1 /*search for numbers in this range. */
if verify(j, pDigs2357) \== 0 then iterate /*J must be comprised of prime digits.*/
parse var j a 2 b 3 '' -1 z /*parse: 1st, 2nd, & last decimal digs.*/
sum= a + b + z /*sum: " " " " " " */