Sum multiples of 3 and 5: Difference between revisions

m
→‎version 3: added a REXX section header comment about the formula used. -- ~~~~
m (→‎version 3: allowed for a bug in some REXXes when using the FORMAT bif. -- ~~~~)
m (→‎version 3: added a REXX section header comment about the formula used. -- ~~~~)
Line 1,021:
This version automatically adjusts the numeric digits.
<br>A little extra code was added to format the output nicely.
<br>The formula used is a form of the Gauss Summation formula.
<lang rexx>/*REXX pgm sums all integers from 1──>N─1 that're multiples of 3 or 5.*/
parse arg N t .; if N=='' then N=1000; if t=='' then t=1