Problem 217

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
btilly
Posts: 44
Joined: Fri Sep 26, 2008 6:45 am

Problem 217

Post by btilly » Thu Nov 20, 2008 12:17 am

I think I have a calculation for T, but I'm not getting the right answer.

Can someone verify a few values of T? (And hopefully afterwards work with me to try to figure out where I am first going wrong.)

T(7) = 659372010300

T(9) = 995165713541160

T(20) = 33585148073246702626230567640200

Thanks,
Ben

User avatar
Tommy137
Posts: 238
Joined: Sun Feb 24, 2008 6:02 pm
Location: Cologne, Germany
Contact:

Re: Problem 217

Post by Tommy137 » Thu Nov 20, 2008 1:55 am

None of these values are correct...
Image

victordk
Posts: 1
Joined: Tue Nov 18, 2008 1:40 pm

Re: Problem 217

Post by victordk » Thu Nov 20, 2008 11:26 am

What about
T(7) = 2742754949190
T(9) = 23891796478509570
?
Thanks.

LarryC
Posts: 66
Joined: Sat Jun 14, 2008 7:33 pm

Re: Problem 217

Post by LarryC » Thu Nov 20, 2008 11:58 am

I make both of those values wrong.

btilly
Posts: 44
Joined: Fri Sep 26, 2008 6:45 am

Re: Problem 217

Post by btilly » Thu Nov 20, 2008 12:48 pm

OK, I got it.

(Debugging information removed.)
Last edited by btilly on Thu Nov 20, 2008 3:47 pm, edited 1 time in total.

User avatar
stijn263
Posts: 1505
Joined: Sat Sep 15, 2007 10:57 pm
Location: Netherlands

Re: Problem 217

Post by stijn263 » Thu Nov 20, 2008 1:01 pm

The problem already contains enough debug information in my opinion :-)

User avatar
Tommy137
Posts: 238
Joined: Sun Feb 24, 2008 6:02 pm
Location: Cologne, Germany
Contact:

Re: Problem 217

Post by Tommy137 » Thu Nov 20, 2008 1:24 pm

And if you're unsure whether your algorithm is correct, you can even bruteforce the values up tp T(7) or T(8) by testing each number and compare the results.
Image

User avatar
hk
Administrator
Posts: 9873
Joined: Sun Mar 26, 2006 9:34 am
Location: Haren, Netherlands

Re: Problem 217

Post by hk » Thu Nov 20, 2008 1:41 pm

I agree. It would be best if this "debugging information" were removed. I can do that but I leave it to the author to do so.
There should be general agreement what to post and what not. There is obviously a feeling that there should not be volunteered "debugging information". When developing a problem we choose how much debugging information is given.
It is not the individual user's decision to extend that information.
Image

btilly
Posts: 44
Joined: Fri Sep 26, 2008 6:45 am

Re: Problem 217

Post by btilly » Thu Nov 20, 2008 3:50 pm

I removed the debugging information that I provided. However the fact that I had a program that had the correct value for T(1), T(2), and T(5) but not T(7) suggests to me that a couple of more data points could be helpful to people who have bugs in their code. But unless you've figured out a way to actually solve the problem, it won't help you.

Still the moderators disagree, so data points removed.

User avatar
Tommy137
Posts: 238
Joined: Sun Feb 24, 2008 6:02 pm
Location: Cologne, Germany
Contact:

Re: Problem 217

Post by Tommy137 » Thu Nov 20, 2008 4:19 pm

btilly wrote:I removed the debugging information that I provided. However the fact that I had a program that had the correct value for T(1), T(2), and T(5) but not T(7) suggests to me that a couple of more data points could be helpful to people who have bugs in their code. But unless you've figured out a way to actually solve the problem, it won't help you.

Still the moderators disagree, so data points removed.

As I already said, any value up to T(7) or T(8) can easily be bruteforced by a naive testing algorithm, so you've got quite a few points to check your algorithm. If these are correct, but your answer for T(47) isn't, I don't how it could help you to know the correct value of T(20) or so.
Image

LarryC
Posts: 66
Joined: Sat Jun 14, 2008 7:33 pm

Re: Problem 217

Post by LarryC » Thu Nov 20, 2008 6:08 pm

Although any value up to even T(9) was quite easy to brute-force, I don't see any issue in sharing low case values. I can't see how it would harm learning in any way... or anything else for that matter! Essentially, a user must gain all of the insight still, but may realize their mistakes earlier leading to less time coding...

I felt that T(3) would have been nice; but the case values provided are certainly enough to get going! :)

User avatar
hk
Administrator
Posts: 9873
Joined: Sun Mar 26, 2006 9:34 am
Location: Haren, Netherlands

Re: Problem 217

Post by hk » Thu Nov 20, 2008 9:51 pm

To me it is striking that people come to this board asking confirmation for values for which they can easily write a less advanced program that can validate simple cases. it should be second nature to do so. The cases given are meant as check that the problem is understood well. For instance the values given for T(1) and T(2) are given to make it clear what to do with some trivial cases.
Image

LarryC
Posts: 66
Joined: Sat Jun 14, 2008 7:33 pm

Re: Problem 217

Post by LarryC » Thu Nov 20, 2008 10:08 pm

I agree, a brute-force program is easy enough to make (but boring to code).

There are also times, when one is uncertain of "lower" results even when brute-forcing.

David F
Posts: 23
Joined: Sun Jul 20, 2008 10:03 pm

Re: Problem 217

Post by David F » Thu Nov 20, 2008 10:43 pm

lster wrote:Although any value up to even T(9) was quite easy to brute-force, I don't see any issue in sharing low case values. I can't see how it would harm learning in any way... or anything else for that matter! Essentially, a user must gain all of the insight still, but may realize their mistakes earlier leading to less time coding...

I felt that T(3) would have been nice; but the case values provided are certainly enough to get going! :)
Somewhat to my surprise, I found significant flaws in my code despite it producing T(1) through T(6) correctly.

How did people rate this problem? I found it pretty hard, probably the most difficult since 201, but the number of solutions suggests I may be in a minority.

quilan
Posts: 182
Joined: Fri Aug 03, 2007 10:08 pm

Re: Problem 217

Post by quilan » Thu Nov 20, 2008 11:19 pm

I'm not on the dev team so I can't say how they rated it, but I thought it was one of the toughest of the 203-217 group (although Robot Walks was fairly challenging too). The major method was fairly easy to come up with but working the details was a pain. That being said, optimizing it afterward as you can see in the thread has provided me with endless hours of fun experimentation.
ex ~100%'er... until the gf came along.
Image

JohnMorris
Posts: 64
Joined: Sun Dec 23, 2007 6:38 am

Re: Problem 217

Post by JohnMorris » Fri Nov 21, 2008 6:08 am

David F wrote: How did people rate this problem? I found it pretty hard, probably the most difficult since 201, but the number of solutions suggests I may be in a minority.
I think it's one of those ones that's straightforward once you spot the method, after seeming initially impossible. On a scale of 1 to 10, with Problem 198 (View Problem) as a 10, I'd put Problem 217 (View Problem) at a six. But that's very subjective: I've breezed through problems that others have struggled with, and vice-versa.
Image

JohnMorris
Posts: 64
Joined: Sun Dec 23, 2007 6:38 am

Re: Problem 217

Post by JohnMorris » Fri Nov 21, 2008 6:19 am

hk wrote:To me it is striking that people come to this board asking confirmation for values for which they can easily write a less advanced program that can validate simple cases. it should be second nature to do so.
Agreed. There have been a few cases of people asking for validation of intermediate results, and that feels like - well, it's not cheating exactly, but PE problems should be solo adventures and these validation requests don't seem to me to fit into that spirit.
Image

LarryC
Posts: 66
Joined: Sat Jun 14, 2008 7:33 pm

Re: Problem 217

Post by LarryC » Fri Nov 21, 2008 9:31 am

David F wrote:How did people rate this problem? I found it pretty hard, probably the most difficult since 201, but the number of solutions suggests I may be in a minority.
217 was far harder than I thought (at first it seemed trivial) but I found it fairly easy really. By comparison, I think I made too big a fuss about 213 which isn't as hard as I made it... Comparing the two and there is a distinct difference: 213 took me almost a month of on and off work while 217 took little under an hour. ;) ...I've always felt I was better at abstract problems!

btilly
Posts: 44
Joined: Fri Sep 26, 2008 6:45 am

Re: Problem 217

Post by btilly » Fri Nov 21, 2008 2:31 pm

Thumbo wrote:
David F wrote: How did people rate this problem? I found it pretty hard, probably the most difficult since 201, but the number of solutions suggests I may be in a minority.
I think it's one of those ones that's straightforward once you spot the method, after seeming initially impossible. On a scale of 1 to 10, with Problem 198 (View Problem) as a 10, I'd put Problem 217 (View Problem) at a six. But that's very subjective: I've breezed through problems that others have struggled with, and vice-versa.
Personally I spotted the method right away, but my initial attempt to code it had subtle bugs that I had a lot of trouble tracking down.

I rewrote the same exact method, with the same exact calculations, using a different programming technique and it worked on the first try.

idantlol
Posts: 15
Joined: Mon Jul 11, 2011 12:14 pm

Re: Problem 217

Post by idantlol » Sat Mar 17, 2018 12:05 am

Forgive me for being dense, but why is T(2) 540 and not 11+22+33+44+55+66+77+88+99=495?

Edit: nm, I get it now

Post Reply