micseydel wrote:If you enjoyed this, you might want to check out Project Euler (especially problem 14).
Merci micseydel pour ton aide !
Thanks to you I cleaned a bit my script .
If you enjoyed this, you might want to check out Project Euler (especially problem 14).
What a great idea. I registered to the Project Euler some weeks ago but the problems were not as easy as it seems to be ! Here was my attempt to solve the first problem...
Problem : 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.
- Code: Select all
# -*- coding: utf-8 -*-
a -= 1
_list = 
while a > 0:
if a % 5 == 0:
elif a % 3 == 0:
a -= 1
multiples_sum = sum(_list)
i = algorithm(1000)
e = multiples_sum(i)
... As you can see, I've used the brute force solution which isn't very ingenious...