Project Euler

(projecteuler.net)

246 points | by swatson741 6 hours ago ago

54 comments

  • SethTro 43 minutes ago

    I wrote Problem 371, https://projecteuler.net/problem=371 , as a high school student in 2012!

    I'm so happy to have spent twenty years of my life learning math and solving problems on Project Euler and elsewhere.

  • peterkagey 2 hours ago

    I wrote Problem 619 (https://projecteuler.net/problem=619) which was published on 2018-01-27 and solved by 474.

    The problem was based on 2013 Putnam Exam problem A2 (https://kskedlaya.org/putnam-archive/2013.pdf) which I took at the end of undergrad.

    I got an email six years later (in November 2024) telling me they accepted the problem:

    Greetings!

    Please excuse the email. It's quite possible that you are no longer active at Project Euler, but we are currently trying to retrospectively acknowledge contributors of problems.

    You were identified as being involved with Square subsets [619 m] in Sep-17.

    If you would like to be added as a verified contributor, please reply to this email and provide the username you currently use at projecteuler.net. Please note that contributor usernames will not appear publicly, rather they will be used internally to unlock new contributor awards we are introducing.

    Regards,

    Project Euler Team

    • webo 28 minutes ago

      I was curious if LLMs are good for this problem. ChatGPT-5.1-Thinking one-shotted a correct Python script without any library use (https://pastecode.io/s/jg6ggxpm).

      Claude Opus failed to solve after trying for a while.

      • whimsicalism 6 minutes ago

        project euler problems are likely in the RL corpora

  • BeetleB 2 hours ago

    Ha! I did a lot of these around 2007-2008. I solved the first 100 or so ones. Solving these were more fun than any other programming problems site I've seen. I quit it when I realized I was spending 4+ hours per problem - I couldn't justify the time.

    Beyond a certain point, most required some knowledge of elementary number theory.

    • goalieca 2 hours ago

      Same timeline for me! This was my great procrastination side quest during grad school. I learned haskell and a bit of ocaml working on these. Functional languages are extremely well suited to these kinds of problems.

    • coef2 2 hours ago

      I agree with you. About a decade ago, I got really tired of coding interview prep. I somehow ended up getting into Project Euler and worked through the first 100 problems. It was a great way to learn a bit of number theory and regain my interest in programming.

  • Gormisdomai 4 hours ago

    This website was a part of my education as a computer scientist and seeing it here again I'm curious for the full story of how this site was made. Who made it, what do they do now, is it part of a broader project they have?

    There is only very basic info here: https://en.wikipedia.org/wiki/Project_Euler

    • campbel 3 hours ago

      Back in early 2000s, before hackerrank and similar coding sites, this is what my professors recommended for training programming skills.

    • observationist 4 hours ago

      https://archive.is/iEQxy

      This article is excellent. It mentions the creator, Colin Hughes, and the story behind the project, but it boils down to a passion project for him.

  • pveierland 9 minutes ago

    What's really neat is that most of the problems are so compact that you can just read about the full problem, then spend hours and days thinking about possible solutions.

    I created a PDF version that I keep on my Remarkable for puzzling: https://github.com/pveierland/project_euler_offline

  • Imnimo 3 hours ago

    These are both a lot more fun, and a lot more educational than leetcode problems. Strongly recommend for anyone looking for practice problems when learning a new language or whatever.

  • unkulunkulu 3 hours ago

    The most fun on this site is solving a problem and then having your mind blown by solutions in Apl/j/k and trying to guess what they mean without knowing anything about those languages

    • taeric 2 hours ago

      Even better than the crazy languages, is seeing some fundamental math used to prevent having to do a ridiculously expensive search.

      That said, raw brute force often did far better than you'd like to admit.

      • debatem1 an hour ago

        The biggest thing I learned from PE was that neither elegant theory nor brute force had a monopoly on successful optimization strategies. It's been something I've carried with me ever since and has over and over again proven its value.

        A real gem of a resource.

    • omegaham 2 hours ago

      See also Uiua, a newcomer to the "extremely cool but completely incomprehensible language" family!

  • thornewolf 4 hours ago

    I have done Project Euler very sporadically since high school. To date I've only done problems 1-54. Despite this, I think the website was a big contributor to my love of programming. I found it before knowing about leetcode and I think it prepared me well. I think I owe Project Euler a decent %-age of my eventual entry into Software Engineering as a field.

    • ljlolel 3 hours ago

      Ditto!

      Also a great way to learn a new programming language is to try project Euler problems with it.

  • kekqqq 2 hours ago

    No one tells you that they delete inactive accounts. I used to have over 300 solved problems htere. Now it is all gone, all the effort, but the skill remained of course.

    • inasio an hour ago

      A few years back (10 maybe?) they had a disk crash, and there was a notice that for people with 100 or more problems solved they'd do an extra effort to recover their solutions and add you back, not sure if it was only posted on the main website. I was lucky to get my account back at the time

    • doodpants 42 minutes ago

      So, I gather that you treated your solutions as throw-away code, rather than keeping them? Kind of surprising, considering that some problems build off of each other, or otherwise benefit from sharing code; you never know when the code for one solution could be useful later. For example, a prime number generator/tester is necessary for many of the problems.

      (I have all my solution code, in source control no less, so if I ever lost my account, I could just run them all and re-enter the solutions.)

    • yogsototh an hour ago

      I remember there were data loss, but my account appears to have been recovered. You may try to login again, and with luck, like me you will get back your history.

  • akudha an hour ago

    Are there other similar sites? I remember this one, for bioinformatics

    https://rosalind.info/problems/list-view/

  • phil-pickering an hour ago

    I think a hat-tip is due to freeCodeCamp for introducing Project Euler (along with Rosetta Code) to a new generation of programmers:

    https://www.freecodecamp.org/learn/project-euler/#project-eu...

  • davidhariri 2 hours ago

    I learned so much from this site- including that so much education comes from being prompted to ask the right questions.

  • meken 2 hours ago

    One of my best memories was in undergrad there was one semester in 2013 where half a dozen of my CS classmates and I competed to try and solve the most Project Euler problems. We had a leaderboard and everything.

    I saw first hand how much faster my friend’s Java solutions were than my Python solutions.

    Good times.

  • matthewaveryusa 3 hours ago

    I attribute project euler for instilling the playful enjoyment of writing programs in college while I was studying electrical and computer engineering. I owe my career to it!

  • Sparkle-san 4 hours ago

    Like many others here, Project Euler was foundational in my education and growth as a programmer.

    Leonhard Euler himself is an incredible figure and arguably the most prodigious contributor to mathematics throughout history. So much so that people started naming things discovered by him after the next person to have proved them.

    https://en.wikipedia.org/wiki/List_of_topics_named_after_Leo...

  • senderista an hour ago

    So much more fun than leetcode. OTOH, unlikely to help you in an interview.

  • zkmon 4 hours ago

    A great one of my favorite websites of the past. Wonder how they are coping with the issue of their users using AI to solve problems.

    • Schiphol 3 hours ago

      I suppose I wonder how those users are coping with having the robots do all the stuff instead of them doing some of the stuff.

  • pkoird 2 hours ago

    I remember it vaguely but there used to be a badge awarded for being among the first 100 people to solve the problem. I was obsessed with getting that badge to the point that I spent obscene amount of time solving the-then recently released problem even when the following day was my final exams. I did manage to get that badge though. This was circa 2013. Fun times!

  • nik9000 3 hours ago

    I ranked on that once! I was like the 23rd person to do one of the new problems one time. Just about as low as you can rank. It was a fun puzzle but you had to be awake at a funky time to do it.

  • ketanmaheshwari 3 hours ago
  • codexb 3 hours ago

    Wow, I can't believe this is still around! I'm glad to see artifacts from the past like this are still out there on the internet.

    Makes me miss Google CodeJam though.

  • theoldgreybeard 3 hours ago

    I love running euler problems when trying to learn the basics of a new programming language. I have a small collection of programs in like 10 different languages that I keep around as a reference for things because I always try to use language-specific features to solve the problems, and then I reference them as examples.

    • gregdeon 3 hours ago

      Wow. You reminded me of a computer engineering class years ago where we wrote assemblers and emulators for a simple architecture. I tested mine by writing a solution for one of the first Project Euler questions!

  • bre1010 4 hours ago

    I discovered project euler as a novice programmer in high school around 15 years ago. I loved how solving a problem unlocks a secret forum only available to other solvers. I would spend hours reading through everyone's prior solutions and trying to understand them. One guy had tagged his profile as "haskell" but would always provide his solutions in ruby which threw child-me for quite a loop (I actually thought ruby and haskell were the same language for some time)!

  • medbar an hour ago

    very surprised this project is still releasing problems weekly - I remember this being up when I was in high school. maybe I'll pick it up again since I only did the first ~30 or so back then.

    • philiplu 41 minutes ago

      Not only are they still releasing problems weekly, they have a long backlog of problems waiting for release. I submitted a problem back in April 2024, and it didn't get published until October 2025 (problem 963). There's an excellent core development team that works with problem-submitters to get problems tuned up for Project Euler.

  • aiahs 2 hours ago

    I did a lot of these when I was around 15-16 and it solidified for me my interest in CS but in general abstract thinking and problem solving. Great site.

  • callc 3 hours ago

    I too owe had my love for programming captured through project Euler. I am immensely grateful to my maths prof who introduced me to it.

    I also love looking back at my old PE code and having absolutely no idea what it doing. No comments, no docs, no notes. From a different era.

  • 0x1ch 3 hours ago

    I remember visiting Project Euler back in 2013/14 or so. Was really my first introduction to programming exercises as youngin. Probably did fifteen or so of them before ADHD kicked in though. A small gem on the web.

  • sizzzzlerz 3 hours ago

    i was a euler fanatic some years ago reaching problems in the 500s albeit, skipping problems along the way. at that point, too many problems required a deeper math background than i possessed so i abandoned it. what amazed me was that others composed solutions that solved problems in mere milliseconds that brute force approaches would still be running when the universe cooled to absolute zero.

    • rbongers 3 hours ago

      I only reached the 100s back in the day. What amazed me was that it seemed like every problem had a paper solution, when it would take any computer algorithm thousands or millions of computations to solve the same problem.

      • rufus_foreman an hour ago

        I played around with some of the easier problems, my favorite was a couple times when starting with the obvious brute force solution in code and then refactoring and simplifying it iteratively ended up getting me the paper solution.

  • darylteo 2 hours ago

    How I learnt about prime number sieves.

    Good prep for Advent of Code in 2 weeks.

  • shaunxcode 2 hours ago

    this is how you end up getting into APL/array langs for sure.

  • anthk 2 hours ago

    Thanks for reminding me this; I'd try to solve them both in Scheme (s9fes) and JimTCL.

  • sbmthakur 3 hours ago

    Hackerrank also used to host(still has?) PE problems with additional test cases.

  • fortranfiend 25 minutes ago

    fake frustration yet another thing named after euler.

  • graycat 4 hours ago

    Glanced at the exercises. It appears that two of them have numbers arranged in a triangle and ask for a longest path.

    Hmm. Given such a triangle, let m be the largest number in the triangle. For each x in the triangle, replace it with m - x. For the resulting triangle, solve it to give the shortest path using one of the well known network shortest path algorithms.

    • thaumasiotes 9 minutes ago

      > Hmm. Given such a triangle, let m be the largest number in the triangle. For each x in the triangle, replace it with m - x.

      By the time you've actually done these two steps, you could have already finished the problem with a dynamic programming approach.

      (Starting from the bottom row and working upward, replace each cell in the row with the length of the longest path from itself to the bottom, which you can know by checking which of its two children has the longer path associated.)

  • nurettin 3 hours ago

    2007 I remember writing one-liner ruby solutions up to 100.