All Questions
21 questions
6
votes
3
answers
895
views
Project Euler 127 - abc-hits
Problem (Rephrased from here):
The radical of \$n\$, \$rad(n)\$, is the product of distinct prime factors of \$n\$. For example, \$504 = 2^3 × 3^2 × 7\$, so \$rad(504) = 2 × 3 × 7 = 42\$.
We shall ...
2
votes
1
answer
4k
views
The smallest positive number that is evenly divisible by all of the numbers from 1 to 20
Problem description:
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly divisible by all of ...
5
votes
2
answers
1k
views
Calculate the first largest factor of 600851475143
ٍProblem description:
The prime factors of 13195 are 5, 7, 13 and 29. Largest prime factor 13195 is 29.
What is the largest prime factor of the number 600851475143 ?
Prime Factor:
any of the prime ...
3
votes
1
answer
1k
views
Python code to find greatest common divisor of multiple numbers
Hmm, I know this has been implemented countless times, and Python 3.9.5 math standard library has a built-in gcd() method that ...
5
votes
1
answer
88
views
Finding all factors and prime factors of a number
I am working on the Project Euler, number 3 project (finding the largest prime factor of 600851475143), but I wanted to take it a step further and write something that will list all factors and prime ...
6
votes
2
answers
694
views
Euler 12: counting divisors of a triangle number
This is the question:
The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be:
...
2
votes
1
answer
361
views
Project Euler #47: find four consecutive integers, each with four distinct prime factors
Project Euler Problem 47
Find the first four consecutive integers to have four distinct prime factors each. What is the first of these numbers?
This is my solution for problem 47 on Project Euler.
...
6
votes
3
answers
300
views
Project Euler 21: Sum of amicable numbers optimisation
Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n).
If d(a) = b and d(b) = a, where a ≠ b, then a and b are an amicable pair and each of a and b ...
2
votes
2
answers
353
views
Finding the nth ugly number
I'm trying to optimize my solution to this LeetCode problem:
Write a program to find the nth super ugly number.
Super ugly numbers are positive numbers whose all prime factors are in
the ...
5
votes
2
answers
107
views
Project Euler - Problem 3
The description of the problem is:
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
Here is my solution:
...
1
vote
1
answer
285
views
Project Euler # 21 amicable numbers Python
Let \$d(n)\$ be defined as the sum of proper divisors of \$n\$ (numbers less than \$n\$ which divide evenly into \$n\$).
If \$d(a) = b\$ and \$d(b) = a\$, where \$a ≠ b\$, then \$a\$ and \$b\$ are an ...
1
vote
2
answers
205
views
Project Euler problem # 3 is this the most efficient approach in Python or can I do better?
The problem statement: The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
This code takes 9 seconds!, is there a better way?
...
2
votes
2
answers
915
views
Project Euler #3 with Python
I tried to solve some Euler's problems, this is the solution I found for problem #3 with Python. The problem asks:
The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of ...
4
votes
1
answer
145
views
Project Euler problem #3
My code works but would take 160 days to run lol.
...
2
votes
2
answers
338
views
Work out largest prime factor of a number
I am trying to get better at problem solving, so I am going through challenges on Project Euler.
Problem:
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the ...