Skip to main content
Made test cases easier to understand + another header
Source Link

Almost equivalent to Project Euler's first question:

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.

Given##Challenge: Given a positive integer N and a set of at least one positive integer A, output the sum of all positive integers less than N that are multiples of at least one member of A.

For example, for the Project Euler case, the input would be:

1000
3
5

##Test cases:

Input : 50, 2[2]
Output: 600

Input : 10, 3[3, 55]
Output: 23

Input : 28, 4[4, 22]
Output: 182

Input : 19, 7[7, 55]
Output: 51

Input : 50, 2[2, 3, 55]
Output: 857

Almost equivalent to Project Euler's first question:

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.

Given a positive integer N and a set of at least one positive integer A, output the sum of all positive integers less than N that are multiples of at least one member of A.

For example, for the Project Euler case, the input would be:

1000
3
5

##Test cases:

50, 2
600

10, 3, 5
23

28, 4, 2
182

19, 7, 5
51

50, 2, 3, 5
857

Almost equivalent to Project Euler's first question:

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.

##Challenge: Given a positive integer N and a set of at least one positive integer A, output the sum of all positive integers less than N that are multiples of at least one member of A.

For example, for the Project Euler case, the input would be:

1000
3
5

##Test cases:

Input : 50, [2]
Output: 600

Input : 10, [3, 5]
Output: 23

Input : 28, [4, 2]
Output: 182

Input : 19, [7, 5]
Output: 51

Input : 50, [2, 3, 5]
Output: 857
Tweeted twitter.com/StackCodeGolf/status/810775829106008065
Post Reopened by user45941, Dennis
make it clearer
Source Link
user45941
user45941

Almost equivalent to Project Euler's first question:

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.

You will get the number to check for multiples belowGiven a positive integer (in the PE problem, 1000)N and a set of at least one positive integer A, then more numbersoutput the sum of all positive integers less than N that are the numbers to check for multiples of at least one member of (in this problem, 3 and 5)A.

For example, for the Project Euler case, the input would be:

1000
3
5

##Test cases:

50, 2
600

10, 3, 5
23

28, 4, 2
182

19, 7, 5
51

50, 2, 3, 5
857

Almost equivalent to Project Euler's first question:

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.

You will get the number to check for multiples below (in the PE problem, 1000), then more numbers that are the numbers to check for multiples of (in this problem, 3 and 5).

For example, for the Project Euler case, the input would be:

1000
3
5

##Test cases:

10, 3, 5
23

28, 4, 2
182

19, 7, 5
51

Almost equivalent to Project Euler's first question:

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.

Given a positive integer N and a set of at least one positive integer A, output the sum of all positive integers less than N that are multiples of at least one member of A.

For example, for the Project Euler case, the input would be:

1000
3
5

##Test cases:

50, 2
600

10, 3, 5
23

28, 4, 2
182

19, 7, 5
51

50, 2, 3, 5
857
Post Closed as "Needs details or clarity" by Wheat Wizard, Riker, 0 ', user45941, ATaco
deleted 10 characters in body
Source Link
Riker
  • 7.9k
  • 4
  • 39
  • 73

Almost equivalent to Project Euler's first question:

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.

The rules will be a bit changed: instead, youYou will get athe number through standard inputto check for multiples below (or a variablein the PE problem, a function parameter - whatever works for your language1000). That number will be the upper limit. You will, then get more numbers, which that are the numbers to check for multiples of (in this problem, 3 and 5).

For example, for the Project Euler case, the input would be:

3
5```
1000
3
5

##Test cases:

10, 3, 5
23

28, 4, 2
182

19, 7, 5
51

Almost equivalent to Project Euler's first question:

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.

The rules will be a bit changed: instead, you will get a number through standard input (or a variable, a function parameter - whatever works for your language). That number will be the upper limit. You will then get more numbers, which are the numbers to check for multiples of.

For example, for the Project Euler case, the input would be:

3
5```

Almost equivalent to Project Euler's first question:

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.

You will get the number to check for multiples below (in the PE problem, 1000), then more numbers that are the numbers to check for multiples of (in this problem, 3 and 5).

For example, for the Project Euler case, the input would be:

1000
3
5

##Test cases:

10, 3, 5
23

28, 4, 2
182

19, 7, 5
51
Source Link
Cisplatin
  • 543
  • 4
  • 10
Loading