Category Archives: Javascript

Brain food

stock math

Problem
Find the sum of all the multiples of 3 or 5 below 1000. For example; sum of all natural numbers less than 10, that are multiples of 3 or 5 (3, 5, 6, & 9), is 23.

Solution
\lbrace x\vert\hspace{2 mm} 1\leq x\leq 1,000\rbrace If there’s no remainder when x is divided by 3 or 5, take the sum of all those x’s.


Remember to view the result of running this block of javascript by clicking the blue dropdown and selecting Result