For this problem set, we'll be using the Jupyter notebook:



## Four numbers

Four numbers are consecutive multiples of 8 and their sum is 336.

What are the numbers?

Use brute force if possible!

Other solution can be:

    import sympy
    x = sympy.var('x')
    s = sympy.solve(8*x+8*(x+1)+8*(x+2)+8*(x+3)-336,x)[0]
    numbers = [8*(s+i) for i in range(4)]


```python
numbers = []
### BEGIN SOLUTION
for s in range(20):
    numbers = [(i+s)*8 for i in range(4)]
    print(numbers,':::' ,sum(numbers))

    if sum(numbers) == 336:
        break
### END SOLUTION
```

    [0, 8, 16, 24] ::: 48
    [8, 16, 24, 32] ::: 80
    [16, 24, 32, 40] ::: 112
    [24, 32, 40, 48] ::: 144
    [32, 40, 48, 56] ::: 176
    [40, 48, 56, 64] ::: 208
    [48, 56, 64, 72] ::: 240
    [56, 64, 72, 80] ::: 272
    [64, 72, 80, 88] ::: 304
    [72, 80, 88, 96] ::: 336



```python
assert sum(numbers) == 336 
assert len(numbers) == 4

for i in range(1,4):
    assert numbers[i]-numbers[i-1] == 8

```

d3aee85a8e216e300e661b88361d96f4e304e156
ipynb
Jupyter Notebook
course01/source/math/numbers_8.ipynb
marcinofulus/tutorial_nbgrader
9d832a2ee71884f245626171d7d873a906b097da
BSD-3-Clause
course01/source/math/numbers_8.ipynb
marcinofulus/tutorial_nbgrader
9d832a2ee71884f245626171d7d873a906b097da
BSD-3-Clause
course01/source/math/numbers_8.ipynb
marcinofulus/tutorial_nbgrader
9d832a2ee71884f245626171d7d873a906b097da
BSD-3-Clause
Qwen/Qwen-72B
1. YES
2. YES