Anonymous user
Sum multiples of 3 and 5: Difference between revisions
m
→{{header|D}}
(→{{header|Forth}}: Add Fortran.) |
m (→{{header|D}}) |
||
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;
}
|