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

learn more… | top users | synonyms

5
votes
0answers
43 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
2answers
149 views

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

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
80 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 ...
0
votes
1answer
62 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 ...
4
votes
1answer
194 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 ...
0
votes
1answer
21 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
0answers
27 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 ...
3
votes
2answers
72 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 ...
1
vote
1answer
108 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
37 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 ...
0
votes
1answer
83 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 ...
5
votes
1answer
360 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
55 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 ...
2
votes
1answer
249 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
162 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
56 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
28 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
87 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 ...
1
vote
1answer
59 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
114 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
0
votes
3answers
83 views

Why does $n^2 \equiv 10 \pmod{30}$ imply $n \equiv 0 \pmod{10}$?

It seems that $n^2 \equiv 10 \pmod{30} \iff n \equiv 0 \pmod{10}$. I found this by calculating $\{n \in \mathbb N_0 \mid n < 30 \land n^2 \equiv 10 \pmod{30}\} = \{10, 20\}$, and noting that 10 ...
4
votes
0answers
355 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 ...
0
votes
1answer
280 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 ...
0
votes
1answer
124 views

period of recurring decimals

The period of a recurring decimal fraction $1/d$ is equal to the multiplicative order of $10$ mod $d$. For fractions with even period, the digits sum to 9 i.e. $1/7 = 0.(142857)...$ $$142\\ 857\\ ...
2
votes
0answers
93 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: $$ ...
0
votes
1answer
149 views

How to find positive integers where the multiplicative modular inverse is equal to itself for mod n?

This a question sparked from Project Euler Question. I really devoted so much time to search an efficient solution however no output. What are some possibles theorems or formulas that are useful in ...
1
vote
3answers
243 views

could not able to understand Project Euler 18. “Maximum path sum I”

According to question, By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. ...
4
votes
3answers
489 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 ...
1
vote
1answer
252 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 ...
2
votes
1answer
56 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!
1
vote
1answer
62 views

Heronian isosceles triangles

This is a problem from Project Euler, problem 94. The problem asks about isosceles triangles with integer sides (differing by 1 unit, e.g, 5-5-6) and integer area, which are known to be Heronian ...
0
votes
1answer
593 views

Last digits of factorial

Yes, this is an attempt to understand why my solution for Project Euler problem 160 isn't working. I hesitate to post my code lest I offer a solution to someone else. The problem is to find the last ...
2
votes
0answers
90 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
3answers
452 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 ...
1
vote
0answers
211 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 ...
0
votes
1answer
71 views

In a Pythagorean triplets, is $a + b$ always greater then $c$?

I have a looked around, but the answer is nowhere to be found.
1
vote
2answers
116 views

CS problem, turned to mathematics

I am trying to solve some of the projecteuler problems using a much of a programmers approach. However, I would like to get more into the math, and therefore would try to do some mathematical ...
0
votes
1answer
81 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 ...
1
vote
2answers
755 views

Want to classify project euler problem 31

I was thinking about Project Euler #31 yesterday, quoted below: In England the currency is made up of pound, £, and pence, p, and there are eight coins in general circulation: 1p, 2p, 5p, ...
-1
votes
1answer
348 views

Sum of number of divisors of multiples of squares

I wish to evaluate, for some large $N$, $$\sum_{k=1}^N \tau(c\cdot k^2)$$ where $c$ is a positive integer constant, and $\tau(n)$ is the number of positive divisors of $n$ (i.e. $\tau = \sigma_0$). ...
10
votes
4answers
7k 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 ...
1
vote
1answer
488 views

Algorithm to find greatest significant digit of long integer

I'm doing a project euler problem (http://projecteuler.net/problem=40) that requires iteration of each digit of a set of increasing integers, in order. I solved it by converting each integer to a ...
3
votes
1answer
727 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 ...
1
vote
3answers
382 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 ...
0
votes
1answer
93 views

Non-Recursive Fundamental Recurrence Formulas

Is there a non-recursive version of the fundamental recurrence formulas for continued fractions? I am trying to compute $A_{1000}$, and it is taking me an extremely long time. By the way, I am ...
6
votes
3answers
19k 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 ...
12
votes
1answer
2k 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. ...
3
votes
1answer
470 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$ ...
1
vote
2answers
286 views

Longest antichain of divisors

I Need to find a way to calculate the length of the longest antichain of divisors of a number N (example 720 - 6, or 1450 - 4), with divisibility as operation. Is there a universally applicable way to ...
1
vote
1answer
439 views

Project Euler $420$ [closed]

So the question is: We define $F(N)$ as the number of the $2\times 2$ positive integer matrices which have a trace less than $N$ and which can be expressed as a square of a positive integer matrix ...