Sum multiples of 3 and 5: Difference between revisions

m
(→‎{{header|Forth}}: Add Fortran.)
Line 493:
BigInt sum35(in BigInt n) pure nothrow {
static BigInt sumMul(in BigInt n, in int f) pure nothrow {
immutable n1 = (f==n?n:(n - 1) ) / f;
return f * n1 * (n1 + 1) / 2;
}
Anonymous user