a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment by wasoxygen
wasoxygen  ·  3131 days ago  ·  link  ·    ·  parent  ·  post: Help me learn new things! – Cryptography

I will make a note of your tip and try not to read it until I have solved the problem. One of the pleasures is finally getting a solution, then reading the forum to see so many people who cracked it with a few lines of functional language.





Devac  ·  3131 days ago  ·  link  ·  
This comment has been deleted.
wasoxygen  ·  3130 days ago  ·  link  ·  

I use the project as an opportunity to try learn new tools, and sometimes rely on features of a different language. Here's my breakdown of solved problems:

63 in Python (I solved the early problems while learning Python)

34 in C++ (when my old hardware was not fast enough)

13 in Ruby (when date functions were especially helpful)

13 in C# (slow days at work)

2 in Excel (shame!)

1 in Rexx (showing off)

I admit I find it difficult to believe that many of the problems beyond the first few dozen could be solved on paper, but I have learned that there are often clever shortcuts. Working through the Chakravala algorithm on paper was a sublime experience. I boasted to a friend that I had solved #24 on paper; he responded by solving it in his head.

My "friend key" is 16971_95168666b3371fa8a7b6548b677ce57c in case you care to observe my progress.

Devac  ·  3130 days ago  ·  link  ·  
This comment has been deleted.
bhrgunatha  ·  3130 days ago  ·  link  ·  

    if you never took linear algebra class it would be unlikely to occur to you" type of tip.

That highlights my main issue with the format of project Euler and why I abandoned it.

If you happen to know the area of maths that the question requires it can be challenging but fairly straightforward. If you don't, it's incredibly difficult or next to impossible and there aren't many (if any) clues about HOW you could gain enough background knowledge to solve it. All discussions about a particular problem, methods or maths tools to help solve it are locked away in the forum and you need to have solved it already before you can read it.

Devac  ·  3130 days ago  ·  link  ·  
This comment has been deleted.
bhrgunatha  ·  3130 days ago  ·  link  ·  

Thanks and please do continue!

There's quite a bit to digest and read there. Most of it seems to be what I've learned at school/university (and since mostly forgotten about), but it's nice to have it presented in this way i.e. important fundamental ideas in a particular area.

I am definitely interested in more but it'll take me some time to get through this post and I'm just about to start work. I'll come back once I've finished work.

Devac  ·  3130 days ago  ·  link  ·  
This comment has been deleted.
bhrgunatha  ·  3130 days ago  ·  link  ·  

The first 3 that I haven't solved yet are 93, 94 and 100. 94 is a triangle problem!

I think part of the problem is that I'm not used to reasoning about maths very much these days, so I can take a step or two and then hit a brick wall.

But seriously don't put time into this that could be used preparing for your exam. I can wait.

Devac  ·  3130 days ago  ·  link  ·  
This comment has been deleted.
bhrgunatha  ·  3127 days ago  ·  link  ·  
This comment has been deleted.
bhrgunatha  ·  3127 days ago  ·  link  ·  
This comment has been deleted.
bhrgunatha  ·  3127 days ago  ·  link  ·  

So I solved 94! Thanks for the tip.

In order to solve it I took your approach, and failed. I assume because not every n, n, n ± 1 forms a valid triangle and my filtering was obviously wrong. Using brute force feels wrong, but of course I do use that. It just seems like there must be a better approach and the large numbers in the questions are obviously there to discourage brute-force.

My winning approach was to generate pythagorean triples (as I already had code to do just that) and use those which apply to the question. Although relatively slow (still < 1 minute) it got me into the forum which shows a couple of much faster, very direct approaches to the solution.

Since lots of Euler questions involve solving for integers - often with 2 variables - I'd like to request an introduction to diophantine equations - and I keep coming across Pell's equation in the forums which looks like it's related.

    Ad. 93 ... I would love to get explanations and tips myself actually.

Once you've solved it you get a link to a forum topic for that question. There are usually lots of good advice in those.

Devac  ·  3127 days ago  ·  link  ·  
This comment has been deleted.