Problem 009

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.
TheBonobo4
Posts: 17
Joined: Sun Jul 12, 2015 9:51 pm

Re: Problem 009

Post by TheBonobo4 »

0.23 seconds is quick, but can you get any quicker? :D

Level 1 is reached after 25 problems solved, then Level 2 at 50 and so on.
Image
User avatar
Bee_Reay
Posts: 7
Joined: Thu Jul 16, 2020 3:20 pm
Location: Scotland, UK

Re: Problem 009

Post by Bee_Reay »

Haha! Probably not got time for that at the moment :lol:
Image
kicsishadow
Posts: 2
Joined: Thu Dec 02, 2021 8:29 am

Re: Problem 009

Post by kicsishadow »

Hi!

I found an answer, where a + b + c = 1000, and a2+b2=c2 and a < b < c.

But if I type the solution in the format aaabbbccc, it says it is not correct. What could be the problem? Should I enter the solution in a different format?
User avatar
bruce_love
Administrator
Posts: 3545
Joined: Sat Sep 24, 2011 11:59 am

Re: Problem 009

Post by bruce_love »

Read carefully the last line of the question.
kicsishadow
Posts: 2
Joined: Thu Dec 02, 2021 8:29 am

Re: Problem 009

Post by kicsishadow »

I'm sorry, I'm from a non-English speaking country. For us, the sentence below

"Find the product abc"

means looking for the three numbers and then returning them side by side.

Using an example, if a is equal to 1200, b is equal to 2400, and c is equal to 3600, then the result I have to enter is: 120024003600.

Am I misunderstanding?
User avatar
hk
Administrator
Posts: 12832
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 009

Post by hk »

the product abc is a*b*c. (multiply the three numbers)
If a=3 and b=4 and c=5 then abc=3*4*5=60.
Image
War ruins the life and health of untold numbers of innocent children.
Liquid25677
Posts: 9
Joined: Thu May 26, 2022 4:07 pm

Re: Problem 009

Post by Liquid25677 »

I don't understand the problem. It says there is only one triplet for which a+b+c=1000 but in fact you can find infinitely many using the formula for generating them:

Code: Select all

a = m^2 - n^2
b = 2mn
c = m^2 + n^2

m^2 - n^2 + 2mn + m^2 + n^2 = 1000
For example:
a = -1500 b = 800 c = 1700

Or:
a = -61500 b = 992 c = 61508

Is there something I'm missing? Should the numbers all be positive?
User avatar
mpiotte
Administrator
Posts: 1961
Joined: Tue May 08, 2012 5:40 pm
Location: Montréal, Canada

Re: Problem 009

Post by mpiotte »

Liquid25677 wrote: Fri May 27, 2022 9:51 am ...
Is there something I'm missing? Should the numbers all be positive?
Yes, all numbers must be positive. It is implied by the general definition of Pythagorean triplet and natural numbers. Feel free to look them up.
Liquid25677
Posts: 9
Joined: Thu May 26, 2022 4:07 pm

Re: Problem 009

Post by Liquid25677 »

mpiotte wrote: Fri May 27, 2022 11:24 am
Liquid25677 wrote: Fri May 27, 2022 9:51 am ...
Is there something I'm missing? Should the numbers all be positive?
Yes, all numbers must be positive. It is implied by the general definition of Pythagorean triplet and natural numbers. Feel free to look them up.
OK, thanks. I thought that a Pythagorean triplet allowed negative numbers, but natural numbers are definitely always positive so I should nave read that more carefully.
Post Reply