Problem 504

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
rhirsh
Posts: 1
Joined: Wed Feb 25, 2015 7:19 pm

Problem 504

Post by rhirsh »

I'd like some clarification on the terminology "strictly contain" lattice points for Problem 504 (View Problem). Assuming the a=b=c=d=1, then would that quadrilateral "strictly contain" only 1 point (i.e. (0,0)), or would it have 5 (i.e. (1,0),(0,1),(-1,0),(0,-1),(0,0))? Basically I am not sure if points exactly "on the line" should be counted or not, and I cant find a good definition of what "strictly contain" means. Thanks!
User avatar
Marcus_Andrews
Administrator
Posts: 1637
Joined: Wed Nov 09, 2011 5:23 pm

Re: Problem 504

Post by Marcus_Andrews »

Strict containment = lattice points on the lines of the quadrilateral are not counted.
redmilk525
Posts: 1
Joined: Thu Feb 26, 2015 3:39 am

Re: Problem 504

Post by redmilk525 »

I got correct answer when m=4 but got wrong when m=100.
Could somebody can help me verify that if ans=656 when m=10.
Thanks.
User avatar
nicolas.patrois
Posts: 118
Joined: Fri Jul 26, 2013 4:54 pm
Contact:

Re: Problem 504

Post by nicolas.patrois »

Wrong.
Image
MYNick
Posts: 3
Joined: Sat Feb 28, 2015 10:16 am

Re: Problem 504

Post by MYNick »

I get the right answer for m=4 too, but for m=100 not.
For m=10, is the answer 862?
User avatar
nicolas.patrois
Posts: 118
Joined: Fri Jul 26, 2013 4:54 pm
Contact:

Re: Problem 504

Post by nicolas.patrois »

Yes.
Image
pj6444
Posts: 9
Joined: Fri Jan 02, 2015 2:30 am

Re: Problem 504

Post by pj6444 »

Hmmm, I'm getting the right value for m = 10 but not for m = 100.
Image
wozzo
Posts: 1
Joined: Tue Jan 27, 2015 8:45 pm

Re: Problem 504

Post by wozzo »

A(a, 0), B(0, b), C(−c, 0), D(0, −d), where 1 ≤ a, b, c, d ≤ m and a, b, c, d, m are integers.
Since the above line describes point C as being (-c, 0), where c is an integer, are we also to assume c is a positive integer? That is that point C can only be placed on the negative portion of the x axis? If so why not describe a,b,c,d, & m as natural numbers?
User avatar
hk
Administrator
Posts: 12832
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 504

Post by hk »

Are there any non-positive numbers a,b,c,d for which 1 ≤ a, b, c, d ≤ m ?
Image
War ruins the life and health of untold numbers of innocent children.
Ellenion
Posts: 16
Joined: Fri Jul 14, 2017 11:09 pm

Re: Problem 504

Post by Ellenion »

I had the same question :). Maybe the admins could edit the problem and define what "strictly contains" means on the problem?
Image
User avatar
Animus
Administrator
Posts: 1987
Joined: Sat Aug 16, 2014 1:23 pm

Re: Problem 504

Post by Animus »

A polygon strictly contains any point that is located within the polygon and not on its boundary.

So neither count the vertices of the rectangle nor the lattice points located on the sides of the rectangle.
enigmaticcam
Posts: 16
Joined: Wed Sep 30, 2015 12:07 am

Re: Problem 504

Post by enigmaticcam »

Just to confirm, if a=b=c=d=2, then because there are four points that lie exactly on the diagonal edges of the quadrilateral, they would not be counted and so this would strictly contain only 5 lattice points?
DJohn
Posts: 90
Joined: Sat Oct 11, 2008 12:24 pm

Re: Problem 504

Post by DJohn »

Yes. A point is not strictly inside if it's on an edge.
Bezerkely
Posts: 1
Joined: Wed Sep 02, 2026 11:45 pm

Re: Problem 504

Post by Bezerkely »

pj6444 wrote: Thu Mar 26, 2015 7:12 pm Hmmm, I'm getting the right value for m = 10 but not for m = 100.
I was also getting the right value for m = 10 but not for m = 100. I switched my method of calculating the number of interior points from using floating point operations to integer operations only and got the right answer for m = 100.
Post Reply