Added solution for Project Euler problem 74.#3125
Merged
dhruvmanila merged 3 commits intoTheAlgorithms:masterfrom Oct 15, 2020
fpringle:problem_74
Merged
Added solution for Project Euler problem 74.#3125dhruvmanila merged 3 commits intoTheAlgorithms:masterfrom fpringle:problem_74
dhruvmanila merged 3 commits intoTheAlgorithms:masterfrom
fpringle:problem_74
Conversation
dhruvmanila
reviewed
Oct 15, 2020
Member
dhruvmanila
left a comment
There was a problem hiding this comment.
Announcement:
This message is sent to all pull requests which are OPEN, NOT MERGED, not containing 'wontfix' label and contains 'Project Euler' or 'Project' or 'Euler' (case doesn't matter) in their title. If this message doesn't apply to your pull request, please ignore this.
Message:
This is to notify all the users submitting a pull request for the Project Euler solution that the README.md file has been updated with all the style requirements necessary for the directory and solution files. Please read through it and make all the necessary changes required to your submission.
dhruvmanila
approved these changes
Oct 15, 2020
stokhos
pushed a commit
to stokhos/Python
that referenced
this pull request
Jan 3, 2021
* Added solution for Project Euler problem 74. Fixes: TheAlgorithms#2695 * Added doctest for solution() in project_euler/problem_74/sol1.py * Update docstrings and 0-padding of directory name. Reference: TheAlgorithms#3256
Panquesito7
pushed a commit
to Panquesito7/Python
that referenced
this pull request
May 13, 2021
* Added solution for Project Euler problem 74. Fixes: TheAlgorithms#2695 * Added doctest for solution() in project_euler/problem_74/sol1.py * Update docstrings and 0-padding of directory name. Reference: TheAlgorithms#3256
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Name: Digit factorial chains
The number 145 is well known for the property that the sum of the factorial of its digits is equal to 145:
1! + 4! + 5! = 1 + 24 + 120 = 145
Perhaps less well known is 169, in that it produces the longest chain of numbers that link back to 169; it turns out that there are only three such loops that exist:
169 → 363601 → 1454 → 169
871 → 45361 → 871
872 → 45362 → 872
It is not difficult to prove that EVERY starting number will eventually get stuck in a loop. For example,
69 → 363600 → 1454 → 169 → 363601 (→ 1454)
78 → 45360 → 871 → 45361 (→ 871)
540 → 145 (→ 145)
Starting with 69 produces a chain of five non-repeating terms, but the longest non-repeating chain with a starting number below one million is sixty terms.
How many chains, with a starting number below one million, contain exactly sixty non-repeating terms?
Reference: https://projecteuler.net/problem=74
Reference: #2695
Checklist:
Fixes: #{$ISSUE_NO}.