ChatGPT for Project Euler: Hints Without Spoilers
How to use ChatGPT to get useful hints on Project Euler problems without losing the satisfaction of solving them yourself.
Updated 5 min read
Project Euler (opens in a new tab) is a collection of mathematical and programming problems designed to require a combination of mathematical insight and programming skill. The problems are meant to be solved independently. Using ChatGPT to get the answer outright defeats the exercise and produces no lasting learning. Using it carefully for hints is a different matter.
The same principle applies to keeping track of your methods. Tools like fenbs record what you tried, what you learned and what to do differently, so the next similar problem benefits from the previous one.
What Project Euler is
Project Euler publishes numbered problems, each requiring a specific numerical answer. Problems are designed so that a brute-force approach either takes too long or is impossible, pushing solvers toward efficient algorithms and mathematical reasoning. The site tracks which problems you have solved and shows community statistics once you submit a correct answer.
The challenge is intentional: the effort of finding an efficient approach is where the learning happens. A correct answer obtained by copy-pasting someone else's solution or asking an AI to produce one gives you the number but not the understanding.
Asking for a hint, not a solution
The key is to describe where you are stuck rather than what the problem is asking. If you paste the full problem statement and ask ChatGPT to solve it, you will get a solution. If you describe your current approach and ask what is wrong with your reasoning, you get something more useful.
I am working on a math problem that involves [describe the mathematical concept, not the specific problem]. My current approach is [describe what you have tried]. I am stuck because [specific obstacle]. Give me a hint about the mathematical concept or the approach without solving the specific problem for me.
This kind of prompt keeps the problem-solving in your hands. The assistant points you toward a concept or a technique; you work out how it applies to the specific problem. The hint might be: "look at whether the problem has a pattern related to number theory" or "consider whether there is a closed-form expression for this kind of sum." Those are useful without giving the answer.
Testing your reasoning
Once you have a proposed solution or a partial approach, ChatGPT is useful for checking your reasoning. Explain your logic step by step and ask the assistant to identify any flaws without giving you the correct approach.
Here is my reasoning for solving this type of problem: 1. [first step] 2. [second step] 3. [conclusion] Are there any logical errors in this approach? If so, describe the type of error without correcting it for me.
The assistant can tell you "step 2 contains an assumption that is not always true for this kind of input" without handing you the fix. That is enough to send you back to the problem with a better question.
Learning from a wrong approach
When a solution is correct but too slow, ChatGPT can explain the category of optimization problem you are facing. Ask about the concept, not the specific fix. "My solution works but times out on large inputs. What categories of algorithmic improvement typically address this kind of performance problem?" points you toward dynamic programming, memoization or mathematical shortcuts without solving the specific problem.
After you have solved a problem, asking ChatGPT to explain the general mathematical principle involved is also a good review step. At that point you already know the answer, and the explanation builds the conceptual understanding that helps with future problems.
Keep a record of what each problem taught you
fenbs keeps Lessons learned linked to specific work. After solving a Project Euler problem, record what approach worked, what did not and what the key insight was. Before tackling the next problem, read the lessons from similar ones. Over time the record replaces the habit of re-learning the same technique from scratch. fenbs is free for one person, no credit card.
Create a free accountFree for one person · No credit card · Works with Claude, ChatGPT, Cursor and more
After solving a problem
After you submit the correct answer, Project Euler shows the community forum thread for that problem. Reading how others approached it is part of the learning. Before you look, ask ChatGPT to explain the general mathematical area your solution used. Then compare that explanation to what you see in the forum. If others used a fundamentally different method, ask ChatGPT to explain that method at a conceptual level, separate from the specific problem.
This comparison is where the learning compounds. If your solution worked but used a less efficient approach, understanding the more efficient method at a conceptual level helps you recognize when to apply it on the next problem.
Recording your methods
A solution that took you several hours to reach is more useful to your future self if you record how you got there. The record does not need to be long: the problem number, the approach that worked, the dead end you tried first and the concept that unlocked it. That is enough to recognize a similar structure next time.
A problem log does not need to be formal. A few sentences per problem is enough. Over time, patterns emerge that are not visible in a single session: you start to notice which problem types tend to involve number theory, which tend to use combinatorics, and what hints tend to be useful for each. The hints you need become more targeted as the log grows.
Also worth recording: prompts that produced useful hints. A well-constructed hint prompt for one type of problem often works with slight adaptation for another.
How to do this with fenbs
- Create a free account and set up a project for your Project Euler work.
- Add each problem you tackle as a task. Note your approach and where you are stuck.
- After solving a problem, record what worked as a Lesson learned in fenbs, linked to the task.
- Save the hint prompts that produced useful results as Skills in fenbs.
- Before starting a problem that resembles a previous one, ask a connected assistant to read your lessons and remind you of the relevant approach.