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
1 vote
0 answers
45 views

Finding the rotation based on quaternion rotation

I have a problem with computer vision-related task that I'm struggling with. So in short I have images based on 4 set of cameras that takes 360 degrees images but the issue is that those cameras are ...
user avatar
0 votes
0 answers
61 views

Mathematical Application of Project Euler 215 - Crack-free Walls

I am taking a Math course as part of a Data Science curriculum. For the final project we have to solve a math problem in Python and write it up. I chose Project Euler 215 Crack-free Walls, my course ...
user avatar
1 vote
0 answers
79 views

Issues generating all primitive integer triangles with 60 degree angle (Eisenstein Triples)

I am trying to write a program that generates all primitive Eisenstein Triples, i.e. triangles with integer sides that have a 60 degree angle. These triplets satisfy the equation $a^2-ab+b^2=c^2$. ...
user avatar
1 vote
2 answers
131 views

Powers of $2$ starting with $123$...Does a pattern exist?

I'm currently working on Project Euler problem #686 "Powers of Two". The first power of $2$ which starts with $123$... is $2^{90}$. I noticed that the next powers of $2$ that start with $123$...
user avatar
  • 11
0 votes
1 answer
35 views

Transforming two 3D vectors into each other gives different Euler angles

Lets take two vectors A and B represented in x,y,z(metres) and Euler angles XYZr(deg) as ...
user avatar
  • 13
3 votes
0 answers
127 views

Finding values for which sequence $x_{n+1}=x_n-1/x_n$ is periodic

I'm looking at the sequence $x_{n+1}=x_n-1/x_n$ and want to find starting values $x_0$ for which the sequence is periodic. I want to calculate all values for which the sequence is periodic with a ...
user avatar
  • 63
2 votes
2 answers
250 views

Factors of $2n^2 \leq n$?

How many factors of $2n^2$ are less than or equal to $n$? I know that the number of factors of $n^2$ less than $n$ is half the number of factors of $n^2$ (each factor $< n$ corresponds with one ...
user avatar
3 votes
1 answer
219 views

Maximum-sum path down a triangle of numbers

We have a triangle of $n$ positive and integer number. we start from top or (head) of this triangle and in each step we are going to adjacent number in next row. goal is finding path of maximum ...
user avatar
0 votes
1 answer
106 views

Project Euler #731_part2 [closed]

In this link : Project Euler problem #731 , I got a nice solution for my question but i'm missing a crucial part . I want to get an explanation of this part of the answer : My question : Why did we ...
user avatar
  • 103
0 votes
1 answer
331 views

Project Euler problem #731

In this Poject Euler probelm < https://projecteuler.net/problem=731 > I'm asked to find the 10 decimal digits from the nth number onward in the decimal expansion of the infinte serie : $$\sum_{k=...
user avatar
  • 103
0 votes
1 answer
289 views

Stoneham number expansion

How can we calculate the expansion of the a Stoneham number $\alpha_{10,3}$ I want to get the more digits as possible
user avatar
  • 103
0 votes
1 answer
57 views

Project Euler - Magic 5-gon Ring (problem 68)

The problem's description is found here, but I screen shot it for your convenience. I have been attempting to solve problem, but no luck so far. I am actually not looking for a solution but rather an ...
user avatar
0 votes
2 answers
289 views

Project Euler #712 [closed]

I've been stuck in this problem for a time, now. The problem is as follows: For any integer $n \gt0$ and prime number $p,$ define $\nu_p(n)$ as the greatest integer $r$ such that $p^r$ divides $n$. ...
user avatar
  • 127
0 votes
1 answer
68 views

Generating continued fractions for square roots of integers

The problem in Project Euler #64 asks us to generate continued fractions for square roots of integers. The basic way to do it is: A fraction $\frac{\sqrt{n} + b}{d}$ can be expanded to: $$ 1 + \frac{1}...
user avatar
2 votes
2 answers
154 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 ...
user avatar
3 votes
1 answer
164 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 ...
user avatar
8 votes
3 answers
672 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 ...
user avatar
  • 1,124
0 votes
1 answer
181 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 ...
user avatar
0 votes
1 answer
71 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 ...
user avatar
3 votes
0 answers
219 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-...
user avatar
-1 votes
1 answer
48 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. ...
user avatar
0 votes
1 answer
299 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)=...
user avatar
  • 111
2 votes
1 answer
1k 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 ...
user avatar
  • 123
1 vote
2 answers
173 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 ...
user avatar
0 votes
1 answer
30 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^...
user avatar
  • 3,281
0 votes
1 answer
595 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^{...
user avatar
  • 337
-4 votes
1 answer
50 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: ...
user avatar
1 vote
1 answer
670 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....
user avatar
  • 133
1 vote
1 answer
120 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 ...
user avatar
  • 5,987
3 votes
3 answers
144 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. ...
user avatar
3 votes
2 answers
499 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 ...
user avatar
0 votes
1 answer
552 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 ...
user avatar
2 votes
1 answer
134 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 "...
user avatar
2 votes
1 answer
220 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 ...
user avatar
1 vote
2 answers
458 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^...
user avatar
  • 17.3k
5 votes
2 answers
516 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 ...
user avatar
  • 3,915
9 votes
3 answers
1k 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 ...
user avatar
  • 2,115
1 vote
2 answers
964 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 ...
user avatar
  • 1,289
3 votes
1 answer
1k 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 ...
user avatar
  • 1,160
2 votes
3 answers
465 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 ...
user avatar
  • 23
2 votes
2 answers
613 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^...
user avatar
0 votes
1 answer
194 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 ...
user avatar
4 votes
2 answers
478 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: $$ ...
user avatar
  • 1,160
0 votes
0 answers
199 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)...
user avatar
  • 1,195
1 vote
1 answer
235 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 ...
user avatar
  • 168
1 vote
0 answers
122 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$ ...
user avatar
  • 313
2 votes
2 answers
546 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 ...
user avatar
  • 3,869
2 votes
1 answer
874 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 ...
user avatar
3 votes
3 answers
4k 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 ...
user avatar
2 votes
0 answers
889 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$ ...
user avatar