Live data from Hacker News

Project Euler

projecteuler.net

151–160 of 172 posts

Re: Project Euler

#151

Earlier quoted context omitted.

I've solved 273 as of now ( https://projecteuler.net/profile/NabiNaga.png ). It took me a little less than 2 years to get to 250 problems, but I was spending quite a bit of time on them haha. I've learned an incredible amount of math and algorithm skills from PE. There have been lots of really challenging ones, but one that stands out is 494. That was the first "really hard" one I solved, and my first time to be in t…

That is quite an achievement. Can you comment on your background ? type of education, work.

I was finishing up the second year of a computer engineering degree when I discovered Project Euler, and after a few months of solving the problems I realized I wanted to study math instead, so I switched my major to applied math. Honestly I learned more from solving PE problems than school. Now I'm working in industry on AI.

Re: Project Euler

#152

To ask people who solved many of these questions: Once you find "the" trick, is there still a lot of computation involved? Do you still write loops? How many orders of magnitude times do those loops run? How do you know when your code is too computationally intensive and you haven't found "the" trick yet?

[deleted]

Re: Project Euler

#153
post #92

I guess I'm becoming an old fart. I used to like programming puzzles, challenges, things like this. But as time marches on, I realize that the real-world problems I have to solve are already so challenging and require enough critical thinking, that I'm best served just focusing on them. Between family life, doing real-world challenges for income, downtime to breathe, diverse hobbies for the spiritual good of my perso…

How far do you go into your hobbies? If you were working in those fields, maybe you'd find your current efforts produced little satisfaction compared to efforts that would help you get your work done.

For a lot of people, programming has nothing to do with their work, it is just a hobby. Project Euler and the like are great fun for kinds like that.

Re: Project Euler

#154

Are there any 200+ PE readers here ? If so, how long did it take you to reach you level and what was the most challenging problem you solved ?

In grad school (for math) I used to procrastinate by doing Project Euler problems. I've got that bad habit under control since then (for example, logging in just now, the site told me I haven't done a problem in 56 days!), and am currently at 322 (https://projecteuler.net/profile/oantolin.png).

Don't get sucked in!

Re: Project Euler

#155

After hearing about it for years, I decided to start working through Project Euler about two weeks ago. It really is much more about math than programming, although it's a lot of fun to take on the problems with a language that has tail call optimization because so many of the problems involve recurrence relations. I like that the problems are constructed in a way that usually punishes you for trying to use brute for…

My only real complaint is (according to my experience) unless you happen to understand some mathematical concept/s involved in the question, it's incredibly difficult to get some insight or clue for how to go about solving it. The forums are a fantastic resource once you already know how to solve the problem .

You could just look things up with Google, Wikipedia, etc. It's not like it's hard to do that for the first 100 problems.

Re: Project Euler

#156

After hearing about it for years, I decided to start working through Project Euler about two weeks ago. It really is much more about math than programming, although it's a lot of fun to take on the problems with a language that has tail call optimization because so many of the problems involve recurrence relations. I like that the problems are constructed in a way that usually punishes you for trying to use brute for…

You can try http://www.spoj.com/ if you're more interested in algorithms-oriented programming contests.

Re: Project Euler

#157
post #92

I guess I'm becoming an old fart. I used to like programming puzzles, challenges, things like this. But as time marches on, I realize that the real-world problems I have to solve are already so challenging and require enough critical thinking, that I'm best served just focusing on them. Between family life, doing real-world challenges for income, downtime to breathe, diverse hobbies for the spiritual good of my perso…

I just turned 39 but don't have the family bit (single, no kids, etc). I generally consider lazily doing PE problems and similar things as how I do take downtime to breathe. No pressure there, and my only goal is to learn some more math, but in a stubborn manner. I am only interested in learning it if I can learn it deeply so that it truly makes sense. I got enough of 'memorize this bullshit and regurgitate it later without understanding' in school. It's only since leaving school I've been able to ENJOY mathematics.

Re: Project Euler

#158

After hearing about it for years, I decided to start working through Project Euler about two weeks ago. It really is much more about math than programming, although it's a lot of fun to take on the problems with a language that has tail call optimization because so many of the problems involve recurrence relations. I like that the problems are constructed in a way that usually punishes you for trying to use brute for…

>It really is much more about math than programming

This is true to a degree. My first venture into Project Euler I was using Python, and some of the early problems involve manipulations of lists of numbers. These were almost non-problems using Python. Coming back to those same problems using C, they became a little more challenging.

One of the most important lessons I learned from PE was all the computer power in the world won't outrun a good algorithm.

Re: Project Euler

#159
post #9

Ah, memories. Back in 2010 I whinged to colleagues who were using their fancy functional languages to solve problem 1 inefficiently in 2 lines of code... " Project Euler problem 1 :- It helps to know the sum of (1 .. x) is 0.5 * n * (n+1). Multiples of 3 less than 1000 are (3 .. 999) == (1 .. 333) * 3 = 0.5 * 333 * 334 * 3 = 166833 Multiples of 5 less than 1000 are (5 .. 995) == (1 .. 199) * 5 = 0.5 * 199 * 200 * 5 =…

Oh cool!

I've been working with a continuation-pasing style variant of Joy (https://en.wikipedia.org/wiki/Joy_programming_language https://github.com/calroc/joypy) and tried it on the Project Euler problem 1: https://github.com/calroc/joypy/blob/master/docs/3.%20Develo...

I came up with a solution that generalizes to blocks of terms, but yours is much much nicer! Cheers!

""" Between 0 and 990 inclusive there are sixty-six "blocks" of seven terms each, starting with:

    [3 5 6 9 10 12 15]
And ending with:

    [978 980 981 984 985 987 990]
If we reverse one of these two blocks and sum pairs... """

The Advent of Code 2017 includes a puzzle involving a "spiral" memory grid and I had a similar thing where I was able to figure out a simple mathematical way to solve the puzzle: https://github.com/calroc/joypy/blob/master/docs/Advent%20of...

I'm not explaining it well 'cause I'm all excited to show it.

Re: Project Euler

#160

Are there any 200+ PE readers here ? If so, how long did it take you to reach you level and what was the most challenging problem you solved ?

I've solved 249 of them. I don't remember when I joined, but it must have been about 10 years ago. Solving PE problems was a great way to unwind in grad school (studying math) and learn some cool math in the process. There was a period where I was knocking them out pretty frequently, but I've only had the time to solve 4 problems in the past year.
Post reply on HN