Top
Best
New

Posted by swatson741 10 hours ago

Project Euler(projecteuler.net)
364 points | 85 comments
SethTro 5 hours 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.

stevefan1999 1 hour ago||
That sounds like a combinatorial problem...alphabets from AAA to ZZZ, numbers from 000 to 999.

That means one of the total sum of possible car plates is 26^3.

Since we want to find pairs (x, y) that x + y = 1000. That means the total sum would also add up sum([1 for x in range(1000) for y in range(1000) if x + y == 1000])/2 since there is a symmetry.

But wait, find the expected number of plates he needs to see for a win. So maybe we need to borrow something from statistics (Possion/chi-squared distribution) or queueing theory...?

Edit: ah I saw the solution, it is a Markov chain.

am17an 4 hours ago|||
This is one of my favourite problems, I still remember that it has a very real edge case even though I solved it more than 10 years ago. Thank you for the problem!
vhcr 36 minutes ago|||
I'm guessing if you only calculate based on the digits, the probability is going to be slightly different than the real one, because you only have a finite number of plates you can choose from.
knollimar 3 hours ago||||
Can you reuse a plate with 500?
hatthew 2 hours ago||
The wording seems to strongly imply no; you need two separate plates with 500 on them.
SethTro 3 hours ago|||
I'm glad you enjoyed! It was a real game I played when driving around.
dekhn 4 hours ago||
Interesting- I ask a license plate question (when will california run out of plates in its current serialization format, based on a couple of plates observed in two different years). It's a much simpler question, though (just linear extrapolation).
peterkagey 6 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

LTL_FTC 15 minutes ago||
Were you also one of Dr. Kedlaya’s students? Or just used that link? I was in an undergrad course of his and really enjoyed it. Such a smart guy.
webo 5 hours 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 4 hours ago|||
project euler problems are likely in the RL corpora
mvdtnz 3 hours ago|||
First of all, don't do this. No one cares. Secondly obviously every Euler solution is going to appear in the training data many times over. It's no surprise at all that an LLM can regurgitate data that was given to it.
kragen 3 hours ago||
I thought it was interesting, and I wouldn't be surprised if Euler solutions weren't in the training data, especially for the later problems like this one.
BeetleB 7 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 6 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 6 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 9 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

observationist 8 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.

campbel 8 hours ago||
Back in early 2000s, before hackerrank and similar coding sites, this is what my professors recommended for training programming skills.
unkulunkulu 8 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 6 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 5 hours 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 6 hours ago||
See also Uiua, a newcomer to the "extremely cool but completely incomprehensible language" family!
Imnimo 7 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.
thornewolf 9 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 7 hours ago|
Ditto!

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

pveierland 4 hours 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

dhbradshaw 53 minutes ago||
Project Euler was what I used to get comfortable with my two main languages -- first python and then rust.

I loved to solve it and then look through all the different solutions and find pretty ideas and idioms.

kekqqq 6 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 5 hours 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 5 hours 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 5 hours 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.
Loocid 3 hours ago||
How long before they start deleting? I haven't logged in for 5 years and my account is still there.
More comments...