Jump to content

Sum multiples of 3 and 5: Difference between revisions

m
(→‎{{header|Lasso}}: adding Lasso multiples of 3 & 5 calculation)
Line 77:
largest--;
ulong totalCount = (largest / n);
ulong countpairCount = totalCount / 2;
bool unpairedNumberOnFoldLine = (totalCount % 2 == 1);
ulong pairSum = largest + n;
return countpairCount * pairSum + (unpairedNumberOnFoldLine ? pairSum / 2 : 0);
}
 
23

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.