Skip to content

My solutions to the first 100 problems on Project Euler, written in Julia

License

Notifications You must be signed in to change notification settings

byhill/ProjectEuler100.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ProjectEuler100.jl

Build status

PE

This repository contains my solutions to the first 100 problems of Project Euler, written in Julia. Hopefully, by making this repository public, it will help someone learn how to tackle Project Euler problems while using Julia. With the exception of problem 100, the solutions in this repository also work well (after a little modification) for Hackerrank's ongoing Project Euler+ contest. Note that the solutions are tested on 64-bit machines, and will likely not run correctly on 32-bit machines.

Due to Project Euler's policy on publishing solutions, I will not share my solutions to problems past the first 100.

If you would like to see my current progress on Project Euler, such as what problems I've completed, what awards I've obtained, or my forum posts, feel free to add me as a friend on Project Euler. My friend key is 1327298_jzCskJIfItQqZaPDyT4kQpsHmSlrcHky. You can also view my progress on HackerRanks' Project Euler+ contest here.

Problems

The following is the list of problems. Timings are made using BenchmarkTools.jl, on a 10.15.7 macos, 2.2 GHz Quad-Core Intel Core i7 processor, with 16 GB 1600 MHz DDR3 memory.

Problem Title Difficulty Running Time (s) Hackerrank
001 Multiples of 3 or 5 5% 0.000 100 (code)
002 Even Fibonacci numbers 5% 0.000 100 (code)
003 Largest prime factor 5% 0.000 100 (code)
004 Largest palindrome product 5% 0.000 100 (code)
005 Smallest multiple 5% 0.000 100 (code)
006 Sum square difference 5% 0.000 100 (code)
007 10001st prime 5% 0.000 100 (code)
008 Largest product in a series 5% 0.000 100 (code)
009 Special Pythagorean triplet 5% 0.000 100 (code)
010 Summation of primes 5% 0.000 100 (code)
011 Largest product in a grid 5% 0.000 100 (code)
012 Highly divisible triangular number 5% 0.000 100 (code)
013 Large sum 5% 0.000 100 (code)
014 Longest Collatz sequence 5% 0.143 100 (code)
015 Lattice paths 5% 0.000 100 (code)
016 Power digit sum 5% 0.000 100 (code)
017 Number letter counts 5% 0.000 100 (code)
018 Maximum path sum I 5% 0.000 100 (code)
019 Counting Sundays 5% 0.000 100 (code)
020 Factorial digit sum 5% 0.000 100 (code)
021 Amicable numbers 5% 0.001 100 (code)
022 Names scores 5% 0.002 100 (code)
023 Non-abundant sums 5% 0.004 100 (code)
024 Lexicographic permutations 5% 0.000 100 (code)
025 1000-digit Fibonacci number 5% 0.000 100 (code)
026 Reciprocal cycles 5% 0.000 100 (code)
027 Quadratic primes 5% 0.001 100 (code)
028 Number spiral diagonals 5% 0.000 100 (code)
029 Distinct powers 5% 0.000 100 (code)
030 Digit fifth powers 5% 0.000 100 (code)
031 Coin sums 5% 0.000 100 (code)
032 Pandigital products 5% 0.042 100 (code)
033 Digit cancelling fractions 5% 0.000 100 (code)
034 Digit factorials 5% 0.032 100 (code)
035 Circular primes 5% 0.007 100 (code)
036 Double-base palindromes 5% 0.030 100 (code)
037 Truncatable primes 5% 0.000 100 (code)
038 Pandigital multiples 5% 0.001 100 (code)
039 Integer right triangles 5% 0.000 100 (code)
040 Champernowne's constant 5% 0.000 100 (code)
041 Pandigital prime 5% 0.052 100 (code)
042 Coded triangle numbers 5% 0.000 100 (code)
043 Sub-string divisibility 5% 0.961 100 (code)
044 Pentagon numbers 5% 0.000 100 (code)
045 Triangular, pentagonal, and hexagonal 5% 0.000 100 (code)
046 Goldbach's other conjecture 5% 0.000 100 (code)
047 Distinct primes factors 5% 0.011 100 (code)
048 Self powers 5% 0.001 100 (code)
049 Prime permutations 5% 0.000 100 (code)
050 Consecutive prime sum 5% 0.003 100 (code)
051 Prime digit replacements 15% 0.023 100 (code)
052 Permuted multiples 5% 0.051 100 (code)
053 Combinatoric selections 5% 0.000 100 (code)
054 Poker hands 10% 0.004 100 (code)
055 Lychrel numbers 5% 0.043 100 (code)
056 Powerful digit sum 5% 0.012 100 (code)
057 Square root convergents 5% 0.001 100 (code)
058 Spiral primes 5% 0.016 100 (code)
059 XOR decryption 5% 0.087 100 (code)
060 Prime pair sets 20% 2.607 100 (code)
061 Cyclical figurate numbers 20% 0.063 100 (code)
062 Cubic permutations 15% 0.003 100 (code)
063 Powerful digit counts 5% 0.000 100 (code)
064 Odd period square roots 20% 0.005 100 (code)
065 Convergents of e 15% 0.000 100 (code)
066 Diophantine equation 25% 0.004 100 (code)
067 Maximum path sum II 5% 0.001 100 (code)
068 Magic 5-gon ring 25% 0.000 100 (code)
069 Totient maximum 10% 0.000 100 (code)
070 Totient permutation 20% 0.222 100 (code)
071 Ordered fractions 10% 0.000 100 (code)
072 Counting fractions 20% 0.009 100 (code)
073 Counting fractions in a range 15% 0.000 100 (code)
074 Digit factorial chains 15% 0.034 100 (code)
075 Singular integer right triangles 25% 0.018 100 (code)
076 Counting summations 10% 0.000 100 (code)
077 Prime summations 25% 0.000 100 (code)
078 Coin partitions 30% 0.193 100 (code)
079 Passcode derivation 5% 0.000 100 (code)
080 Square root digital expansion 20% 0.000 100 (code)
081 Path sum: two ways 10% 0.001 100 (code)
082 Path sum: three ways 20% 0.001 100 (code)
083 Path sum: four ways 25% 0.001 100 (code)
084 Monopoly odds 35% 0.003 100 (code)
085 Counting rectangles 15% 0.000 100 (code)
086 Cuboid route 35% 0.000 100 (code)
087 Prime power triples 20% 0.005 100 (code)
088 Product-sum numbers 40% 0.002 100 (code)
089 Roman numerals 20% 0.001 100 (code)
090 Cube digit pairs 40% 0.023 100 (code)
091 Right triangles with integer coordinates 25% 0.000 100 (code)
092 Square digit chains 5% 0.001 100 (code)
093 Arithmetic expressions 35% 0.067 100 (code)
094 Almost equilateral triangles 35% 0.000 100 (code)
095 Amicable chains 30% 0.049 100 (code)
096 Su Doku 25% 0.093 100 (code)
097 Large non-Mersenne prime 5% 0.000 100 (code)
098 Anagramic squares 35% 0.049 100 (code)
099 Largest exponential 10% 0.001 100 (code)
100 Arranged probability 30% 0.000 100 (code)

About

My solutions to the first 100 problems on Project Euler, written in Julia

Topics

Resources

License

Stars

Watchers

Forks

Languages