Questions tagged [project-euler]

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

Filter by
Sorted by
Tagged with
2
votes
2answers
76 views

Is there a way to find an upper bound for $n^2+an+b$?

I was solving the Project Euler: Problem 27. Considering quadratics of the form $n^2 + an + b$, where $|a| \lt 1000$ and $|b| \le 1000$ Find the product of the coefficients, $a$ and $b$, for the ...
3
votes
1answer
60 views

Project Euler #329 (Prime Frog) - Stochastic independence

Susan has a prime frog.Her frog is jumping around over 500 squares numbered 1 to 500. He can only jump one square to the left or to the right, with equal probability, and he cannot jump outside the ...
8
votes
3answers
632 views

Why is the one quadratic polynomial a perfect square more often than the other?

I was solving problem 137 of Project Euler, which led me to find $n$ such that $5n^2+2n+1$ is a perfect square. But such numbers are very rare (the 13th is around 3 billions) so after decomposing into ...
1
vote
1answer
83 views

Is there a way to find a bound on the largest prime factor a given number n?

I worked on Project Euler problem 3 (find largest prime factor of 600851475143) a while back and have tweaked with the code a few times to reuse for other problems, but I eventually found that there ...
0
votes
1answer
47 views

Spider Fly Problem

I am trying to solve Project Euler problem 86. I know I have to generate Pythagorean triplets and so on. But I have a problem with choosing valid cuboids. For example if the dimensions of the cuboid ...
3
votes
0answers
83 views

How to solve for var r in closed-form arithmetic-geometric function? (Euler problem 235)

Disclaimer: Math noob here. I have this arithmetic-geometric sequence $u(k)=(a-dk)r^{k-1}$ and summation $s(n)=\sum_{k=1}^n u(k)$ Using Wikipedia (sources 1, 2, and 3), I have solved for the closed-...
-1
votes
1answer
42 views

How does a < b < c and a + b + c = s imply a < s/3 and b < s/2?

I've been trying to understand the overview given for problem 9 on Project Euler and it mentions that the upper bound for iterating through possible values of a is (s - 3)/3 and for b it is (s - a)/2. ...
0
votes
1answer
214 views

Project Euler 233 on Hackerrank

I've been struggling with this for over a month now. The coding challenge on HR is similar to the official Project Euler 233, but instead of finding $f(N)=420$, your code may need to solve for $f(N)=...
1
vote
1answer
96 views

Formulae to find sum of all digits before n?

I've just started to learn algorithm by joining Project Euler, and trying to understand the below formula ...
1
vote
1answer
104 views

What is going wrong with my solution for Project Euler 224?

I am trying to solve the HackerRank version. The problem statement, Let us call an integer sided triangle with sides a ≤ b ≤ c barely obtuse if the sides satisfy $a^2 + b^2 = c^2 - 1$. How ...
0
votes
1answer
28 views

Given $\sqrt {m^2+(n+o)^2}$ is int, is it possible that atleast one of $\sqrt {o^2+(n+m)^2}$ or $\sqrt {n^2+(o+m)^2}$ is also integer?

Given $m,n,o,\sqrt {m^2+(n+o)^2}\in\mathbb N$ and $o\le n\le m$, is it a guarantee that both of $\sqrt {o^2+(n+m)^2},\sqrt {n^2+(o+m)^2}$ are irrational? What I tried: Firstly, ${m^2+(n+o)^2}\le n^...
0
votes
0answers
419 views

Project Euler Problem #500

I need help solving Project Euler Problem #500 I was unable to find discussion on this topic. My approach to solve it is to use prime factorization of an unknown number, i.e. the answer, as $$x = 2^{...
-4
votes
1answer
45 views

Walking positive square numbers and closing or opening doors [closed]

Peter moves in a hallway with $N+1$ doors consecutively numbered from $0$ through $N$. All doors are initially closed. Peter starts in front of door $0$, and repeatedly performs the following steps: ...
1
vote
1answer
471 views

Calculating how many decks of given size can be perfectly shuffled $k$ times and return to their original ordering.

This question originates from Riffle Shuffles, Problem 622 on projecteuler.net I´m just trying to wrap my head around something I just found. I understand how to use the equation but not why it works....
1
vote
1answer
67 views

Sum Equals Product: A Diophantine Equation

I formulated the following claim after reading Problem 88 of Project Euler: Fix $k$ and let $\mathscr N$ be the set of numbers $N$ satisfying $$N=n_1+n_2+\cdots+n_k=n_1n_2\cdots n_k,$$ where ...
2
votes
2answers
118 views

Finding integer solutions to $n^2 = 2d^2 - 2d + 1$

I'm trying to find the smallest integer solution to $$n^2 = 2d^2 - 2d + 1$$ Additional constraints: $$d > 10^{12}, n > 0$$ I wrote a computer program to bruteforce it, but that is too slow. ...
3
votes
2answers
323 views

Highly composite numbers and Abundant numbers

I'm working on Project Euler #23 and for the first time so far, I'm really confused, and the more I Google, the more confused I get. The problem states: A perfect number is a number for which the ...
0
votes
1answer
402 views

Project Euler 100 - can't understand solution

Problem I solved this using OEIS (finding smaller values and then searching OEIS for related sequences, it turned out that the exact sequence I needed was there) sequence. Looking at the thread, the ...
2
votes
1answer
123 views

Project Euler 9 - help understanding solution

I've been trying to understand the proof for a solution to the Euler 9 problem. I'm on this site under the heading "Solving the problem". I've understood the parts that came before it (excluding the "...
2
votes
1answer
198 views

Lattice paths - Project Euler

Problem 15 asks that how many routes there are through a $20×20$ grid(starting from upper left corner) only being able to move to the right and down. My answer is wrong. And i would like to know what ...
1
vote
2answers
379 views

Solving modified Fibonacci Nuggets [Project Euler 140]

I am trying to solve Modified Fibonacci golden nuggets. The generating function could be written as: $$A_G(x)=\frac{x(3x+1)}{1-x-x^2}$$ Let it be some $y\in\mathbb N$, then $$x(3x+1)=y(1-x-x^2)\\ x^...
5
votes
2answers
415 views

Combinatorics question based on ProjectEuler 606

Motivation The following text is from Problem 606 from Project Euler : A gozinta chain for $n$ is a sequence $\{1,a,b,...,n\}$ where each element properly divides the next. For example, there ...
9
votes
3answers
856 views

Amount of numbers not divisible by 7 in Pascals Triangle without iteration

For project Euler 148 problem, I want to get the amount of numbers in Pascals Triangle that are not divisible by 7 in row 0 to n where n is $10^9$. Find the number of entries which are not divisible ...
1
vote
2answers
793 views

project euler #577 confusion

Problem Link. An equilateral triangle with integer side length $n≥3$ is divided into $n^2$ equilateral triangles with side length 1 as shown in the diagram in the above link. The vertices of these ...
4
votes
2answers
745 views

Modeling path of a rolling ellipse

I'm trying to solve Project Euler problem 525. My approach is to find a parametric equation that can model the path of the center point as it rolls, then take the arc length of that function for one ...
2
votes
3answers
239 views

How to evaluate closed form of these series of sum? $\sum_{k=1}^n k*10^{k-1}$

$$\sum_{k=1}^n k*10^{k-1}$$ I came across this summation of series while I was trying to solve Project Euler Problem 40. The problem can be solved without using this method; however, I want to know ...
2
votes
2answers
522 views

How to compute quintinomial coefficients?

I'm looking for a way to compute elements of a quintinomial triangle. Is there a general case? To be more specific I'm looking for a way to compute the coefficients of the polynomial $(x^4 + x^3 + x^...
0
votes
1answer
171 views

Stirling numbers and bernoulli numbers for summing up n numbers to the kth power

I am currently working on problem 487 on project euler. I did some research and I only see 2 possibilities to solve this problem: 1. By using faulhabers formula 2. by using the formula featuring the ...
4
votes
2answers
273 views

How many digits of accuracy will an answer have?

I was doing a project Euler problem where I needed to find several Fibonacci numbers, but their index was so large that I could not use the typical recursive method. Instead, I used Binet's rule: $$ ...
0
votes
0answers
129 views

Divisor antichain related algorithm

I have thought about problem 386 for 2 months and I have given up. A divisor antichain of a number is a subset of its (positive) divisors no one of which is divisible by another (e.g. for $30$ $(2,3,5)...
1
vote
1answer
192 views

Order statistics of scaled beta distributions (Project Euler 573)

I am trying to solve Project Euler problem 573. To summarize my understanding of the problem: in a race with $n$ contenders, runner $k$ runs at speed $v_{k} = k/n$ and has to cover the distance $D_k ...
1
vote
0answers
118 views

Number of distinct values for $a^b$ with $2 \leq a \leq 100$ and $2 \leq b \leq 100$

This is the 29th Project Euler problem. I've been going crazy trying to spot where I've made a mistake. My thinking is to first assume that there are no duplicate values, i.e. all 99 values of $a$ ...
2
votes
2answers
504 views

Project Euler problem #3 (how to do it by hand?)

Problem #3 in Project Euler: What is the largest prime factor of the number $600851475143$? I want to solve this by hand. (I am doing this with all problems.) What techniques would allow me to ...
2
votes
1answer
647 views

How did I mix up this expected value problem (Project Euler 151)?

I'm working on project Euler 151 which goes as follows: A printing shop runs 16 batches (jobs) every week and each batch requires a sheet of special colour-proofing paper of size A5. Every ...
3
votes
3answers
3k views

Parametrization of Cardano triplet

I'm solving project euler problem 251. I arrived at the conclusion that $$\sqrt[3]{a+b\sqrt{c}}+ \sqrt[3]{a-b\sqrt{c}}=1 $$ can be written as $$8a^3+15a^2+6a-27b^2c=1$$ That is really faster to ...
2
votes
0answers
835 views

Project Euler's, Problem #565

Project Euler's, Problem #565 states: Let $\sigma(n)$ be the sum of the divisors of $n$. E.g. the divisors of $4$ are $1, 2$ and $4$, so $\sigma(4)=7$. The numbers $n$ not exceeding $20$ ...
3
votes
1answer
89 views

How many sets correspond to connected graphs

I'm trying to solve this project euler problem. I don't want to get too much help, since that would defeat the purpose, but I'm hitting a wall, so I'm asking a related problem here, from which I'll ...
0
votes
2answers
133 views

Possible mis-interpretation in Project Euler #21

Here is the problem statement for Problem 21 of Project Euler. Let $d(n)$ be defined as the sum of proper divisors of $n$ (numbers less than $n$ which divide evenly into $n$). If $d(a) = b$ ...
2
votes
1answer
4k views

The largest product of two n-digit numbers which is palindrome

Project Euler: 4 is stated as follows: Largest palindrome product A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 =...
1
vote
0answers
252 views

Game of Nim: Losing Positions [closed]

If you have heard of the game Nim, this is a version of the game. However, in this version, the players can only remove the amount of stones from the pile which is coprime to the current pile size. ...
4
votes
1answer
740 views

The 9 most significant digits in Fibonacci series (Project Euler 104)

With regards to project Euler, problem 104: https://projecteuler.net/problem=104 The essence of the question here is how to keep track of the 9 most significant digits of a Fibonacci series (Keeping ...
2
votes
1answer
276 views

Project Euler 106: Necessary and sufficient conditions

Problem Statement Let S(A) represent the sum of elements in set A of size n. We shall call it a special sum set if for any two non-empty disjoint subsets, B and C, the following properties are true:...
0
votes
2answers
162 views

Proof that nonconstant polynomial cannot have the same value at all integer points

I am reading the solution to the Project Euler problem 28 here, specifically the one under 'Deriving a non-iterative formula'. That solution first deduces the degree of the polynomial, and then ...
0
votes
2answers
189 views

(Soft Question) Is it bad to use Sage built in functions instead of creating my own?

I've been doing Project-Euler just as a way to increase my competency in computer science. I'm currently a Pure and Applied Math major who recently adopted computer science as a minor in order to ...
2
votes
0answers
312 views

How to simplify a sum of complex divisors?

This question arises from Project Euler 153. That problem asks for the sum of all complex divisors of all natural numbers up to a maximum, where a complex divisor is a complex number of the form a + ...
0
votes
1answer
2k views

Project Euler, Problem #529 10-substrings

Have anyone tried the problem 529? I tried but I'm confronted to a very high complexity $O(N^2)$ with $N$ being the length of the number. The code is: ...
1
vote
1answer
73 views

Statement from explanation of “What is the smallest number divisible by each of the numbers 1 to 20?” on Project Euler

Here is part of explanation from the PE problem 5: Let us consider the case of finding the least value of $N$ for $k=20$. We know that $N$ must be divisible by each of the primes, $p[i]$, less than ...
2
votes
2answers
976 views

Expected value of a guessing game

I'm trying to solve project euler 527, I don't understand how the expected value of B(6) is taken. A secret integer t is selected at random within the range 1 ≤ t ≤ n. The goal is to guess the ...
0
votes
2answers
289 views

Explaining solution of Project Euler problem #5

Here is the problem. Pretty simple to brute force, but more gently solutions are not that easy to understand, and I'm not talking about programming issue, but math-affiliated. For example, I'm ...
0
votes
0answers
163 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, if ...