Problem 017

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.
quilan
Posts: 182
Joined: Fri Aug 03, 2007 11:08 pm

Re: Problem 017

Post by quilan »

There's a lesson here about drinking & deriving...
ex ~100%'er... until the gf came along.
Image
TripleM
Posts: 384
Joined: Fri Sep 12, 2008 3:31 am

Re: Problem 017

Post by TripleM »

stupidgeek wrote:EDIT: I editted my code so that my point c) was validated, ie, my program now output "three hundred seven" for 307 instead of "three hundred and seven" (and, obviously all like cases [102, 906, 405, etc]). As far as I'm concerned, this is inconsistent, but it gives the correct answer. Good luck all.
If that gives the correct answer for you, then you must have a mistake elsewhere in your code. The correct answer uses 'three hundred and seven' for 307, not the American version.
aantthony
Posts: 2
Joined: Wed Jan 21, 2009 2:07 pm

Re: Problem 017

Post by aantthony »

lol, can't get this, but it seems so easy. I add up the numbers on the right
and get these results like this (i skipped the spaces on purpose)

eighthundredandninetytwo 24
eighthundredandninetythree 26
eighthundredandninetyfour 25
eighthundredandninetyfive 25
eighthundredandninetysix 24
eighthundredandninetyseven 26
eighthundredandninetyeight 26
eighthundredandninetynine 25
ninehundred 11
ninehundredandone 17
ninehundredandtwo 17
ninehundredandthree 19
ninehundredandfour 18
ninehundredandfive 18
ninehundredandsix 17
ninehundredandseven 19
ninehundredandeight 19
ninehundredandnine 18
ninehundredandten 17
ninehundredandeleven 20
ninehundredandtwelve 20

Are the last two right? Thats how I would say them.
User avatar
daniel.is.fischer
Posts: 2400
Joined: Sun Sep 02, 2007 11:15 pm
Location: Bremen, Germany

Re: Problem 017

Post by daniel.is.fischer »

Yes, the last two are correct (I think the others are also correct, but I didn't count the letters in each number).
Double-check your spelling, it's quite common to have a glitch there.
Il faut respecter la montagne -- c'est pourquoi les gypaètes sont là.
mctom987
Posts: 2
Joined: Fri Jan 15, 2010 2:37 am

Problem 17 is logically wrong.

Post by mctom987 »

The use of "and" should not be counted. Thinking about it logically, one would look like a complete fool to say the number 913 as "nine-hundred and ten and three." Or the number 135 as "one-hundred and thirty and five."

The use of "and" in numbers is used to separate numbers. "one-hundred and thirty-five" would logically be 100 and 35. Therefore, counting the "and"s in this problem is incorrect, even if it is the accepted form in British.
User avatar
elendiastarman
Posts: 410
Joined: Sat Dec 22, 2007 8:15 pm

Re: Problem 17 is logically wrong.

Post by elendiastarman »

This site is hosted in England (I think) and therefore the British usage is correct. I'm in the same boat as you, but it's not really that big of a deal...
Want some
3.14159265358979323846264338327950288419716939937510
58209749445923078164062862089986280348253421170679...?
Image
mctom987
Posts: 2
Joined: Fri Jan 15, 2010 2:37 am

Re: Problem 17 is logically wrong.

Post by mctom987 »

I'm saying, British is incorrect. Therefore, using British usage would be incorrect.
This is beyond the scope of a language, opinion, or dialect. Logic is independent of all of these factors.
If 2x = 4, then you could logically deduct x = 2. But if in England, x were to be 3, the logic in England would be flawed, and thus incorrect to use anywhere in the world.

Also, on an semi-unrelated note. Searching is broken. I was looking for "Problem 17" (quotes included), and was returned many, many more results than just for problem 17. "problem" was not included. Even with "+Problem" it would not work.
User avatar
elendiastarman
Posts: 410
Joined: Sat Dec 22, 2007 8:15 pm

Re: Problem 17 is logically wrong.

Post by elendiastarman »

Unfortunately, semantics isn't always totally logical...like I before E except after C...
Want some
3.14159265358979323846264338327950288419716939937510
58209749445923078164062862089986280348253421170679...?
Image
TripleM
Posts: 384
Joined: Fri Sep 12, 2008 3:31 am

Re: Problem 17 is logically wrong.

Post by TripleM »

mctom987 wrote:I'm saying, British is incorrect. Therefore, using British usage would be incorrect.
Just a shame that the entire rest of the world disagrees with you. American is definitely the one that is incorrect, and that is easily the majority view :)
User avatar
hk
Administrator
Posts: 12831
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 017

Post by hk »

mctom987 wrote:The use of "and" should not be counted. Thinking about it logically, one would look like a complete fool to say the number 913 as "nine-hundred and ten and three." Or the number 135 as "one-hundred and thirty and five."

The use of "and" in numbers is used to separate numbers. "one-hundred and thirty-five" would logically be 100 and 35. Therefore, counting the "and"s in this problem is incorrect, even if it is the accepted form in British.
mctom987 wrote:I'm saying, British is incorrect. Therefore, using British usage would be incorrect.
This is beyond the scope of a language, opinion, or dialect. Logic is independent of all of these factors.
If 2x = 4, then you could logically deduct x = 2. But if in England, x were to be 3, the logic in England would be flawed, and thus incorrect to use anywhere in the world.
Language has little to do with logic.
One can only try to describe usage. And accepted usage can be never be called wrong.
E.g. in my mother language one pronounces 1066 as "thousand six and sixty".
Or 123456 as "hundred three and twenty thousand four hundred six and fifty"
Funny isn't it?
Also, on an semi-unrelated note. Searching is broken. I was looking for "Problem 17" (quotes included), and was returned many, many more results than just for problem 17. "problem" was not included. Even with "+Problem" it would not work.
Problems with a number lower than 100 are called Problem 0xx in this forum to enable to display them sorted on subject.
See the sticky topic viewtopic.php?f=50&t=1356#p12839
Searching for Problem 017 would have done the job.
Better still: at the bottom of this page are options to display a forum.
One of them is: sorted on subject.
Image
War ruins the life and health of untold numbers of innocent children.
User avatar
Jochen_P
Posts: 55
Joined: Mon Oct 05, 2009 10:47 am
Location: Stuttgart, Germany

Re: Problem 017

Post by Jochen_P »

Or take the french language for example (no offense intended, I do love the french language, but hadn't had practice since school days)

94 = quatre-vingt-quatorce = four-twenty-fourteen = 4*20+14

Sounds very unfamiliar, eh?
Image
User avatar
Lord_Farin
Posts: 239
Joined: Wed Jul 01, 2009 10:43 am
Location: Netherlands

Re: Problem 017

Post by Lord_Farin »

Actually it's quatorze, but we get your point (btw the Dutch numeric pronunciation is indeed one of the weirdest around XD)

However, this all has little to do with Problem 17, so we might consider moving these posts to somewhere more appropriate. Moderators?
Image
User avatar
Jochen_P
Posts: 55
Joined: Mon Oct 05, 2009 10:47 am
Location: Stuttgart, Germany

Re: Problem 017

Post by Jochen_P »

évidemment ! :shock:

Talking about weird numeric pronounciation; it's the very same in german (the dutch, not the french pronounciation that is) and of course it feels not so weird when you have grown up with it.
What is weird is to state that it is wrong :mrgreen: *ahem* as well as to say "search is broken" without proof
Last edited by Jochen_P on Fri Jan 15, 2010 8:11 pm, edited 2 times in total.
Image
User avatar
hk
Administrator
Posts: 12831
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 017

Post by hk »

Lord_Farin wrote:Actually it's quatorze, but we get your point (btw the Dutch numeric pronunciation is indeed one of the weirdest around XD)

However, this all has little to do with Problem 17, so we might consider moving these posts to somewhere more appropriate. Moderators?
About the only thing that can be said about this problem is the never ending bickering of those that do not know the British usage.
So we better can leave it here as a warning.
Image
War ruins the life and health of untold numbers of innocent children.
User avatar
Bernardo
Posts: 2
Joined: Tue Nov 17, 2009 9:57 pm
Location: Netherlands

Re: Problem 017

Post by Bernardo »

I feel like such a bitch having brute forced this one :lol:
Signatures suck...
frogboy77
Posts: 10
Joined: Thu Aug 26, 2010 9:03 pm

Re: Problem 017

Post by frogboy77 »

new poster
forgive any errors
agree the and is unneeded in english system
someone stated 1.345 is said in U.S as one and three hundred forty five thousandths
just wondering how an american says 1.2435576889
not saying one way is better than the other but just curious
also how to say 3.8562829348746563838364545747
User avatar
elendiastarman
Posts: 410
Joined: Sat Dec 22, 2007 8:15 pm

Re: Problem 017

Post by elendiastarman »

At that point (no pun intended) we say "Three point eight five six two...". There's probably a rule out there that says that you say it as a fraction only up to a certain point (probably the thousands)...
Want some
3.14159265358979323846264338327950288419716939937510
58209749445923078164062862089986280348253421170679...?
Image
kunukn
Posts: 1
Joined: Fri Oct 08, 2010 7:57 pm

Re: Problem 017

Post by kunukn »

Hey just go the right result and wanted to share the correct spellings (had a spelling bug which puzzled my for some time)
I recommend printing the spelling along for debugging, e.g. NineHundredAndNinetyNine

One
Two
Three
Four
Five
Six
Seven
Eight
Nine
Ten
Eleven
Twelve
Thirteen
Fourteen
Fifteen
Sixteen
Seventeen
Eighteen
Nineteen
Twenty
Thirty
Forty
Fifty
Sixty
Seventy
Eighty
Ninety
Thousand
phillip1882
Posts: 7
Joined: Sat Jun 21, 2008 10:08 pm

having some trouble with 17

Post by phillip1882 »

as far as i can tell my logic is correct as is my spelling of the words that make up the numbers, short of posting the code I'm not sure what to do help you understand where i might be going wrong. any ideas?

p.s. i posted my code in the numbers forum so apologies for this.
User avatar
euler
Administrator
Posts: 5095
Joined: Sun Mar 05, 2006 4:49 pm
Location: Cheshire, England
Contact:

Re: Problem 017

Post by euler »

I assume that you have carefully read through this entire thread for the many common issues with this problem?

However, I would draw your attention to kunukn's post (just above), where he/she kindly lists the correct spellings of all the numbers. Does your program give 19 with the simple test case: one, two, three, four, five? Does it give 23 and 20 for the numbers 342 and 115 respectively? (Remember you do not count spaces.)
Image
impudens simia et macrologus profundus fabulae
Post Reply