[Tutor] Add all natural numbers that are multiples of 3 and 5

Andre Engels andreengels at gmail.com
Sun Jan 4 10:40:52 CET 2009


On Sun, Jan 4, 2009 at 3:43 AM, Benjamin Serrato
<benjamin.serrato at gmail.com> wrote:

> I think it does what I wanted it to do, but Kent pointed out I wanted
> it to do was a false solution.  So, I can create a list of all common
> multiples below 1000, sum them, subtract them from 266 333.  Or, what
> I prefer, create a list of all multiples, checking against that list
> for a multiple before adding a new multiple.  But, I don't know how to
> work with lists so I'll be back in a day or two.

Removing this double counting can be done easily if you realize that
the double multiples are exactly 15 and its multiples.


-- 
André Engels, andreengels at gmail.com


More information about the Tutor mailing list