Project Euler is a series of challenging mathematical/computer programming problems. Please see the site and rules before posting.

learn more… | top users | synonyms

1
vote
1answer
563 views

repunit prime factors

So I am working on this problem... which states: A number consisting entirely of ones is called a repunit. We shall define R(k) to be a repunit of length k; for example, R(6) = 111111. Let ...
1
vote
1answer
37 views

Inverse Euler theorem to calculate $\binom{n}{r}$

How can we use Inverse Euler theorem or properties to calculate the binominal coefficients or say $\binom{n}{r}$? What is the algorithm for this ? An example for the same will be greatly ...
2
votes
1answer
75 views

Project Euler 106: Necessary and sufficient conditions

Problem Statement Let S(A) represent the sum of elements in set A of size n. We shall call it a special sum set if for any two non-empty disjoint subsets, B and C, the following properties are ...
7
votes
4answers
19k views

Find the largest prime factor

I just "solved" the third Project Euler problem: The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? With this on Mathematica: ...
1
vote
1answer
54 views

Help Project Euler Problem 269

I am stuck on prob 269 Project Euler. I've just tried brute force method to attempt this problem the example provided by PE For example, $P_{5703}(x)$ = $5x^3 + 7x^2 + 3$. We can see that: ...
1
vote
1answer
356 views

Algorithm for generating an ordered list of pair products

For problem 4 in the euler project part of the assignment is to generate a list of products of 3-digit numbers. The easy way is to just do a cartesian product (I think it's called), and after that ...
0
votes
2answers
71 views

Proof that nonconstant polynomial cannot have the same value at all integer points

I am reading the solution to the Project Euler problem 28 here, specifically the one under 'Deriving a non-iterative formula'. That solution first deduces the degree of the polynomial, and then ...
0
votes
2answers
84 views

(Soft Question) Is it bad to use Sage built in functions instead of creating my own?

I've been doing Project-Euler just as a way to increase my competency in computer science. I'm currently a Pure and Applied Math major who recently adopted computer science as a minor in order to ...
2
votes
2answers
251 views

Expected value of a guessing game

I'm trying to solve project euler 527, I don't understand how the expected value of B(6) is taken. A secret integer t is selected at random within the range 1 ≤ t ≤ n. The goal is to guess ...
1
vote
0answers
53 views

How to simplify a sum of complex divisors?

This question arises from Project Euler 153. That problem asks for the sum of all complex divisors of all natural numbers up to a maximum, where a complex divisor is a complex number of the form a + ...
0
votes
0answers
127 views

Solving Cardano Triplets

Reading https://projecteuler.net/problem=251 I'm attempting to solve the example provided : $ 3 \sqrt {a + b \sqrt c} $ + $ 3 \sqrt {a - b \sqrt c} $ = 1 a=2 b=1 c=5 $ 3\sqrt {2+(1)\sqrt5} + ...
0
votes
1answer
525 views

Project Euler, Problem #529 10-substrings

Have anyone tried the problem 529? I tried but I'm confronted to a very high complexity $O(N^2)$ with $N$ being the length of the number. The code is: ...
0
votes
2answers
98 views

Explaining solution of Project Euler problem #5

Here is the problem. Pretty simple to brute force, but more gently solutions are not that easy to understand, and I'm not talking about programming issue, but math-affiliated. For example, I'm ...
13
votes
3answers
1k views

Are there any mathematics “problem websites” similar to Project Euler?

Are there any mathematics websites similar to Projet Euler, a website which hosts math-heavy programming questions, many of which can be solved with a pen and paper? I've become almost addicted to ...
7
votes
3answers
4k views

Finding prime factors by taking the square root

I'm trying to solve the third Project Euler problem and I'd like a little help understanding a mathematical concept underlying my tentative solution. The question reads: The prime factors of ...
6
votes
1answer
97 views

Summation of a function

Let $n$ is a positive integer. $n = p_1^{e_1}p_2^{e_2}...p_k^{e_k}$ is the complete prime factorization of $n$. Let me define a function $f(n)$ $f(n) = p_1^{c_1}p_2^{c_2}...p_k^{c_k}$ where $c_k = ...
0
votes
0answers
82 views

About an answer given for Project Euler 19

The problem is here and someone gave this answer but I don't understand it even if I know the rule of large numbers. If you want to write a code for this, it is really boring. On the other hand, ...
0
votes
1answer
60 views

How to find $a_n$ series from Dirichlet generating function

I am solving problems from Project Euler. Solutions for some of the problems is $n^{\rm th}$ term of a series. I know Dirichlet generating functions. How to find $n^{\rm th}$ term of a series from ...
1
vote
0answers
394 views

Number of closed paths formed by arcs of one fifth of a circle

**I was trying to solve the following issue: Find the number of possible closed paths using one fifth of an arc ($72^o$), where at each time step we can move either clockwise or anti-clockwise. in ...
4
votes
3answers
770 views

Primitive integer triangles

Consider the triangles with integer sides $a$, $b$ and $c$ with $a \leq b \leq c$. An integer sided triangle $(a,b,c)$ is called primitive if $gcd(a,b,c)=1$. How many primitive integer sided triangles ...
1
vote
0answers
167 views

Project Euler Problem #87 - Prime power triples

I found this problem in Project Euler: https://projecteuler.net/problem=87 The smallest number expressible as the sum of a prime square, prime cube, and prime fourth power is $28$. In fact, ...
2
votes
1answer
65 views

Finding the last nonzero digit of the factorial of a large number

This problem is from projecteuler problem 160. I am not looking for an answer or anything like that I just got stuck on some of the mathematics and am looking for some help. Instead of solving the ...
0
votes
0answers
192 views

Calculating two rotation angles from xyz coordinates for dummies

This post is a bit verbose so that others who come later may benefit from my thick headedness. I am attempting to construct a primitives composition and constructed solids geometry parser/processor ...
4
votes
2answers
425 views

Base conversion: How to convert between Decimal and a Complex base?

My motivation for this question is exploring beyond the ideas in Project Euler Problem 508. In that problem, it is helpful to know how to convert between a decimal number and a number in base ...
-3
votes
2answers
299 views

square of digits - why does it always contain 1 or 89 [closed]

I attempted project euler problem 92, while I passed it, my solution works, but had just...awful performance. So I would like to try again tomorrow. In the meantime understanding why the iteration ...
0
votes
1answer
105 views

Number of 1s in after converting number to base -1+i

Regarding to Base conversion: How to convert between Decimal and a Complex base? Let $s(a,b)$ is a number of $1$ after converting complex number $a+bi$ to base $-1+i$. It's easy to implement that ...
0
votes
1answer
109 views

Where is my formula false??

I wrote a formula that returned how many numbers in a given row of pascals triangle are divisible by a given prime. This formula was created to answer https://projecteuler.net/problem=148. I was ...
14
votes
1answer
3k views

How to find the smallest number with just $0$ and $1$ which is divided by a given number?

Every positive integer divide some number whose representation (base $10$) contains only zeroes and ones. One can easily prove that using pigeonhole principle. ...
0
votes
1answer
361 views

Project Euler #453 confusion

So I decided to give a shot on the #453 project euler problem but there is something that confuses me with the numbers given. I decided to start by calculating the possible arrangements of 4 vertices ...
1
vote
1answer
46 views

Addition chain search tree pruning by discarding non-minimal chains

An addition chain is an ordered tuple of numbers, starting with $1$, such that each number after $1$ can be expressed as the sum of two smaller numbers in the chain. An example of an addition chain ...
1
vote
3answers
527 views

“Goldbach's other conjecture” and Project Euler - writing 1 as a sum of a prime and twice a square

From Problem 46 of Project Euler : It was proposed by Christian Goldbach that every odd composite number can be written as the sum of a prime and twice a square. $$9 = 7 + 2 \cdot ...
11
votes
3answers
11k views

Find the sum of the digits in the number 100!

I am working on a Project Euler problem http://projecteuler.net/problem=20. $n!$ means $n(n - 1)\dots...3.2. 1.$ For example, $10!$ $=$ $10$ $9$ $...$ $3$ $2$ $1$ $=$ $3628800$, and the ...
3
votes
2answers
78 views

Cubes differences and primality

In an exercise (Project Euler 131, not to mention it), we are looking for perfect cubes of the form $n^3 + n^2 p$, where p is prime. I finally got the answer by trial and error but I don't understand ...
4
votes
4answers
13k views

How to calculate reflected light angle?

On a two dimensional plane, line $X$ is at an angle of $x$ radians and an incoming light travels at an angle of $y$ radians. How can I calculate the angle of the outgoing light reflected off of the ...
1
vote
1answer
334 views

Find the sum of all the multiples of 3 or 5 below 1000 (Break down)

I know that this has been posted before but I can't grasp how it actually works. I'm a 16 year old in the 10th grade and am interested in algorithms. I've looked in multiple places on the web but am ...
3
votes
0answers
48 views

How to compute a slowly converging series to 10 decimals places of accuracy?

I'm looking at a Project Euler problem, where a harmonic series is modified such that it excludes terms where a digit appears three times consecutively in the denominator. So this series would exclude ...
3
votes
2answers
5k views

Combinations/Permutations Count Paths Through Grid

I am curious about a situation in permutations/combinations. This question stems from a challenge site (project euler, problem 15) and research found on this exchange and elsewhere. The question ...
0
votes
1answer
109 views

Largest prime factor of a number

In Project Euler problem 3, where we have to find the largest prime factor of a number, one of the solution i came across is ...
4
votes
0answers
62 views

Computing question: A quadratic which gives primes [closed]

This is about Project Euler Problem 27. The question is: Considering quadratics of the form $n^2 + an + b$, where $\lvert a \rvert < 1000$ and $\lvert b \rvert < 1000$ Find the product ...
3
votes
1answer
1k views

maths required to complete project euler

What math's will help one complete all if not most of project Euler questions? Last I've attempted project Euler I could not understand the questions/vocabulary, etc., and could only complete a few ...
2
votes
1answer
360 views

Find the sum of all n, 0 < n < 64,000,000 such that σ2(n) is a perfect square.

I have been working on Project Euler problem 211 for quite some time, and I am stuck. I'm not looking for an answer, I'm simply looking for some guidance. I've written and tested the following code, ...
1
vote
4answers
191 views

Sum of $x^x$ final 10 digits

warning/spoiler alert this problem occurs in the euler project. I want to find the last ten digits of the following sum: $$ S = 1^1 + 2^2 + 3^3 + 4^4 + \cdots + 1000^{1000} $$ Finding this ...
0
votes
1answer
73 views

Number of paths through a grid

I am attempting to solve Project Euler prob. 204 by hand, and I decided that this method should help a lot. I have the following grid: The numbers indicate the total number of paths from a node at ...
0
votes
2answers
31 views

What rules can I apply for divisible numbers?

I'm trying to solve Project Euler problem 12. I've figured out a fast algorithm for the triangle numbers, but to see if they are devisable is just a pain... ...
0
votes
1answer
110 views

How does this algorithm find the largest prime factor?

This question on math.stackexchange details an algorithm that can be used to find the largest prime factor of a number. I used it to solve Project Euler #3. Here's a short description of the ...
5
votes
0answers
461 views

Counting simple quadrilaterals in a rectangular lattice.

I've been trying to make an algorithm to find the number of all possible simple quadrilaterals in a N*M lattice. I already have a brute force solution but since this is a Project Euler problem I ...
1
vote
1answer
124 views

Digit Factorial Sum? [duplicate]

This question is founded in Project Euler #34. I originally solved the problem years ago but now I'm moving all the problems over to a new language. As I revisit this problem, I already know the ...
2
votes
1answer
121 views

How to find all pairs $(a, b)$ s.t. $(a^2+b^2)/\gcd(a,b) \leq n$ for constant $n$?

Any help is appreciated, this is for my work on http://projecteuler.net/problem=153. Also posted here
10
votes
4answers
65k views

Find the sum of all the multiples of 3 or 5 below 1000

How to solve this problem, I can not figure it out: If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of ...
6
votes
3answers
755 views

Closed form for the sum of even fibonacci numbers?

I recently took a look a project euler, and I am trying to think of a smart way to do number 2. I looked at the sequence, and I saw that the question is basically asking for $$ \sum_{i=1}^n F_{3i} $$ ...