Project Euler Problem #115

Problem #115 concerns separating rows of blocks into red sections and black sections. The question reads: Project Euler Problem 115: Counting block combinations II NOTE: This is a more difficult version of Problem 114. A row measuring n units in length has red blocks with a minimum length of m units placed on it, such that any two red blocks …

Project Euler Problem #114

Problem #114 concerns partitioning a row of blocks with contiguous red sections and contiguous grey sections. The question reads: My solution for this problem involves dynamic programming. Here’s my solution: Solution #1: Dynamic Programming Approach It suffices to recursively find the number of ways a row of n units can be filled such that the …

Project Euler Problem #113

Problem #113 concerns numbers whose digits are neither increasing nor decreasing. The question reads: Project Euler Problem 113: Non-bouncy numbers Working from left-to-right if no digit is exceeded by the digit to its left it is called an increasing number; for example, 134468. Similarly if no digit is exceeded by the digit to its right …

Project Euler Problem #112

Problem #112 concerns numbers which are neither increasing nor decreasing. The question reads: Project Euler Problem 112: Bouncy numbers Working from left-to-right if no digit is exceeded by the digit to its left it is called an increasing number; for example, 134468. Similarly if no digit is exceeded by the digit to its right it …

Project Euler Problem #111

Problem #111 concerns 10-digit primes with lots of repeated digits. The question reads: My solution to this problem can best be described as a brute force approach. Here’s my solution: Solution #1: Brute Force Approach We simply search for primes with each digit. Through brute force it is possible to check every possible position of …

Project Euler Problem #109

Problem #109 concerns checking out in a game of darts. The question reads: My solution for this problem is another example of the powers of brute force. Here’s my solution: Solution #1: Brute Force Approach We simply check every combination of dart scores that end in a double and count the ones with a total …

Project Euler Problem #108

Problem #108 concerns the Diophantine equation 1/x + 1/y = 1/n for arbitrary integers n. The question reads: Project Euler Problem 108: Diophantine reciprocals I In the following equation x, y, and n are positive integers. 1/x + 1/y = 1/n For n = 4 there are exactly three distinct solutions: 1/5 + 1/20 = 1/4 1/6 + 1/12 = 1/4 …

Project Euler Problem #107

Problem #107 concerns determining the Minimum Spanning Tree for a weighted graph. The question reads: As it turns out, the formal term for this type of minimal network is the Minimum Spanning Tree of the graph. There are many well known algorithms for finding the minimum spanning tree of an arbitrary graph. I used Prim’s …

Project Euler Problem #105

Problem #105 concerns sets with ordered sums of all of their subsets. The question reads: Project Euler Problem 105: Special subset sums: testing Let S(A) represent the sum of elements in set A of size n. We shall call it a special sum set if for any two non-empty disjoint subsets, B and C, the following …

Project Euler Problem #104

Problem #104 concerns Fibonacci numbers which contain each of the digits 1-9 in their leftmost and their rightmost digits. The question reads: Project Euler Problem 104: Pandigital Fibonacci ends The Fibonacci sequence is defined by the recurrence relation: Fn = Fn−1 + Fn−2, where F1 = 1 and F2 = 1. It turns out that F541, which contains 113 …

Design a site like this with WordPress.com
Get started