I can help.rae3012 wrote:Hello, I am a very new programmer, and I was told about the Euler site by a friend. Today is my first day to use Python, and I need some help regarding the code that I have. It seems like it would work from a logical standpoint, but I cannot get it to execute. If someone would be so kind as to offer their assistance via PM, I would greatly appreciate it.
Problem 001
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
In particular don't post any code fragments or results.
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
- elendiastarman
- Posts: 410
- Joined: Sat Dec 22, 2007 8:15 pm
Re: Problem 001
Want some
3.14159265358979323846264338327950288419716939937510
58209749445923078164062862089986280348253421170679...?

3.14159265358979323846264338327950288419716939937510
58209749445923078164062862089986280348253421170679...?

-
George_Morell
- Posts: 1
- Joined: Mon Nov 15, 2010 8:32 pm
Re: Problem 001
Sorry
Last edited by George_Morell on Mon Nov 15, 2010 8:57 pm, edited 1 time in total.
- hk
- Administrator
- Posts: 12832
- Joined: Sun Mar 26, 2006 10:34 am
- Location: Haren, Netherlands
Re: Problem 001
@George_Morell
Please read forum rules.
[edit]
Thank you
[/edit]
Please read forum rules.
[edit]
Thank you
[/edit]

War ruins the life and health of untold numbers of innocent children.
-
WhiteSteel
- Posts: 1
- Joined: Wed Nov 17, 2010 4:19 pm
Re: Problem 001
In my second day studying C++ and after a whole night without sleep...I finally solved it. TwT
I can't beleive it ·_· I had to re-study the concept of "multiple" to see the solution...
And it took me a couple of hours more to find the solution for the problem of repetition... ¬¬ the algorithm is not the most efficent... but I finally solved it!
I can't beleive it ·_· I had to re-study the concept of "multiple" to see the solution...
And it took me a couple of hours more to find the solution for the problem of repetition... ¬¬ the algorithm is not the most efficent... but I finally solved it!
-
rineez
- Posts: 6
- Joined: Mon Nov 22, 2010 7:55 am
Re: Problem 001
I misunderstood the question first and was adding up including 1000.
After many hours and resubmitting the same wrong answer many times only did I notice that the problem was to find sum for all numbers below 1000.
Lesson 1 learned: The problem may be simple, but read the question carefully
After many hours and resubmitting the same wrong answer many times only did I notice that the problem was to find sum for all numbers below 1000.
Lesson 1 learned: The problem may be simple, but read the question carefully
-
rineez
- Posts: 6
- Joined: Mon Nov 22, 2010 7:55 am
Re: Problem 001
Just for the sake of it, I generalized the problem and modified my code to find sum of all natural numbers that are multiples of 'a' or 'b' below some 'limit'. 
These problems are kind of interesting, and I'm planning to use them for teaching programming languages.
These problems are kind of interesting, and I'm planning to use them for teaching programming languages.
-
Boreeas
- Posts: 2
- Joined: Fri Dec 10, 2010 1:43 am
Re: Problem 001
Hmm, I seem to get the wrong answer, but I can't detect any error in my code. Any help, please?
Code: Select all
snip- rayfil
- Administrator
- Posts: 1412
- Joined: Sun Mar 26, 2006 5:30 am
- Location: Quebec, Canada
- Contact:
Re: Problem 001
@Boreeas
Sorry to have snipped your code.
However, we are absolutely certain that you can read. Please read again what is written in red and in large letters at the top of this thread.
This applies to EVERYBODY and to ALL threads on this open forum.
Sorry to have snipped your code.
However, we are absolutely certain that you can read. Please read again what is written in red and in large letters at the top of this thread.
This applies to EVERYBODY and to ALL threads on this open forum.
When you assume something, you risk being wrong half the time.
-
Boreeas
- Posts: 2
- Joined: Fri Dec 10, 2010 1:43 am
Re: Problem 001
<.< I'm sorry. I actually just saw that in the beginning of the thread people posting their code fragments and didn't care much about the red box, sind I thought "Oh well, they are posting code there, so it must be ok". Won't happen again, I promise.rayfil wrote:@Boreeas
Sorry to have snipped your code.
However, we are absolutely certain that you can read. Please read again what is written in red and in large letters at the top of this thread.
This applies to EVERYBODY and to ALL threads on this open forum.
- hk
- Administrator
- Posts: 12832
- Joined: Sun Mar 26, 2006 10:34 am
- Location: Haren, Netherlands
Re: Problem 001
All code snipped from previous posts in this topic.

War ruins the life and health of untold numbers of innocent children.
-
tuchalia
- Posts: 2
- Joined: Mon Jan 03, 2011 8:57 pm
Re: Problem 001
Hello to everyone, this is my first post here, and I'm having some trouble managing to get the code working, I seem to have some problems due to the fact that I'm using OSX, may I MP somebody to get some help?
For what I know, I can't post here the code, that's why I'm asking this. Anyway, this project seems quite a good thing to practice our programming/mathematical skills!!
Some key facts: Even declaring a variable as 0 and int, the memory adress just keeps the same value wich is a negative number, even when I declare it as an unsigned variable. Can you help me please?
Thanks for making this site!
For what I know, I can't post here the code, that's why I'm asking this. Anyway, this project seems quite a good thing to practice our programming/mathematical skills!!
Some key facts: Even declaring a variable as 0 and int, the memory adress just keeps the same value wich is a negative number, even when I declare it as an unsigned variable. Can you help me please?
Thanks for making this site!

-
tuchalia
- Posts: 2
- Joined: Mon Jan 03, 2011 8:57 pm
Re: Problem 001
TripleM wrote:Sure.
Thanks for the help!
I'm writing this just to say that I quickly managed to get my code running, thanks to TripleM for the help, and to my rusty C to get it solved quickly!

-
rakantae
- Posts: 4
- Joined: Wed Jan 05, 2011 12:40 am
-
sharkz
- Posts: 4
- Joined: Thu Jan 13, 2011 8:48 pm
Re: Problem 001
Hey there, having a bit of a problem with #1 : My algorithm works with 10 and 20 and so on but it says that my solution for below 1.000 is incorrect. Can someone give me an idea?
- hk
- Administrator
- Posts: 12832
- Joined: Sun Mar 26, 2006 10:34 am
- Location: Haren, Netherlands
Re: Problem 001
In fact it doens't work for 20 either.
How often do think you count 15?
How often do think you count 15?

War ruins the life and health of untold numbers of innocent children.
-
sharkz
- Posts: 4
- Joined: Thu Jan 13, 2011 8:48 pm
- hk
- Administrator
- Posts: 12832
- Joined: Sun Mar 26, 2006 10:34 am
- Location: Haren, Netherlands
Re: Problem 001
Yep, but the statement is:
Find the sum of all the multiples of 3 or 5 below 1000.
So?
War ruins the life and health of untold numbers of innocent children.
-
sharkz
- Posts: 4
- Joined: Thu Jan 13, 2011 8:48 pm
Re: Problem 001
Wait - so i just have to count the multiples 3 and 5 share?hk wrote:Yep, but the statement is:Find the sum of all the multiples of 3 or 5 below 1000.So?
- Jochen_P
- Posts: 55
- Joined: Mon Oct 05, 2009 10:47 am
- Location: Stuttgart, Germany
Re: Problem 001
No, the problem description states that you need to sum them up .. another keyword is 3 or 5
