Project Euler
From charlesreid1
Grid 0: Problems 1-99
- Problem 1- Multiples of 3 and 5 - printing out all multiples of 3 and 5.
- Problem 2 - Even Fibonacci - summing the Fibonacci numbers that are even and less than 4 million
- Problem 3 - Largest Prime Factor - Largest prime factor of a given 12-digit number
- Problem 4 - Largest Palindrome Product - Largest palindrome product (extracting substrings and sorting)
- Problem 5 - LCM - Least common multiple of all the integers from 1 to 20
- Problem 6 - SoS - Sum of squares and squares of sums
- Problem 7 - Ten Thousand Primes - Find the 10,001st prime.
- Problem 8 - Adjacent Digits - Largest product formed by 13 adjacent digits.
- Problem 9 - Pythagorean Triplet Sum - Finding a Pythagorean triplet with a specified sum.
- Problem 10 Sum of Primes - Sum of all primes below 2 million.
- Problem 11 - Greatest Product in Grid - Finding the greatest product of 4 numbers on a grid.
- Problem 12 - Highly Factorable Triangular Numbers - Finding highly factorable triangular numbers
- Problem 13 - Sum of Big Numbers - Work out the first 10 digits of a sum of 100 50-digit numbers
- Problem 14 - Longest Collatz Sequence - Finding the longest Collatz sequence for starting integers under 1 million
- Problem 15 - Lattice Paths - Finding the number of variations on a route through a lattice.
- Problem 16 - Summing the Digits - summing up the digits of a large power of 2, 2**1000
- Problem 17 - Number Spelling - spelling out all the numbers from one to a thousand
- Problem 18 - Shortest Path through a Triangle - find the path through a triangle of numbers that leads to the smallest sum
- Problem 19 - Counting Sundays
- Problem 20 - Sum of digits of 100! - straightforward use of BigInteger.
- Problem 27 - Quadratic Formula to Generate Primes
- Problem 28 - Number Spiral Diagonals
- Problem 29 - Distinct Terms Generated by Powers
- Problem 30 - Sum of Fifth Power of Digits
- Problem 31 - Polya - Change for a Dollar
- Problem 32 - Pandigital Products (A X B = C covering all 9 digits)
- Problem 33
- Problem 40
- Problem 41
- Problem 42
- Problem 43
- Problem 44
- Problem 45
- Problem 46
- Problem 47
- Problem 48
- Problem 49
- Problem 50
- Problem 51- Prime Replacement - Finding the number of primes that can be formed by replacing particular digits of a number
- Problem 52- Permuted Multiples - Find a number whose multiples 2x, 3x, 4x, 5x ad 6x are permutations of one another.
- Problem 53 - Number of Combinations Over 1M - Find how many different n choose r values are greater than 1 million for n between 1 and 100.
- Problem 54 - Comparing poker hands to determine a winner
- Problem 55
- Problem 56
- Problem 57
- Problem 58 - Counting how many composite numbers have exactly 8 factors
- Problem 59 - Decrypting 3-letter secret key (Vigenere cipher)
- Problem 60 - Prime pair sets - finding five primes such that any prime pair can be concatenated to form a new prime
- Problem 61 - Six cyclic 4-digit numbers, each of which are polygonal numbers (triangle, square, pentagonal, hexagonal, heptagonal, octagonal)
- Problem 62 - Cyclic permutations of cubes - find cubes that permute to other cubes.
- Problem 63 - Powerful digit counts - finding n-digit numbers that are n-th powers
- Problem 64 - Continued Fractions - Odd period square roots - finding the continued fraction representation of an odd number, and determining if it has an odd period. First 1,000 numbers, so these sequences get LONG.
- Problem 65 - Convergents of e - computing the 100th convergent (rational representation of continued fraction) for e and the square root of 2.
- Problem 66 - Diophantine equation - a nice problem involving quadratic Diphantine equations called Pell equations. These equations can be solved using the technique of continued fraction representations. It is much easier to solve this problem, then 64 and 65, rather than the other way around.
- Problem 67 - Maximum path sum - a retake on Project Euler/18 with a larger triangle for which a brute force solution technique is impossible.
- Problem 68
- Problem 69
- Problem 70
Grid 1: Problems 100-199
- Problem 100 - Combinations of Red and Blue Discs - find arrangements of blue and red discs that lead to a probability of exactly 50% that a blue disc is removed, two times in a row.
- Problem 101 - Bad Optimal Polynomials - Lagrangian polynomial interpolation for a sequence of numbers, interpolation of an optimal N-1 polynomial given N points of data.
- Problem 102 - Triangles Containing Origin - given 3 endpoints, determine if a triangle contains the origin.
- Problem 103 - Special Subset Sums: Optimum - finding the optimum special sum set with n=7.
- Problem 104 - Pandigital Fibonacci Ends - finding Fibonacci numbers with pandigital beginnings and endings.
- Problem 105 - Special Subset Sums: Testing - testing sets for the special sum property.
- Problem 106 - Special Subset Sums: Meta-testing - counting subset pairs that need to be tested.
- Problem 107 - Minimal Network - finding the minimal network connecting all vertices (minimum spanning tree).
- Problem 108 - Diophantine Reciprocals I - solving 1/x + 1/y = 1/n for distinct solutions.
- Problem 109 - Darts - counting the number of distinct ways to check out in darts with a score less than 100.
- Problem 110 - Diophantine Reciprocals II - finding the smallest n with over 4 million solutions to 1/x + 1/y = 1/n.
- Problem 111 - Primes with Runs - finding primes with maximum runs of repeated digits.
- Problem 112 - Bouncy Numbers - counting numbers whose digits are neither increasing nor decreasing.
- Problem 113 - Non-bouncy Numbers - counting numbers below a googol that are not bouncy.
- Problem 114 - Counting Block Combinations I - counting ways to fill a row with red and grey blocks.
- Problem 115 - Counting Block Combinations II - finding the minimum row length for over 1 million fill combinations.
- Problem 116 - Red, Green or Blue Tiles - counting ways to replace tiles with colored blocks.
- Problem 117 - Red, Green, and Blue Tiles - counting ways to place colored tiles of various lengths.
- Problem 118 - Pandigital Prime Sets - partitioning the digits 1-9 into sets of prime numbers.
- Problem 119 - Digit Power Sum - finding numbers equal to the sum of their digits raised to some power.
- Problem 120 - Square Remainders - sum of maximum remainders when (a−1)^n + (a+1)^n is divided by a^2.
- Problem 121 - Disc Game Prize Fund - finding max prize fund for a disc game with changing probabilities.
- Problem 122 - Efficient Exponentiation - computing n^15 using minimal multiplications (addition chains).
- Problem 123 - Prime Square Remainders - finding the prime where the maximum remainder exceeds 10^10.
- Problem 124 - Ordered Radicals - finding the k-th element when numbers are sorted by their radical (product of prime factors).
- Problem 125 - Palindromic Sums - sums of consecutive squares that are palindromic numbers.
- Problem 126 - Cuboid Layers - counting the number of cubes needed to cover visible faces of cuboids in successive layers.
- Problem 127 - abc-hits - counting triples where rad(abc) < c and a and b are coprime.
- Problem 128 - Hexagonal Tile Differences - finding tiles in a hexagonal spiral where all neighbors have prime differences.
- Problem 129 - Repunit Divisibility - finding the least n such that a repunit R(n) is divisible by a given number.
- Problem 130 - Composites with Prime Repunit Property - composite numbers where n divides the repunit R(n−1).
- Problem 131 - Prime Cube Partnership - primes p for which n^3 + n^2·p is a perfect cube.
- Problem 132 - Large Repunit Factors - sum of the first forty prime factors of R(10^9).
- Problem 133 - Repunit Nonfactors - primes that will never divide any repunit R(10^n).
- Problem 134 - Prime Pair Connection - connecting consecutive primes p1, p2 to form a number divisible by p2.
- Problem 135 - Same Differences - solving x^2 − y^2 − z^2 = n where x, y, z form an arithmetic progression.
- Problem 136 - Singleton Difference - finding n with exactly one solution to x^2 − y^2 − z^2 = n.
- Problem 137 - Fibonacci Golden Nuggets - Fibonacci numbers appearing as solutions to a Pell-type Diophantine equation.
- Problem 138 - Special Isosceles Triangles - isosceles triangles with integer height and half-base differing by 1.
- Problem 139 - Pythagorean Tiles - Pythagorean triangles that allow tiling of a square of side equal to the hypotenuse.
- Problem 140 - Modified Fibonacci Golden Nuggets - golden nuggets from a modified Fibonacci sequence.
- Problem 141 - Square Progressive Numbers - perfect squares that are also progressive (geometric progression of digits).
- Problem 142 - Perfect Square Collection - finding x+y+z where x>y>z>0, all pairwise sums/differences are squares.
- Problem 143 - Torricelli Triangles - triangles whose Torricelli point has integer distances to the vertices.
- Problem 144 - Laser Beam Reflections - reflecting a laser beam inside an elliptical mirror until it exits.
- Problem 145 - Reversible Numbers - counting numbers n below 1 billion where n + reverse(n) has all odd digits.
- Problem 146 - Investigating a Prime Pattern - finding n where n^2+1, n^2+3, n^2+7, n^2+9, n^2+13, n^2+27 are consecutive primes.
- Problem 147 - Rectangles in Cross-hatched Grids - counting all rectangles in a cross-hatched rectangular grid.
- Problem 148 - Exploring Pascal's Triangle - counting entries in the first billion rows of Pascal's triangle not divisible by 7.
- Problem 149 - Maximum-sum Subsequence - finding the maximum sum of adjacent subsequences in a generated 2000×2000 array.
- Problem 150 - Sub-triangle Sums - finding the minimum-sum sub-triangle in a triangular array of 1000 rows.
- Problem 151
- Problem 152
- Problem 153
- Problem 154
- Problem 155
- Problem 156
- Problem 157
- Problem 158 - Strings of various lengths, with exactly one character lexicographically out of sorts
- Problem 159 - Digital Root Sums of Factorisations - finding the sum of maximum digital root sums of factorizations for numbers up to 1,000,000.
- Problem 160 - Factorial Trailing Digits - finding the last five digits before trailing zeros in 1,000,000,000,000!.
- Problem 161 - Triominoes - counting the number of ways to tile a 9 by 12 grid using triominoes.
- Problem 162 - Hexadecimal Numbers - counting hexadecimal numbers containing at most 16 digits with all of 0,1,A present.
- Problem 163 - Cross-hatched Triangles - counting all triangles of different shape, size, orientation, or location in a size 36 cross-hatched equilateral triangle.
- Problem 164 - Three Consecutive Digit Sum Limit - counting 20-digit numbers where no three consecutive digits sum to more than 9.
- Problem 165 - Intersections - counting distinct true intersection points among 5000 line segments generated via Blum Blum Shub.
- Problem 166 - Criss Cross - filling a 4x4 grid with digits so all rows, columns, and diagonals have the same sum.
- Problem 167 - Investigating Ulam Sequences - studying Ulam sequences U(2,2n+1) for n up to 10.
- Problem 168 - Number Rotations - sum of all integers n (10 < n < 10^100) where n divides its right-rotation.
- Problem 169 - Powers of Two - number of ways to express 10^25 as a sum of powers of 2, each used at most twice.
- Problem 170 - Largest Pandigital Concatenated Product - finding the largest 0-9 pandigital formed by concatenating products of an integer with two or more integers.
- Problem 171
- Problem 172 - Few Repeated Digits - how many 18 digit numbers have no digit occurring more than 3 times in n?
- Problem 173
- Problem 174
- Problem 175
- Problem 176
- Problem 177
- Problem 178
- Problem 179
- Problem 190
- Problem 191
- Problem 192
- Problem 193
- Problem 194
- Problem 195
- Problem 196
- Problem 197
- Problem 198
- Problem 199
- Problem 200 - Prime-proof Squbes - find the 200th prime-proof sqube containing the contiguous sub-string "200".
- Problem 201 - Subsets with a Unique Sum - find the sum of all elements whose sum of subsets is unique.
- Problem 202 - Laserbeam - counting the number of reflections of a laser beam inside an equilateral triangle.
- Problem 203 - Squarefree Binomial Coefficients - sum of distinct squarefree numbers in Pascal's triangle (first 51 rows).
- Problem 204 - Generalised Hamming Numbers - counting Hamming numbers of type 100 up to 10^9.
- Problem 205 - Dice Game - probability that Pyramidal Peter beats Cubic Colin in a dice game.
- Problem 206 - Concealed Square - finding the unique positive integer whose square has the form 1_2_3_4_5_6_7_8_9_0.
- Problem 207 - Integer Partition Equations - solving 4^t = 2^t + k for integer partitions where t is an integer.
- Problem 208 - Robot Walks - counting the number of 70-step robot walks that return to the start on a circle of 5 points.
- Problem 209 - Circular Logic - counting truth tables that satisfy a circular Boolean logic condition.
- Problem 210 - Obtuse Angled Triangles - counting obtuse-angled triangles in a lattice bounded by |x| + |y| ≤ r.
- Problem 211 - Divisor Square Sum - finding numbers n for which the sum of squares of divisors is a perfect square.
- Problem 212 - Combined Volume of Cuboids - finding the combined volume of a union of axis-aligned cuboids.
- Problem 213 - Flea Circus - expected number of empty squares after ringing a bell 50 times on a 30×30 grid of fleas.
- Problem 214 - Totient Chains - sum of all primes below 40 million with a totient chain length of 25.
- Problem 215 - Crack-free Walls - counting the number of ways to build a crack-free 32×10 wall using 2×1 and 3×1 bricks.
- Problem 216 - The Primality of 2n²−1 - counting numbers n ≤ 50,000,000 for which 2n²−1 is prime.
- Problem 217 - Balanced Numbers - sum of all balanced numbers with at most 47 digits.
- Problem 218 - Perfect Right-angled Triangles - counting perfect right-angled triangles that are not super-perfect.
- Problem 219 - Skew-cost Coding - finding the minimal cost of a skew-cost prefix-free code for 1 billion messages.
- Problem 220 - Heighway Dragon - location of the cursor after 10^12 steps in a Heighway dragon fractal.
- Problem 221 - Alexandrian Integers - sum of the first 150,000 Alexandrian integers.
- Problem 222 - Sphere Packing - finding the minimum pipe length to contain 21 spheres of given radii.
- Problem 223 - Almost Right-angled Triangles I - counting almost right-angled triangles where a² + b² = c² + 1.
- Problem 224 - Almost Right-angled Triangles II - counting almost right-angled triangles where a² + b² = c² − 1.
- Problem 225 - Tribonacci Non-divisors - finding the 124th odd number that does not divide any term of the Tribonacci sequence.
- Problem 226 - A Scoop of Blancmange - finding the area under the lower envelope of the blancmange curve and the circle.
- Problem 227 - The Chase - expected number of turns for two players playing dice with opposite dice.
- Problem 254 - Maximum Source of Sums of Digits of Sums of Digits of Sums of Factorial Digit Sums
Grid 3: Problems 300-399
- Problem 301
- Problem 310
- Problem 312
- Problem 319
- Problem 323
- Problem 328
- Problem 334
- Problem 337
- Problem 345
- Problem 346
- Problem 355
- Problem 356
- Problem 364
- Problem 367
- Problem 373
- Problem 378
- Problem 382
- Problem 389
- Problem 391
Grid 4: Problems 400-499
Grid 5: Problems 500-599
- Problem 500 - Smallest Number with 2n Factors - Finding the smallest number with 2^n divisors
- Problem 501 - Eight Divisors - Finding numbers with exactly 8 divisors, less than 1 trillion
- Problem 502 - Castles - finding the maximum number of castles that can be formed on extremely large grids
Grid 9: Problems 900-999