Skip to content

Added solution for Project Euler problem 125 #3073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 9, 2020
Merged

Added solution for Project Euler problem 125 #3073

merged 2 commits into from
Oct 9, 2020

Conversation

fpringle
Copy link
Contributor

@fpringle fpringle commented Oct 8, 2020

Name: Palindromic sums

The palindromic number 595 is interesting because it can be written as the sum of consecutive squares: 6^2 + 7^2 + 8^2 + 9^2 + 10^2 + 11^2 + 12^2.

There are exactly eleven palindromes below one-thousand that can be written as consecutive square sums, and the sum of these palindromes is 4164. Note that 1 = 0^2 + 1^2 has not been included as this problem is concerned with the squares of positive integers.

Find the sum of all the numbers less than 10^8 that are both palindromic and can be written as the sum of consecutive squares.

Reference: https://projecteuler.net/problem=125
Reference: #2695

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

@dhruvmanila dhruvmanila changed the title Added solution for Project Euler problem 125. Fixes: #2695 Added solution for Project Euler problem 125 Oct 9, 2020
@dhruvmanila
Copy link
Member

Hey, this looks perfect.
This doesn't fix the issue, you can say this is a reference to it: reference: #issue
I see you have submitted a lot of PR so please make the above changes to all of them.

@dhruvmanila dhruvmanila merged commit c83e4b7 into TheAlgorithms:master Oct 9, 2020
@dhruvmanila
Copy link
Member

Oh sorry to be ambiguous but I meant to put the reference part in the description and not in the title.

@fpringle
Copy link
Contributor Author

Gotcha, will do

@dhruvmanila
Copy link
Member

@fpringle Hey, if possible can you take a look at the problem 234's solution in the repo? Every problem has been fixed for #2786 except for that because it's asking for an input in every loop. Thanks if you do.

@fpringle
Copy link
Contributor Author

fpringle commented Oct 10, 2020

@fpringle Hey, if possible can you take a look at the problem 234's solution in the repo? Every problem has been fixed for #2786 except for that because it's asking for an input in every loop. Thanks if you do.

@dhruvmanila sure thing! At first glance it looks like someone's mixed up 2 different problems - the docstring description is problem 234 as required, but the code itself seems to be related to problem 230 (completely unrelated problem). My guess is that the original poster make a typo in their commit, and then some automated tool added the docstrings? Just a guess.
Beyond that, I can't really figure out what the algorithm itself is meant to do, nor why there are repeated uses of input(). Maybe there was only meant to be one initial stored input(), for entering the original A and B strings from problem 230?

@dhruvmanila
Copy link
Member

As per the history of the file, it was submitted as a solution to problem 234 so it being a solution for problem 230 is quite unlikely. I will most likely open an issue regarding this to change or remove the solution. If you've solved this problem then you can open a PR but AFTER I open the issue.

I also see that you have submitted a lot of solutions which is really good but if possible can you slow down a bit, as the number of PRs is increasing a lot due to Hacktoberfest and one of our main maintainers is busy in some other work.

@fpringle
Copy link
Contributor Author

As per the history of the file, it was submitted as a solution to problem 234 so it being a solution for problem 230 is quite unlikely. I will most likely open an issue regarding this to change or remove the solution. If you've solved this problem then you can open a PR but AFTER I open the issue.

Sure thing. Please let me know when you open the new issue.

I also see that you have submitted a lot of solutions which is really good but if possible can you slow down a bit, as the number of PRs is increasing a lot due to Hacktoberfest and one of our main maintainers is busy in some other work.

Of course, sorry for the increased workload! I'll be away from a computer for the next 4 or 5 days anyway.

@fpringle fpringle deleted the master branch October 13, 2020 15:20
stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
* Added solution for Project Euler problem 125

* Fixed typos
Panquesito7 pushed a commit to Panquesito7/Python that referenced this pull request May 13, 2021
* Added solution for Project Euler problem 125

* Fixed typos
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