exercism/go/sum-of-multiples/README.md
2016-08-13 18:20:14 -05:00

810 B

Sum Of Multiples

Write a program that, given a number, can find the sum of all the multiples of particular numbers up to but not including that number.

If we list all the natural numbers up to but not including 15 that are multiples of either 3 or 5, we get 3, 5, 6 and 9, 10, and 12.

The sum of these multiples is 45.

Write a program that can find the sum of the multiples of a given set of numbers.

To run the tests simply run the command go test in the exercise directory.

If the test suite contains benchmarks, you can run these with the -bench flag:

go test -bench .

For more detailed info about the Go track see the help page.

Source

A variation on Problem 1 at Project Euler view source