Maybe I should write a book on the maths and comp/sci behind the first 100 Project Euler problems

Been feeling lost in life possibly due to mid life crisis.

Been trying to find some clarity and I just remember how happy I felt doing Project Euler problems back in high school.

I read on the site that the owner doesn’t mind if you share the solutions to the first 100 problems so I thought

  • I have a math degree
  • I was on the honour roll of my uni for computer science
  • I like sharing knowledge
  • I wanna leave something behind for my son to remember me by

Maybe I should write a book that systematic treats all the math and comp/sci needed to solve the first 100 Project Euler problems. I would be systematically catalogue the problems and research the most elegant solutions to them and write it up.

We need

  • dynamic programming
  • recursion
  • memoization
  • diophantine equations
  • seqeuences
  • matrices
  • factorization of matrices

So many fun things to write about! Also the language used to illustrate the ideas will be Julia of course.

Sounds like a plan. Get to work.

16 Likes

Some time ago I decided to get back into Project Euler, do the 1st 100 problems and publish the solutions on github. I haven’t decided on doing any educational writeups yet.

If it brings you joy to write on these topics then you totally should, there is no argument against it. But if its aimed at helping people solve it then I think the concepts for the first 100 problems are easily searchable. I mean not the solution but finding what you are missing when trying to solve the problem. My fond memories of project euler are the struggles. Letting the computer run overnight to solve via brute forcing. Finding out about and optimising sieve. Spending more time on the problem for a faster solution. There was this line somewhere earlier on the site (maybe its still there), “If you can’t solve it then you can’t solve it”. I really believe in this line. The best thing is to walk away and retry later, ask silly questions about the problem but never look at the solution.

My solution repo: GitHub - Ellipse0934/ProjectEuler: My personal project euler progress

2 Likes

I think I will refrain from solutions in any write up. Even in the forums, the best solution often don’t come with the proper math. I think doing that is good. Also things like memorisation is not covered. So it’s more educational than anything.

3 Likes

Sounds like a great idea and I’d be interested in reading it.

3 Likes

I would also be interested in such an output, I had fun with the several Euler Project puzzles I did years ago in Julia.

Would you also consider taking things a step up and making, say, interactives for some of the puzzles? Or delving deeper into the background behind some of the puzzles?

Just today I watched The Code Parade’s expansion on a puzzle his son was given in school, which was a nice interaction opportunity between the two of them with the puzzle. You could maybe make similar things with the Euler Project.

And sorry to hear about your midlife crisis, hang in there mate.

Go on! I did this some time ago, but just solving the first problems (see Project Euler with Julia - Problem 5 ); adding the theory and math to the explanation would be cool, even more with some advanced optimization techniques.

Set up a Quarto project and publish so we can see it!

Nice one. Even your problem 5 have some interesting high school level theory.

1 Like

As an alternative to Quarto, consider running Julia in Typst via the Typst Jlyfish package. In my opinion, the best experience for writing a document with executed Julia code blocks in it. It becomes a live reactive session developing the document in VS Code.

1 Like

Was watching the Juliacon preso on it

1 Like

I’ve been using Typst for the past month, getting used to its syntax and how Julia works with it, and it has almost everything I want.

I’m particularly watching the development of inserting unicode symbols ala VS Code development in *.jl and *.md files.

I also opened a PR on documenting a caveat for Typst users who are trying to create large documents e.g. books, which may be related to your prospective goal of writing a book.

The key contenders are

  • rmarkdown with Julia runtime
  • Typst
  • Quartro
  • Latex
2 Likes