Problem 001

A place to air possible concerns or difficulties in understanding ProjectEuler problems. This forum is not meant to publish solutions. This forum is NOT meant to discuss solution methods or giving hints how a problem can be solved.
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.

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


See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
Post Reply
User avatar
elendiastarman
Posts: 410
Joined: Sat Dec 22, 2007 8:15 pm

Re: Problem 001

Post by elendiastarman »

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.
I can help.
Want some
3.14159265358979323846264338327950288419716939937510
58209749445923078164062862089986280348253421170679...?
Image
George_Morell
Posts: 1
Joined: Mon Nov 15, 2010 8:32 pm

Re: Problem 001

Post by George_Morell »

Sorry
Last edited by George_Morell on Mon Nov 15, 2010 8:57 pm, edited 1 time in total.
User avatar
hk
Administrator
Posts: 12832
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 001

Post by hk »

@George_Morell
Please read forum rules.

[edit]
Thank you
[/edit]
Image
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

Post by WhiteSteel »

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! :D
rineez
Posts: 6
Joined: Mon Nov 22, 2010 7:55 am

Re: Problem 001

Post by rineez »

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 :)
rineez
Posts: 6
Joined: Mon Nov 22, 2010 7:55 am

Re: Problem 001

Post by rineez »

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.
Boreeas
Posts: 2
Joined: Fri Dec 10, 2010 1:43 am

Re: Problem 001

Post by Boreeas »

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
User avatar
rayfil
Administrator
Posts: 1412
Joined: Sun Mar 26, 2006 5:30 am
Location: Quebec, Canada
Contact:

Re: Problem 001

Post by rayfil »

@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.
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

Post by Boreeas »

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.
<.< 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.
User avatar
hk
Administrator
Posts: 12832
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 001

Post by hk »

All code snipped from previous posts in this topic.
Image
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

Post by tuchalia »

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! :D
Image
TripleM
Posts: 384
Joined: Fri Sep 12, 2008 3:31 am

Re: Problem 001

Post by TripleM »

Sure.
tuchalia
Posts: 2
Joined: Mon Jan 03, 2011 8:57 pm

Re: Problem 001

Post by tuchalia »

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!
Image
rakantae
Posts: 4
Joined: Wed Jan 05, 2011 12:40 am

Re: Problem 001

Post by rakantae »

Ahahaha. Stupid multiples got me as well. But I've defeated Problem 1.
sharkz
Posts: 4
Joined: Thu Jan 13, 2011 8:48 pm

Re: Problem 001

Post by sharkz »

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?
User avatar
hk
Administrator
Posts: 12832
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 001

Post by hk »

In fact it doens't work for 20 either.
How often do think you count 15?
Image
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

Post by sharkz »

two times, just checked it, one time for 15/3 and one time for 15/5
User avatar
hk
Administrator
Posts: 12832
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 001

Post by hk »

Yep, but the statement is:
Find the sum of all the multiples of 3 or 5 below 1000.
So?
Image
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

Post by sharkz »

hk wrote:Yep, but the statement is:
Find the sum of all the multiples of 3 or 5 below 1000.
So?
Wait - so i just have to count the multiples 3 and 5 share? :o
User avatar
Jochen_P
Posts: 55
Joined: Mon Oct 05, 2009 10:47 am
Location: Stuttgart, Germany

Re: Problem 001

Post by Jochen_P »

No, the problem description states that you need to sum them up .. another keyword is 3 or 5
Image
Post Reply