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

learn more… | top users | synonyms

2
votes
2answers
83 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$$ ...
4
votes
0answers
112 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
583 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 ...
1
vote
1answer
339 views

Searching for pandigital numbers

I was working on the Euler project's problems and the 32nd problem is the following: We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once; for ...
0
votes
5answers
556 views

Every odd composite $=$ prime ${}+ 2x^2$

I was looking through some project-euler questions and I came across one that said Every odd composite number can be written as the sum of a prime and twice a square...This was proven false. ...
6
votes
3answers
12k 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: ...
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 ...
9
votes
0answers
651 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$ ...
3
votes
2answers
298 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 ...
4
votes
2answers
217 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$ ...
0
votes
4answers
246 views

Identifying which “plain text” is in English

I need to identify which text is in English from a list of possible list of plain texts generated from a brute force attack on a cipher text. I am thinking of using frequency distributions of English ...
5
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 ...
1
vote
1answer
280 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 ...
1
vote
2answers
104 views

Compute $\sum_0^{n-1}2^i11^{n-i-1}\bmod10^9$ when $n=13^{17}$

Given the following function $f$ $f(1)=1$ $f(n)=11\cdot f(n-1)+2^{n-1}$ I would like to compute $f(13^{17})\mod 10^9$ and ended up using the following : $f(n)=\sum_{i=0}^{n-1}({11^{n-(i+1)}\cdot ...
1
vote
1answer
537 views

Primality and repeated digits

I recently worked on problem 51 through project euler, I solved it essentially through brute-force but afterwards I viewed the forum and there were some more clever solutions. For those unfamiliar ...
1
vote
2answers
94 views

Steps to get Inverse of Pentagonal

I have solved http://projecteuler.net/problem=44 by getting the inverse equation from Wikipedia http://en.wikipedia.org/wiki/Pentagonal_number: Pentagonal: $f(n) = \frac{n(3n - 1)}{2}$ Inverse ...
1
vote
1answer
1k views

How to find large prime factors without using computer?

What is the largest prime factor of the number 600851475143 ? This is the third problem of Project Euler. How to approach this mathematically (without computer programming) ?
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 ...
0
votes
1answer
138 views

Euler's Numerical method help

Consider this differential equation, $dy/dx = x + \sin(y)$ with initial condition $y = 0.5$ when $x = 1.2$: Write down the recurrence relation for Euler's numerical method ...
2
votes
1answer
662 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
414 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
0answers
457 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) = ...
1
vote
1answer
300 views

How does $P(n)$ (Partition Function P) work?

I am trying to do Project Euler #78, which is about the different ways of splitting up coins into piles. I realized that this is just the number of integer partitions of the number of coins, ...
4
votes
1answer
991 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
2answers
239 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 ...
2
votes
1answer
783 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
579 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 ...
4
votes
4answers
554 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). ...
3
votes
2answers
4k 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 ...
7
votes
3answers
723 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? ...
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) ...
12
votes
1answer
580 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 ...
2
votes
0answers
269 views

Bell-like recurrence

Let $$A(n)=\sum_{k=0}^{n-1}\binom{n}{k}A(k)+n!,\quad A(0)=1$$ $$B(n)=\sum_{k=0}^{n-1}\binom{n}{k}B(k)-n!-n!\sum_{k=1}^{n}\frac{1}{k!},\quad B(0)=-1.$$ I'm interested in computing $S(n)=A(n)+B(n)$ ...
0
votes
1answer
87 views

What is the max possible value of the sum of power of y of each digits?

I'm trying to solve the 30th euler problem. My code is working, but I'm not sure if it's luck or ingeniousness. To be the most efficient, I want to reduce at the maximum the numbers to checks. I ...
0
votes
2answers
209 views

What is wrong with my algorithm (finding if the origin is within a triangle's interior)?

I am working on Project Euler Problem 102 and I thought I had a solution, but it seems I do not. Now, don't give me the solution. I know I'm on the right track. What I want to know is why my method ...
2
votes
2answers
1k views

Computing Non-zero End Digits of Large Factorials

Any large factorial will have a number of zero behind it, and one could write an expression to compute the number of trailing zeros, but how would one go about computing the non-zero end digits? E.g. ...
2
votes
1answer
887 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
1answer
367 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 ...
4
votes
0answers
691 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 ...
36
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 ...
0
votes
1answer
544 views

How many routes are there through from top left corner to top right in a 20x20 grid? Binomial Coefficent explanation [duplicate]

Possible Duplicate: Counting number of moves on a grid I'm trying to solve this computer programming problem on Project Euler: http://projecteuler.net/index.php?section=problems&id=15 ...
1
vote
2answers
556 views

Project Euler analyzing and simplifying problem 33

These questions concern "Project Euler problem 33": The fraction $\displaystyle \frac {49}{98}$ is a curious fraction, as an inexperienced mathematician in attempting to simplify it may ...
1
vote
0answers
306 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 degrees), where at each time step we can move either clockwise or anti-clockwise. ...
2
votes
2answers
91 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 ...
3
votes
3answers
593 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 ...
3
votes
2answers
893 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 ...
2
votes
4answers
24k 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 ...
3
votes
4answers
9k 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
210 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. ...