## Problem 332

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
LarryBlake
Posts: 100
Joined: Sat Aug 29, 2009 7:49 pm

### Problem 332

Problem 332 (View Problem)

I don't understand what is meant by integer coordinates on the surface. If the radius is r, does that mean that there are points 0 to r going from equator to pole?

EDIT: Okay, I think I get it. The center is 0, 0, 0. A Point(x, y, z) is on the surface, if x, y and z <= r and that coordinate is actually distance r away from Point(0, 0, 0). Is that correct?

harryh
Posts: 2091
Joined: Tue Aug 22, 2006 8:33 pm
Location: Thessaloniki, Greece

### Re: Problem 332

LarryBlake wrote:Is that correct?
Yep, the point (x,y,z) must be on the surface of the sphere and its coordinates (i.e. x, y and z) must be integers.

jun0
Posts: 3
Joined: Fri Sep 02, 2011 10:39 am

### Re: Problem 332

I can't seem to get the right answer for this problem even though I get the right value of A(14). I've looked over my algorithm several times, and I'm wondering if there's some precision issue going on (although, it seems unlikely since there aren't that many operations, so I'm really puzzled). Can someone please check if these 3 arbitrarily selected values of A(r) look correct? (I hope this is OK; you need 50 of them to compute the final answer, and these aren't like the most "difficult" cases or anything AFAICT).
A(5) = 2.724572812036574
A(27) = 0.07520891357997117
A(30) = 0.5607476454096538
EDIT: Ahhh never mind, I found a stupid bug in the computation.

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

### Re: Problem 332

jun0 wrote:I can't seem to get the right answer for this problem even though I get the right value of A(14).
I'm in that situation now. My answers match those given above as well as A(14).

Can I PM my values for A(1..50) to someone who has solved it?

Edit: 6 weeks later, I had the idea to check my answers for even r against those for r/2, and I found my own stupid bug.

streth11
Posts: 1
Joined: Sun Apr 14, 2019 5:26 pm

### Re: Problem 332

jun0 wrote:
Fri Sep 02, 2011 10:56 am
I can't seem to get the right answer for this problem even though I get the right value of A(14).
As with the last comment, i am also in the same situation - having looked through my code for bugs and missing coordinates and cannot find any error.
I have also checked my even r against the r/2 and there is no issue - i am completely lost as to what could be wrong.
Could somebody who has solved it allow me to PM a list of my values for A(1...50)??

cheers