Sum multiples of 3 and 5: Difference between revisions
Content added Content deleted
Line 3,980: | Line 3,980: | ||
# the sum of multiples of m being < n is equal to m*(1+2+ ... k) with k =[n/m] |
# the sum of multiples of m being < n is equal to m*(1+2+ ... k) with k =[n/m] |
||
# 1+2+...k = k*(k+1)/2 |
# 1+2+...k = k*(k+1)/2 |
||
Unfortunately, RPL can only handle double precision numbers, which prevents from precisely calculating the sum for n > 1E+15 |
|||
≪ → n |
≪ → n |
||
≪ 0 1 3 FOR j |
≪ 0 1 3 FOR j |