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

learn more… | top users | synonyms

6
votes
1answer
84 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 = ...
2
votes
1answer
40 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 ...
1
vote
1answer
325 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
89 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
29 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 ...
0
votes
1answer
91 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
84 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 ...
9
votes
0answers
761 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$ ...
5
votes
0answers
394 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
115 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 ...
3
votes
0answers
38 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
0answers
723 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
110 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
0answers
100 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
95 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
477 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
293 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
249 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
365 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 ...
0
votes
0answers
42 views

Exponential Diophantine equation to solve Project Euler problem

I am currently trying to solve problem 321 on project euler I know that each $n$ must exist such that $$8n^2+16n+1$$ is a perfect square. This is derived from the equation for the swapping of ...
0
votes
0answers
57 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
0answers
53 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 ...