Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd more solutions to Project Euler problems #2695
Comments
UPDATE: Only submit solution to problems which doesn't exists in this repository.As of now, we are only accepting PRs with one algorithm in it as it is easier to review one file at a time. Anyone reading this can join and open PRs as well. We accept multiple solutions to a problem as everyone has their own approach to problem-solving but it should be their own and unique compared to other solutions. NOTE: Please give us time to review as there are so many to go through. If possible submit one PR at a time and when that is merged provided it passes all the automatic tests, you can submit another PR. Also, please read the contributing guidelines before opening a PR. One step at a time Please follow the points mentioned below regarding Project Euler solutions. This is done to maintain consistency throughout the directory and to run this script which checks all the solutions:
Example: def solution(): # function without any parameters
# ... calculations ...
return answer
# If we call this function without passing any arguments, it will return the answer
solution() # -> answer
def solution(input: "default value"): # function with parameters having default value
# ... calculations ...
return answer
# If we call this function without passing any arguments, it will return the answer
solution() # -> answer For problems which needs to work with large data, put the data in a separate file and import it. |
Where can I get the problems from? |
https://projecteuler.net/ |
Thanks it helped |
Added problem_38 folder with solution file sol.py. TheAlgorithms#2695
Added problem_38 in project_euler TheAlgorithms#2695
I would love to join and contribute. Project Euler was always fun to me back in college :) |
Hi, |
@berry-thawson Please refer to problem_54#L367-L369 import os # with other imports
...
def solution():
script_dir = os.path.abspath(os.path.dirname(__file__))
<file_name_without_extension> = os.path.join(script_dir, "<file_name>")
with open(<file_name_without_extension> , "r") as file_hand:
# ... your code ...
I hope this clears your doubt. If you still have any problem, don't hesitate to ask. |
Thanks @dhruvmanila |
Hi, can we add solution to any problem? |
Name: Digit power sum Problem Statement: The number 512 is interesting because it is equal to the sum of its digits raised to some power: 5 + 1 + 2 = 8, and 83 = 512. Another example of a number with this property is 614656 = 284. We shall define an to be the nth term of this sequence and insist that a number must contain at least two digits to have a sum. You are given that a2 = 512 and a10 = 614656. Find a30 Reference: https://projecteuler.net/problem=119 reference: TheAlgorithms#2695
Name: Digit power sum Problem Statement: The number 512 is interesting because it is equal to the sum of its digits raised to some power: 5 + 1 + 2 = 8, and 83 = 512. Another example of a number with this property is 614656 = 284. We shall define an to be the nth term of this sequence and insist that a number must contain at least two digits to have a sum. You are given that a2 = 512 and a10 = 614656. Find a30 Reference: https://projecteuler.net/problem=119 reference: TheAlgorithms#2695
Name: Prime square remainders Let pn be the nth prime: 2, 3, 5, 7, 11, ..., and let r be the remainder when (pn−1)^n + (pn+1)^n is divided by pn^2. For example, when n = 3, p3 = 5, and 43 + 63 = 280 ≡ 5 mod 25. The least value of n for which the remainder first exceeds 10^9 is 7037. Find the least value of n for which the remainder first exceeds 10^10. Reference: https://projecteuler.net/problem=123 reference: TheAlgorithms#2695
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 Fixes: TheAlgorithms#2695
Name: Digit power sum Problem Statement: The number 512 is interesting because it is equal to the sum of its digits raised to some power: 5 + 1 + 2 = 8, and 83 = 512. Another example of a number with this property is 614656 = 284. We shall define an to be the nth term of this sequence and insist that a number must contain at least two digits to have a sum. You are given that a2 = 512 and a10 = 614656. Find a30 Reference: https://projecteuler.net/problem=119 reference: TheAlgorithms#2695
Name: Prime square remainders Let pn be the nth prime: 2, 3, 5, 7, 11, ..., and let r be the remainder when (pn−1)^n + (pn+1)^n is divided by pn^2. For example, when n = 3, p3 = 5, and 43 + 63 = 280 ≡ 5 mod 25. The least value of n for which the remainder first exceeds 10^9 is 7037. Find the least value of n for which the remainder first exceeds 10^10. Reference: https://projecteuler.net/problem=123 reference: TheAlgorithms#2695
Name: Digit power sum Problem Statement: The number 512 is interesting because it is equal to the sum of its digits raised to some power: 5 + 1 + 2 = 8, and 83 = 512. Another example of a number with this property is 614656 = 284. We shall define an to be the nth term of this sequence and insist that a number must contain at least two digits to have a sum. You are given that a2 = 512 and a10 = 614656. Find a30 Reference: https://projecteuler.net/problem=119 reference: TheAlgorithms#2695
Name: Digit power sum Problem Statement: The number 512 is interesting because it is equal to the sum of its digits raised to some power: 5 + 1 + 2 = 8, and 83 = 512. Another example of a number with this property is 614656 = 284. We shall define an to be the nth term of this sequence and insist that a number must contain at least two digits to have a sum. You are given that a2 = 512 and a10 = 614656. Find a30 Reference: https://projecteuler.net/problem=119 reference: TheAlgorithms#2695
Name: Digit power sum Problem Statement: The number 512 is interesting because it is equal to the sum of its digits raised to some power: 5 + 1 + 2 = 8, and 83 = 512. Another example of a number with this property is 614656 = 284. We shall define an to be the nth term of this sequence and insist that a number must contain at least two digits to have a sum. You are given that a2 = 512 and a10 = 614656. Find a30 Reference: https://projecteuler.net/problem=119 reference: #2695 Co-authored-by: Ravi Kandasamy Sundaram <rkandasamysundaram@luxoft.com>
Name: Divisor Square Sum For a positive integer n, let σ2(n) be the sum of the squares of its divisors. For example, σ2(10) = 1 + 4 + 25 + 100 = 130. Find the sum of all n, 0 < n < 64,000,000 such that σ2(n) is a perfect square. reference: TheAlgorithms#2695
Name: Divisor Square Sum For a positive integer n, let σ2(n) be the sum of the squares of its divisors. For example, σ2(10) = 1 + 4 + 25 + 100 = 130. Find the sum of all n, 0 < n < 64,000,000 such that σ2(n) is a perfect square. reference: TheAlgorithms#2695
Name: Prime square remainders Let pn be the nth prime: 2, 3, 5, 7, 11, ..., and let r be the remainder when (pn−1)^n + (pn+1)^n is divided by pn^2. For example, when n = 3, p3 = 5, and 43 + 63 = 280 ≡ 5 mod 25. The least value of n for which the remainder first exceeds 10^9 is 7037. Find the least value of n for which the remainder first exceeds 10^10. Reference: https://projecteuler.net/problem=123 reference: TheAlgorithms#2695
Please don't submit PRs for the solutions which already exist in the repository. This issue is meant to increase the number of solved problems and not to increase the number of solutions in a problem. Open ONLY one PR at a time and when that is merged, open another one. |
Name: Divisor Square Sum For a positive integer n, let σ2(n) be the sum of the squares of its divisors. For example, σ2(10) = 1 + 4 + 25 + 100 = 130. Find the sum of all n, 0 < n < 64,000,000 such that σ2(n) is a perfect square. reference: TheAlgorithms#2695
I want to submit my solutions. How do i submit ? |
I'm a keen Euler solver.please let me help in providing efficient solutions to the problems. |
Project Euler has about 700 problems, but the current repository hosts solutions for only about 60-70 problems.
I'm willing to work on the issue and also if someone wants to help they can join in.
We can create guidelines on how many minimum solutions a PR should have to prevent spammy PRs with just one or two easy solutions. (open to discussion)