Project Euler is a collection of mathematical programming problems of varying difficulty.
3
votes
2answers
96 views
A little scheme programming challenge
I am learning scheme to get something new from a programming language and this code below is the solution to Project Euler question 21 but the code runs 10x slower than the listed Python code when I ...
2
votes
1answer
140 views
Isn't this dynamic programming?
I was solving problem 18 and 67 on Project Euler and came up with an algorithm that actually goes through almost all the possibilities to find the answer in O(n) time. However, ProjecEuler claims ...
6
votes
2answers
199 views
Problem 5 on Project Euler
I just recently learned about Project Euler and have started doing the problems on there. I cleared problem 1 and 2, had no idea how to do 3 and 4, and started to do 5. I've seen the post regarding ...
0
votes
2answers
72 views
How do I add memoization to this problem? [closed]
Problem
Starting in the top left corner of a 22 grid, there are 6 routes (without backtracking) to the bottom right corner.
How many routes are there through a 2020 grid?
Solution
Here is my ...
1
vote
1answer
72 views
Euler 2 : Simple Fibonacci
I'm just starting to experiment with F# (from a C# background). I think I'm starting to get into the right way of thinking, but this code still seems pretty awkward. Is there a better (more terse) ...
1
vote
1answer
103 views
Connect graph from 2d array
I just completed project euler problem 18 which is a dynamic programming question through a graph of a triangle of numbers. The goal is to find the path from top to bottom of the triangle that has the ...
3
votes
2answers
117 views
Python vs. Java Runtime on Euler 22
On performing the following Euler problem, Python takes up less lines and runs faster (Python ~0.05s, Java ~0.3s on my machine).
Could I optimize this Java code in any way? The problem is here
...
2
votes
2answers
219 views
Python Solution for Project Euler #2 (Fibonacci Sums)
I'm a fairly new programmer (just started yesterday!). I decided to tackle Project Euler #2 today, as I did #1 yesterday without many problems. I came up with what seems to me to be a working ...
3
votes
2answers
198 views
Euler 35 - python solution taking too long
Here is my solution for Project Euler 35. (Find the number of circular primes below 1,000,000. Circular meaning all rotations of the digits are prime, i.e. 197, 719, 971.) The code takes about 30 ...
5
votes
1answer
141 views
Project Euler question 2 in CoffeeScript
By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
fib = (x) ->
return 0 if x == 0
return 1 if x == 1
...
5
votes
4answers
354 views
Improving my solution to Project Euler problem #1?
I'm trying to compare my own implementation with another solution of ProjectEuler problem #1, which uses a list comprehension:
module Progression1 (sumProgressions) where
import Prelude
...
2
votes
2answers
178 views
Project Euler, #4: Incorrect Results on 7-digit numbers
I've got my answer working (up until a 7-digit answer is requested, anyway), and would like some help
returning the correct answer
speeding up the results
I was thinking of storing the values of ...
2
votes
5answers
334 views
Critique my code for determining numeric palindromes
I am working on bettering my C# skills, and recently wrote this program to solve a projecteuler.net problem (Problem description: "A palindromic number reads the same both ways. The largest palindrome ...
7
votes
6answers
817 views
Sum of all primes under 2 million
I have this assignment to write the optimized space and time code for finding the sum of all primes under 2 million in c/c++. Im using the following function to check if each number is prime
int ...
6
votes
2answers
148 views
Project Euler problem 1 in Factor
I'm a complete beginner of Factor, but I just managed to solved Euler Problem #1 using it, and would love to have the code reviewed. Anything that can be improved? In particular I'm wondering if there ...