Skip to content

Conversation

ArnabTechiee
Copy link

Contributes to #8594

Description

This pull request optimizes the solution for Project Euler Problem 34 (problem_034/sol1.py).

The change replaces the previous, larger upper bound calculation with a more efficient, mathematically proven limit of 1,499,999. This significantly reduces the number of iterations required to find the solution, making the code much faster.

This optimization is based on the proof referenced in the original issue.

How I Tested It

The updated solution's correctness has been verified by running the project's validation script:
python scripts/validate_solutions.py 34

@ArnabTechiee
Copy link
Author

Hi @dhruvmanila,

I've submitted a pull request (#13531) that contributes to this optimization issue. It implements the suggested fix for Problem 034 by lowering the upper bound.

I would appreciate a review when you have a free moment. I'm ready to make any changes needed.

Thank you!

Copy link
Contributor

@mindaugl mindaugl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link does not seem to work, it redirects to unrelated webpage.

@ArnabTechiee
Copy link
Author

The link does not seem to work, it redirects to unrelated webpage.

Thanks again for the feedback, @mindaugl. I've replaced the previous link with a stable source from Rosetta Code that details the proof.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants