Sum multiples of 3 and 5: Difference between revisions

m
→‎version 3: allowed for a bug in some REXXes when using the FORMAT bif. -- ~~~~
(→‎version 3: added REXX version 3. -- ~~~~)
m (→‎version 3: allowed for a bug in some REXXes when using the FORMAT bif. -- ~~~~)
Line 1,026:
say 'The sum of all positive integers that are a multiple of 3 and 5 are:'
say /* [↓] change the look of nE+nn */
do t; parse value format(N,2,1,,0) 'E0' with y 'E' _ .; _=_+0
y=right((ym/1)'e'_,5)'-1' /*allows for a bug in some REXXes*/
if t==1 then y=N-1 /*handle special case of one-time*/
sum=sumDivisors(N-1,3) + sumDivisors(N-1,5) - sumDivisors(N-1,3*5)
say 'integers from 1 ──►' y " is " sum