I am trying to get my head around the finding the sum of all the numbers under 1000 that are not multiples of 3 or 5 ?
I can find the sum of the first 1000 numbers easily enough by doing 1001x500
And i can pull out the multiples of 3 and then multiples of 5 but getting confused around the ones which are both?
Or is there a more interesting way to think about it. Any hints /prompts ?
I can find the sum of the first 1000 numbers easily enough by doing 1001x500
And i can pull out the multiples of 3 and then multiples of 5 but getting confused around the ones which are both?
Or is there a more interesting way to think about it. Any hints /prompts ?