Problem 233

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.
SmuK
Posts: 2
Joined: Sun Mar 08, 2009 11:19 am
Location: Liège (Belgium)

Problem 233

Post by SmuK » Fri Mar 20, 2009 10:15 am

Can someone confirm these results for Problem 233 (View Problem)?

Some random values of N such that f(N) = 420: 1328125, 84246500, 248431625.
My code compute approx 10^7 such numbers <= 10^11.

Thanks in advance.

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

Re: Problem 233

Post by Tommy137 » Fri Mar 20, 2009 10:45 am

SmuK wrote:Some random values of N such that f(N) = 420: 1328125, 84246500, 248431625.
f(1328125) = 180

f(84246500) = f(248431625) = 420
Image

SmuK
Posts: 2
Joined: Sun Mar 08, 2009 11:19 am
Location: Liège (Belgium)

Re: Problem 233

Post by SmuK » Fri Mar 20, 2009 3:34 pm

"Congratulations, the answer you gave to problem 233 is correct."

Thanks a lot. It was a stupid bug :)

hisoka-san
Posts: 20
Joined: Sun Jan 25, 2009 6:14 pm

Re: Problem 233

Post by hisoka-san » Mon Apr 20, 2009 5:25 pm

My code returns 30875234922 for n<=38000000, is it correct?

User avatar
daniel.is.fischer
Posts: 2400
Joined: Sun Sep 02, 2007 10:15 pm
Location: Bremen, Germany

Re: Problem 233

Post by daniel.is.fischer » Mon Apr 20, 2009 5:40 pm

Yes.
Il faut respecter la montagne -- c'est pourquoi les gypa&egrave;tes sont l&agrave;.

quintana
Posts: 11
Joined: Wed Jan 28, 2009 5:53 pm

Re: Problem 233

Post by quintana » Mon Apr 27, 2009 3:27 pm

for n<=10^10 i have 2709499279563106.
is it correct?

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

Re: Problem 233

Post by Tommy137 » Mon Apr 27, 2009 3:49 pm

quintana wrote:for n<=10^10 i have 2709499279563106.
is it correct?
Unfortunately, it's not.

You aren't the first one to get this particular result, though.
Image

quintana
Posts: 11
Joined: Wed Jan 28, 2009 5:53 pm

Re: Problem 233

Post by quintana » Mon Apr 27, 2009 3:52 pm

it's interesting because i have correct answer for 38000000. thanks!

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

Re: Problem 233

Post by quilan » Tue Apr 28, 2009 6:25 pm

Yeah, you're on the right track, but are missing something that a lot of other people missed initially too.
ex ~100%'er... until the gf came along.
Image

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

Re: Problem 233

Post by Tommy137 » Wed Apr 29, 2009 6:32 pm

quintana wrote:it's interesting because i have correct answer for 38000000. thanks!

It seems you got it now ;)

Congratulations!
Image

quintana
Posts: 11
Joined: Wed Jan 28, 2009 5:53 pm

Re: Problem 233

Post by quintana » Thu Apr 30, 2009 5:31 pm

thanks, i got it allright! i got the idea long time ago, but like p180 this one had a catch beyond idea. again, forum was very helpfull.

hendrikS
Posts: 2
Joined: Sat Jun 06, 2009 11:00 pm

Re: Problem 233

Post by hendrikS » Sat Jun 06, 2009 11:07 pm

Just a quick question for clarification:

"sum of the integers": Does it mean sum of the coordinates, that are integers up to 10^11? And if so: X or Y :?:

User avatar
rayfil
Administrator
Posts: 1403
Joined: Sun Mar 26, 2006 4:30 am
Location: Ontario, Canada
Contact:

Re: Problem 233

Post by rayfil » Sun Jun 07, 2009 2:34 am

What is the sum of all positive integers N
The actual value of the other integer coordinates on the circles are immaterial. Look at the definition given for f(N).
When you assume something, you risk being wrong half the time.

thundre
Posts: 356
Joined: Sun Mar 27, 2011 9:01 am

Re: Problem 233

Post by thundre » Wed Aug 24, 2011 2:50 pm

quilan wrote:Yeah, you're on the right track, but are missing something that a lot of other people missed initially too.
I have an elegant algorithm that gives the same wrong results for 1e10, 1e11 and the correct one for 38e6. I don't see any way it could be double-counting solutions.

Now I'm running a brute-force check counting down from 1e10 to see where it's making the mistake. It's taking forever. AAARGH! Would it help if I pull my hair out?

Seriously, this isn't something dumb like an overflow bug, is it?

update: Got it! It wasn't an overflow bug, I just had to look a little deeper into the characteristics of f().
Image

ffff0
Posts: 50
Joined: Sun Aug 21, 2011 5:26 am
Location: Moscow, Russian Federation

Re: Problem 233

Post by ffff0 » Wed Sep 28, 2011 7:12 am

Same as everyone. As for now, i can't see any difference for even and odd N. And i can't understand why answer for 38000000 is correct and answer for 10^11 is not. I simply don't see any special cases between this numbers.

My code finds 5422051 solutions for 10^11. Is it too big or too small?

Update: Wait a bit, I've got an idea.

Update 2: And hero have won once again without any help!
There are 5422629 solutions in total and there is no difference between even and odd N. It's something else.
Image

amidar1
Posts: 8
Joined: Tue Dec 20, 2011 12:37 am

Re: Problem 233

Post by amidar1 » Tue Dec 20, 2011 12:41 am

The subject of N <= 10^10 came up, but without a definitive response. Can anyone tell me if the correct answer for 10^10 is...

2709680426923506

It's very close to what quintana had, but not quite the same.
I'm getting the right answer for N <= 38 million (though I'm not sure what was special about the number 38 million), but evidently not the right answer for N <= 10^11, and it's driving me a little nuts.

Thanks!

ffff0
Posts: 50
Joined: Sun Aug 21, 2011 5:26 am
Location: Moscow, Russian Federation

Re: Problem 233

Post by ffff0 » Tue Dec 20, 2011 3:36 am

Sorry, it's too small.
Image

amidar1
Posts: 8
Joined: Tue Dec 20, 2011 12:37 am

Re: Problem 233

Post by amidar1 » Tue Dec 20, 2011 12:34 pm

Sorry, small bug.

for N <= 10^10: 2710041165705856 ?

EDIT:
Nevermind! Introduced another small bug while fixing the first. Now they're both fixed! :D

User avatar
TheEvil
Posts: 84
Joined: Sun Nov 13, 2011 10:38 am
Location: Szeged, Hungary

Re: Problem 233

Post by TheEvil » Thu Dec 29, 2011 5:43 pm

Thank you for all the very helpful comments on this question. It helped me a lot when I saw a lot of other people missed one little thing. After I found that I felt I should give my diploma back. :)
So far one of the best problems I solved, even if it took me three days to solve it, but it worth.
Image

snapey1979
Posts: 5
Joined: Thu Mar 01, 2012 1:11 pm

Re: Problem 233

Post by snapey1979 » Thu Mar 01, 2012 1:17 pm

Thanks to all posters above. I have to say that the open forum was great for this one - thanks for giving a sample answer for the problem on toy scale. When I realised my answer for 38000000 was wrong, i went hunting...

Helped me find a stupid bug using a less than instead of less than equals!!!! I'd had the code right since first writing it but for this bug!

Probably the hardest one I solved so far. Got the idea quite quickly, but debugging was a nightmare.

Post Reply