![]() |
|
|
#23 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
my code works for 0,100 but doesn't give the suggest answer for 100,10000 is all I was trying to say.
|
|
|
|
|
|
#24 |
|
Oct 2007
Manchester, UK
5×271 Posts |
See my second edit.
|
|
|
|
|
|
#25 |
|
Feb 2012
67 Posts |
hard part is that even if you loop over x you have to be able to know, from x alone, how many ways there are to count whole number solutions between oddnumbered ranges
|
|
|
|
|
|
#26 | |
|
"Forget I exist"
Jul 2009
Dumbassville
20C016 Posts |
Quote:
1:odd x:x*odd but then there's still more of them. and that for me is the hard part to code I think. marking all odd numbers * a number not that hard I would think. |
|
|
|
|
|
|
#27 |
|
Feb 2012
11 Posts |
I found 301450082318808111, but it gets the red cross... can any solver tell me how close (or far...) I am ? Thanks
|
|
|
|
|
|
#28 |
|
Feb 2012
67 Posts |
not sure
my method takes a long time but that seems like its in the right ballpark what im doing is iterating from M to N and trying to be able to automatically count the lattice points that fall between the two bounds all the way up but i have no idea how to count lattice points automatically for ex, floor(y/x)^2 is odd when odd number <= (y/x)^2 < even number x*sqrt(odd number) <= y < x*sqrt(even number) so these bounds will extend as far as they can until you start to exceed N. somehow there should be a way to look at these bounds and know how many lattice points will exist in that segment but idk |
|
|
|
|
|
#29 | |
|
Oct 2007
Manchester, UK
135510 Posts |
Quote:
![]() |
|
|
|
|
|
|
#30 |
|
Feb 2012
4316 Posts |
is there a much faster way to do it than my logic? I am hitting a wall here
|
|
|
|
|
|
#31 |
|
Feb 2012
B16 Posts |
@lavalamp : unfotunately, I did well start at 2e6+1.
@voidme : another path might be to compute triangles surfaces... N and M are so huge that maybye the boundary effets (ceil & floor on y=x.sqrt(n) lines) will compensate. We'll see. |
|
|
|
|
|
#32 |
|
Feb 2012
11 Posts |
The triangles surfaces method is pretty fast : 2 seconds to get 301257385700605400. It is still a wrong answer, but it's close to my previous result, obtained with a completely different way. Which means I'm close to the goal... the question is whether this fast but approximative method can be refined. Not sure !
|
|
|
|
|
|
#33 | |
|
Jan 2008
France
55010 Posts |
Quote:
|
|
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Project Euler | jhs | Puzzles | 32 | 2021-01-19 04:05 |
| Project Euler 486 | lavalamp | Puzzles | 8 | 2015-02-04 14:28 |
| Euler (6,2,5) details. | Death | Math | 10 | 2011-08-03 13:49 |
| Project Euler | Mini-Geek | Lounge | 2 | 2009-10-23 17:19 |
| Bernoulli and Euler numbers (Sam Wagstaff project) | fivemack | Factoring | 4 | 2008-02-24 00:39 |