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
256 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
1answer
61 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 ...
0
votes
1answer
75 views

Finding a generating function for a pattern

I was working on this projecteuler.com problem, and I was very interested by the premise. Essentially, given n terms, find an ...
-2
votes
1answer
66 views

Project Euler - task №390.

When this task was not clear what the equation to be solved. This equation? $x^2y^2+z^2y^2+x^2z^2=r^2$ in integers. It is not clear, because this equation is quite simple and I do not think that ...
8
votes
0answers
571 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$ ...
4
votes
0answers
284 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
109 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
0answers
649 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 ...
2
votes
0answers
77 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
0answers
76 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
437 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) = ...
2
votes
0answers
254 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)$ ...
1
vote
0answers
136 views

Magic Square Combinatorics

This question has been noted to be close to a Project Euler question. Please Help me with this question:Considering a 4*4 magic square ,How many ways are there to fill each square with an integer ...
1
vote
0answers
280 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. ...
0
votes
0answers
44 views

Make iteration functional?

I'm working in a theoric approach to project-euler's problem #38. This problem consists in finding the largest integer such that $n$, for example $192$: $$ 192 * 1 = 192 $$ $$ 192 * 2 = 384 $$ ...