The Wayback Machine - https://web.archive.org/web/20201019103834/https://github.com/TheAlgorithms/Python/pull/3183
Skip to content
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

Added solution for Project Euler problem 183 #3183

Open
wants to merge 21 commits into
base: master
from

Conversation

@prakhargurunani
Copy link

@prakhargurunani prakhargurunani commented Oct 11, 2020

Describe your change:

Name: Maximum product of parts

Problem Statement: Let N be a positive integer and let N be split into k equal parts, r = N/k, so that
N = r + r + ... + r. Let P be the product of these parts, P = r × r × ... × r = rk.
For example, if 11 is split into five equal parts, 11 = 2.2 + 2.2 + 2.2 + 2.2 + 2.2,
then P = 2.25 = 51.53632. Let M(N) = Pmax for a given value of N. It turns out that
the maximum for N = 11 is found by splitting eleven into four equal parts which leads
to Pmax = (11/4)4; that is, M(11) = 14641/256 = 57.19140625, which is a terminating decimal.
However, for N = 8 the maximum is achieved by splitting it into three equal parts,
so M(8) = 512/27, which is a non-terminating decimal. Let D(N) = N if M(N) is a non-terminating
decimal and D(N) = -N if M(N) is a terminating decimal. For example, ∑ D(N) for 5 ≤ N ≤ 100 is 2438.
Find ∑ D(N) for 5 ≤ N ≤ 10000.

Reference: https://projecteuler.net/problem=183

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}.
prakhargurunani and others added 3 commits Oct 11, 2020
@prakhargurunani prakhargurunani requested a review from dhruvmanila as a code owner Oct 11, 2020
prakhargurunani and others added 2 commits Oct 11, 2020
github-actions github-actions
@TravisBuddy
Copy link

@TravisBuddy TravisBuddy commented Oct 11, 2020

Travis tests have failed

Hey @prakhargurunani,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: b8bd2140-0b94-11eb-a59b-f3f3774a9991
@TravisBuddy
Copy link

@TravisBuddy TravisBuddy commented Oct 11, 2020

Travis tests have failed

Hey @prakhargurunani,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 4e25b9e0-0b95-11eb-a59b-f3f3774a9991
prakhargurunani and others added 4 commits Oct 11, 2020
@TravisBuddy
Copy link

@TravisBuddy TravisBuddy commented Oct 11, 2020

Travis tests have failed

Hey @prakhargurunani,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: b4a16fc0-0b9a-11eb-a59b-f3f3774a9991
@TravisBuddy
Copy link

@TravisBuddy TravisBuddy commented Oct 11, 2020

Travis tests have failed

Hey @prakhargurunani,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 84beb820-0b9b-11eb-a59b-f3f3774a9991
@TravisBuddy
Copy link

@TravisBuddy TravisBuddy commented Oct 11, 2020

Travis tests have failed

Hey @prakhargurunani,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 66cce5c0-0b9c-11eb-a59b-f3f3774a9991
@TravisBuddy
Copy link

@TravisBuddy TravisBuddy commented Oct 11, 2020

Travis tests have failed

Hey @prakhargurunani,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 8bca15e0-0b9d-11eb-a59b-f3f3774a9991
@prakhargurunani prakhargurunani requested a review from cclauss as a code owner Oct 11, 2020
@cclauss
Copy link
Member

@cclauss cclauss commented Oct 11, 2020

Copy link
Member

@dhruvmanila dhruvmanila left a comment

Announcement:

@prakhargurunani

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.

@prakhargurunani prakhargurunani requested a review from Kush1101 as a code owner Oct 15, 2020
github-actions github-actions
@prakhargurunani prakhargurunani requested a review from dhruvmanila Oct 15, 2020
@TravisBuddy
Copy link

@TravisBuddy TravisBuddy commented Oct 15, 2020

Travis tests have failed

Hey @prakhargurunani,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 15ab9d80-0eda-11eb-9bff-abeacd856cb9
@prakhargurunani
Copy link
Author

@prakhargurunani prakhargurunani commented Oct 15, 2020

@Kush1101 Done ! All guidelines meet successfully 😊 .

@dhruvmanila
Copy link
Member

@dhruvmanila dhruvmanila commented Oct 16, 2020

Do not change the .pre-commit-config.yaml file.
Your solution doesn't comply with the solution guidelines. Please read it properly. It's quite simple.

@prakhargurunani
Copy link
Author

@prakhargurunani prakhargurunani commented Oct 16, 2020

@dhruvmanila done ! I don't know how it mistakenly happened as I had switched to a different code editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.