## 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

Don't post any spoilers
SmuK
Posts: 2
Joined: Sun Mar 08, 2009 11:19 am
Location: Liège (Belgium)

### Problem 233

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.

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

### Re: Problem 233

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

f(84246500) = f(248431625) = 420

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

### Re: Problem 233

"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

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

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

### Re: Problem 233

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

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

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

### Re: Problem 233

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.

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

### Re: Problem 233

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

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

### Re: Problem 233

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.

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

### Re: Problem 233

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

It seems you got it now

Congratulations!

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

### Re: Problem 233

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: Sun Jun 07, 2009 12:00 am

### Re: Problem 233

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

rayfil
Posts: 1405
Joined: Sun Mar 26, 2006 5:30 am
Contact:

### Re: Problem 233

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 10:01 am

### Re: Problem 233

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().

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

### Re: Problem 233

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.

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

### Re: Problem 233

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 6:26 am
Location: Moscow, Russian Federation

### Re: Problem 233

Sorry, it's too small.

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

### Re: Problem 233

Sorry, small bug.

for N <= 10^10: 2710041165705856 ?

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

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

### Re: Problem 233

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.

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

### Re: Problem 233

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.