Questions tagged [project-euler]

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

(copied from Project Euler site)

Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems.

The motivation for starting Project Euler, and its continuation, is to provide a platform for the inquiring mind to delve into unfamiliar areas and learn new concepts in a fun and recreational context.

Before asking anything about problems in Project Euler, read this question in the meta and this thread in Project Euler forum. Most important things are:

  • Project Euler does not want their participants asking elsewhere, they want them to experiment, solve easier sub-problems, etc.

  • They do not want answers, or parts of answers, publicly visible.

175 questions
2
votes
1 answer

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, which literally has run for days on my machine…
2
votes
2 answers

Project Euler analyzing and simplifying problem 33

These questions concern "Project Euler problem 33": The fraction $\displaystyle \frac {49}{98}$ is a curious fraction, as an inexperienced mathematician in attempting to simplify it may incorrectly believe that $\displaystyle \frac {49}{98} = \frac…
Bakudan
  • 145
2
votes
1 answer

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 problem as it is given I first tried to solve a…
Slugger
  • 5,556
1
vote
1 answer

What is the max possible value of the sum of power of y of each digits?

I'm trying to solve the 30th euler problem. My code is working, but I'm not sure if it's luck or ingeniousness. To be the most efficient, I want to reduce at the maximum the numbers to checks. I feel a solution, but not sure if it's true. Given p as…
Steve B
  • 113
1
vote
1 answer

Digit Factorial Sum?

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 answer but I don't know when to stop looking for the…
1
vote
2 answers

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$... seem to follow a pattern. The exponent is always…
Andreas
  • 11
1
vote
1 answer

Searching for pandigital numbers

I was working on the Euler project's problems and the 32nd problem is the following: We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once; for example, the 5-digit number, 15234, is 1 through 5…
l1x
  • 103
1
vote
2 answers

Compute $\sum_0^{n-1}2^i11^{n-i-1}\bmod10^9$ when $n=13^{17}$

Given the following function $f$ $f(1)=1$ $f(n)=11\cdot f(n-1)+2^{n-1}$ I would like to compute $f(13^{17})\mod 10^9$ and ended up using the following : $f(n)=\sum_{i=0}^{n-1}({11^{n-(i+1)}\cdot 2^i})$ though I am able to quickly compute a single…
hoang
  • 125
0
votes
1 answer

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 the base to all the nodes on the top. Conditions…
0
votes
2 answers

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... ## Code in Python ## def checkdivisable_function(num): dev= 500 # Devisable By 501…
0
votes
1 answer

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

I have a looked around, but the answer is nowhere to be found.
Xharl
  • 1
0
votes
1 answer

How to formally describe condition

I was solving this initial problem at Project Euler website (link: https://projecteuler.net/problem=30). It asks to find the sum of all the numbers in which the sum of the digits to the fifth power is equal to the number itself. I basically searched…
drover
  • 1
0
votes
1 answer

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)=12$. Also, instead of the result being the sum…
flcoder
  • 111
0
votes
1 answer

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: public static boolean is10Friendly(long num) { List numbers = new ArrayList<>(); …