Problem 372

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
ldesnogu
Posts: 17
Joined: Wed Jan 11, 2012 10:04 am

Problem 372

Post by ldesnogu »

The problem says:
M<x≤N, M<y≤N and [x2/y2] are odd
Shouldn't that be:
M<x≤N, M<y≤N and [x2/y2] is odd
Image
subu
Posts: 1
Joined: Sun Feb 19, 2012 3:02 am

Re: Problem 372

Post by subu »

[flash=]They both are one at the same[/flash]
TripleM
Posts: 384
Joined: Fri Sep 12, 2008 3:31 am

Re: Problem 372

Post by TripleM »

It should be 'is', yes.
User avatar
hk
Administrator
Posts: 12832
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 372

Post by hk »

TripleM wrote:It should be 'is', yes.
Changed.
Image
War ruins the life and health of untold numbers of innocent children.
petersc
Posts: 7
Joined: Fri Feb 24, 2012 2:55 pm

Re: Problem 372

Post by petersc »

I am having trouble understanding why my solution works for R(100,10000) and not for R(2000000,1000000000). I am using 64 bit unsigned long variables, which should accommodate 10^18 just fine, any hints?
AbsoluteConvergence
Posts: 1
Joined: Sat Feb 25, 2012 12:42 am

Re: Problem 372

Post by AbsoluteConvergence »

I'm having a similar problem, my algorithm checks out for everything I was able to verify by a brute force alternative, but fails for R(2*6^10,10^9), I'm using python so there shouldn't be problems with large numbers. Unfortunately it also took 92 hours to run.
arechitsky
Posts: 1
Joined: Fri Mar 09, 2012 11:03 am

Re: Problem 372

Post by arechitsky »

i found solution for O( K*log(K) ), where K is about 106, so, it work, but gives wrong answer :(. It work absolutely correct at R(0,100) (comparing with bruteforce) and gives right answer at R(100,10000), but answer at R(2*106, 109) is not correct. I'm using python 3.2, any hints?

UPD: I tried numpy, other answer, but incorrect too
User avatar
Marcus_Andrews
Administrator
Posts: 1637
Joined: Wed Nov 09, 2011 5:23 pm

Re: Problem 372

Post by Marcus_Andrews »

Always double-check any overflow or precision issues.
Post Reply