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

learn more… | top users | synonyms

35
votes
7answers
3k views

Project Euler, Problem #25

Problem #25 from Project Euler asks: What is the first term in the Fibonacci sequence to contain 1000 digits? The brute force way of solving this is by simply telling the computer to generate ...
12
votes
1answer
514 views

Comparing powers without logarithms

Related to this question and this Project Euler problem (Problem 99), I came up with a recursive algorithm for comparing two numbers of the form $x^y$ (with $x>1$ and $y\ge 0$) without explicit use ...
11
votes
1answer
541 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. ...
9
votes
3answers
4k 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 ...
8
votes
0answers
602 views

How many integer solutions to a diophantine equation

Starting with the equation: $\frac{1}{a}+\frac{1}{b}=\frac{p}{10^n}$, I reached the equation: $10^{n-log(p)} = \frac{ab}{a+b}$. Now given the positive integer $n$, for what integer values of $p$ ...
7
votes
3answers
703 views

Project Euler Question 222

Would I be wrong to assume that the solution to this problem: What is the length of the shortest pipe, of internal radius 50mm, that can fully contain 21 balls of radii 30mm, 31mm, ..., 50mm? ...
6
votes
3answers
10k 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: ...
5
votes
3answers
325 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} $$ ...
4
votes
4answers
1k views

The longest sum of consecutive primes that add to a prime less than 1,000,000

In Project Euler problem $50,$ the goal is to find the longest sum of consecutive primes that add to a prime less than $1,000,000. $ I have an efficient algorithm to generate a set of primes ...
4
votes
2answers
230 views

Does “triangle” in English exclude degenerate triangles?

Just for fun read few problems on the projeteuler.net website. Number 276 found interesting: Consider the triangles with integer sides a, b and c with a ≤ b ≤ c. An integer sided triangle ...
4
votes
3answers
226 views

Project Euler - 34 / Find a mathematical approach for upper bound

145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145. Find the sum of all numbers which are equal to the sum of the factorial of their digits. Note: as 1! = 1 and 2! = 2 are not sums ...
4
votes
2answers
213 views

Solving $\phi (n) < (n-1) \cdot \frac{15499}{94744} $

I am working on challenge 243 from Project Euler (PE 243). The question is: $$\text{Solve } \phi (n) < (n-1)\cdot \frac{15499}{94744}$$ I can calculate $\phi(n)$ for any $n$, but I think the $n$ ...
4
votes
3answers
2k views

10 most significant digits of the sum of a 100 50-digit numbers

This is about Project Euler #13. You are given a 100 50-digit numbers and are asked to calculate the 10 most significant digits of the sum of the numbers. The solution threads stated that we are only ...
4
votes
1answer
862 views

Comparing Powers with Different Bases Using Logarithms?

I looked all over to see if a question like this had already been answered, but I couldn't find it. So here goes: I need a general formula for comparing two (insanely huge) powers. I'm pretty sure ...
4
votes
4answers
525 views

Flaw in expected value solving logic (Project Euler 323)

The problem statement for Project Euler #323 is as follows: Let $y_0, y_1, y_2, ...$ be a sequence of random unsigned 32 bit integers (i.e. $0 \leq y_i < 2^{32}$, every value equally likely). ...
4
votes
1answer
76 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 ...
4
votes
0answers
47 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 ...
4
votes
0answers
302 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 ...
4
votes
0answers
110 views

Why limit Euler's Partition function P to $k\leq\sqrt n$ instead of $k\leq n$?

I solved a Project Euler problem (I won't say which one) involving the Partition Function P. I used equation #11 from the above link: $$P(n) = \sum_{k=1}^n (-1)^{k+1}\bigg(P\Big(n-{1\over ...
4
votes
2answers
533 views

using markov chains to solve a project-euler problem?

I never learned what markov chain is, but from googling it seems like if there are finite states and each state has probabilities to jump to other states, I can use markov chain. What I'm on is ...
4
votes
0answers
675 views

Project Euler Problem 338

I'm stuck on Project Euler problem 338. This is a cross post from StackOverflow where I initially posted, however, it was suggested that I post it here too since the problem mostly relies on math. The ...
3
votes
4answers
8k views

How to calculate reflected light angle?

On a 2D plane, line X is at x radians angle, an incoming light travels at y radians angle, how to calculate the angle of the outgoing light reflected off line X? How to do this in a way to cover all ...
3
votes
2answers
208 views

Faulty logic when summing large integers?

This is in relation to the Euler Problem $13$ from http://www.ProjectEuler.net. Work out the first ten digits of the sum of the following one-hundred $50$-digit numbers. ...
3
votes
3answers
12k views

Largest prime factor of 600851475143 [duplicate]

I'm trying to use a program to find the largest prime factor of 600851475143. This is for Project Euler here: http://projecteuler.net/problem=3 I first attempted this with the code that goes through ...
3
votes
2answers
835 views

Combinatorial counting

This question is about Project Euler 113: Working from left-to-right if no digit is exceeded by the digit to its left it is called an increasing number; for example, 134468. Similarly ...
3
votes
2answers
3k views

sum of even-valued and odd-valued Fibonacci numbers

I was solving the Project Euler problem 2 *By starting with 1 and 2, the first 10 terms of Fibonacci Series will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... Find the sum of all the even-valued terms ...
3
votes
2answers
284 views

Solving $x^2 \cdot y^2 + x^2 + y^2 = c^2$ with $x$, $y$, $c \in \mathbb{Z}^+$

I am working on Project Euler 390. The question is about triangles, and finding the area of a triangle with sides $\sqrt{a^2+1}, \sqrt{b^2+1}$ and $\sqrt{a^2+b^2}$, with $a, b \in \mathbb{Z}$. I have ...
3
votes
1answer
335 views

taking the log of $a^b$ (Project Euler problem 29)

I've been stuck on Project Euler problem 29 and thus asked a friend who solved it how to do it. What he basically did was for each power was: $\left(\frac{\log_{10}(a)}{\log_{10}(2)}\right)\cdot b$ ...
2
votes
4answers
20k 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 ...
2
votes
3answers
333 views

Project Euler's Problem Number 88

I am tackling Project Euler's problem number 88, which in a nutshell reads: Let $S_n$ be the set of sequences of natural numbers $(s_1,s_2,...,s_n)$ where $s_1\leqslant s_2\leqslant\cdots\leqslant ...
2
votes
1answer
545 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
2answers
244 views

Project Euler Problem 65

I am working on solving Project Euler problem #65 and run upon the following statement: What is most surprising is that the important mathematical constant, e = [2; 1,2,1, 1,4,1, 1,6,1 , ... , ...
2
votes
3answers
2k views

Generating Numeric Palindromes.

I have just started the Euler project, and felt like I didn't get the fourth problem right...I used string conversion to test if my numbers were symmetrical, instead of relying on (the much faster) ...
2
votes
3answers
570 views

Primitive integer triangles

Consider the triangles with integer sides a, b and c with a ≤ b ≤ c. An integer sided triangle (a,b,c) is called primitive if gcd(a,b,c)=1. How many primitive integer sided triangles exist with a ...
2
votes
1answer
347 views

How to find the factors of numbers around 1e7?

I don't have a maths background but I'm solving problems on the awesome Project Euler .net in JavaScript as programming practice. I don't want to link directly to the question or post it verbatim ...
2
votes
1answer
352 views

How is this probability found (project euler #121)?

In the problem statement of project Euler problem 121, the following information is given: A pouch contains one black chip and one white chip. In a simple game, one player takes a chip at random and ...
2
votes
1answer
751 views

Project Euler Problem 371

Project Euler Problem 371 states Oregon licence plates consist of three letters followed by a three digit number (each digit can be from [0..9]). While driving to work Seth plays the following ...
2
votes
1answer
165 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, ...
2
votes
1answer
328 views

How to get Euler angles with respect to initial Euler angle

I have a sensor which gives me Euler angles (roll,pitch,yaw). There is a baseline value of Euler angle (assume it is $5,10,15$) at the beginning.I want to calibrate from this baseline values all ...
2
votes
2answers
79 views

Combinatorical meaning of an identity involving factorials [duplicate]

While solving (successfully!) problem 24 in projectEuler I was doodling around and discoverd the foloowing identity: $$1+2\times2!+3\times3!+\dots N\times N!=\sum_{k=1}^{k=N} k\times k!=(N+1)!-1$$ ...
2
votes
1answer
628 views

Finding all possible paths from one corner to the other on a grid, without backtracking

Me again "new to maths guy". Please tell me if the substance of my questions are not a good fit for the site. I'm now onto Question 15 of Project Euler and it seems like there's some mathematical ...
2
votes
1answer
547 views

For what kind of numbers would $r_2(n^2) = 420$?

I am trying to find all of the answers to $r_2(n^2) = 420$, where $N < 10^{11}$. It is for finding lattice points on a circle with points $(0,0), (N,0), (0,N)$, and $(N,N)$. I am (pretty) sure that ...
2
votes
1answer
791 views

Project Euler 215 - Solving with Sparse Matrices and Vector Multiplication

I wrote a program to solve Project Euler Problem #215 (see below for description) using memoization, and when I got access to the PE forums, I saw everyone else wrote programs that also used dynamic ...
2
votes
2answers
89 views

Need a nudge in the right direction - How do I find the total number of permutation with 3 consecutive characters?

Again, I really just want a nudge in the right direction. Possibly a large nudge, but not the straight forward answer. I am trying to figure out how to solve Project Euler Problem 191. I believe I ...
2
votes
1answer
98 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
2
votes
2answers
3k 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 ...
2
votes
0answers
80 views

Is there a closed-form or an efficient way to calculate $\sum_{i=1}^{N/2} i(N \mod i) $

I am trying to solve problem 401 of Project Euler, without giving much away, I have broken down the problem into several summations and I am trying to calculate one part, which is: $$ ...
2
votes
1answer
52 views

An Euler problem: How many of these numbers are of the form $a^b$?

How much numbers can be written in the form $a^b$, where $a$ and $b$ are integers that are between $2$ and $100$? How can I start this problem? Any hints please? Thanks!
2
votes
0answers
79 views

Need to find a better algorithm to solve a project euler problem dealing with coprime pairs.

I've been working on this for a while and found several solutions so far, but none are fast enough to find the necessary $S(10^7)$. Here is the question: For an integer $M$, we define $R(M)$ as ...
2
votes
0answers
447 views

Counting couples having least common multiple less than a number

Let f(n) be the number of couples (x,y) with x and y positive integers, $x\leq y$ and the least common multiple of x and y equal to n. Let g be the summatory function of f, i.e.: $g(n) = ...