euler-manager 0.0.6 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -0
- data/data/images/sod_13.gif +4 -0
- data/data/problems/100.yml +1 -1
- data/data/problems/101.yml +16 -16
- data/data/problems/102.yml +2 -3
- data/data/problems/103.yml +16 -16
- data/data/problems/105.yml +2 -2
- data/data/problems/106.yml +2 -2
- data/data/problems/107.yml +15 -15
- data/data/problems/108.yml +13 -16
- data/data/problems/109.yml +16 -17
- data/data/problems/11.yml +22 -23
- data/data/problems/110.yml +9 -10
- data/data/problems/114.yml +30 -41
- data/data/problems/116.yml +19 -25
- data/data/problems/117.yml +24 -33
- data/data/problems/120.yml +3 -3
- data/data/problems/122.yml +18 -20
- data/data/problems/123.yml +2 -2
- data/data/problems/124.yml +18 -23
- data/data/problems/126.yml +10 -11
- data/data/problems/127.yml +7 -7
- data/data/problems/128.yml +1 -1
- data/data/problems/130.yml +6 -7
- data/data/problems/131.yml +1 -1
- data/data/problems/132.yml +1 -1
- data/data/problems/134.yml +2 -2
- data/data/problems/135.yml +2 -2
- data/data/problems/136.yml +2 -2
- data/data/problems/137.yml +4 -4
- data/data/problems/138.yml +4 -4
- data/data/problems/139.yml +1 -1
- data/data/problems/14.yml +12 -13
- data/data/problems/140.yml +3 -3
- data/data/problems/142.yml +1 -1
- data/data/problems/143.yml +2 -2
- data/data/problems/144.yml +3 -3
- data/data/problems/147.yml +1 -1
- data/data/problems/149.yml +11 -13
- data/data/problems/15.yml +3 -3
- data/data/problems/150.yml +8 -8
- data/data/problems/151.yml +1 -1
- data/data/problems/152.yml +1 -1
- data/data/problems/153.yml +24 -26
- data/data/problems/154.yml +10 -9
- data/data/problems/155.yml +3 -3
- data/data/problems/156.yml +7 -8
- data/data/problems/157.yml +3 -4
- data/data/problems/158.yml +4 -5
- data/data/problems/159.yml +3 -3
- data/data/problems/161.yml +5 -4
- data/data/problems/163.yml +10 -10
- data/data/problems/165.yml +1 -1
- data/data/problems/166.yml +7 -7
- data/data/problems/167.yml +3 -4
- data/data/problems/168.yml +5 -5
- data/data/problems/170.yml +2 -2
- data/data/problems/171.yml +3 -3
- data/data/problems/173.yml +1 -1
- data/data/problems/174.yml +3 -3
- data/data/problems/175.yml +4 -4
- data/data/problems/177.yml +1 -1
- data/data/problems/179.yml +1 -1
- data/data/problems/180.yml +8 -9
- data/data/problems/182.yml +22 -24
- data/data/problems/183.yml +14 -15
- data/data/problems/184.yml +2 -2
- data/data/problems/186.yml +10 -11
- data/data/problems/187.yml +6 -8
- data/data/problems/189.yml +10 -9
- data/data/problems/190.yml +1 -1
- data/data/problems/192.yml +11 -12
- data/data/problems/194.yml +8 -8
- data/data/problems/195.yml +2 -2
- data/data/problems/197.yml +5 -6
- data/data/problems/198.yml +11 -12
- data/data/problems/199.yml +7 -7
- data/data/problems/20.yml +8 -10
- data/data/problems/202.yml +1 -1
- data/data/problems/207.yml +4 -4
- data/data/problems/208.yml +4 -5
- data/data/problems/21.yml +5 -6
- data/data/problems/210.yml +4 -5
- data/data/problems/211.yml +1 -1
- data/data/problems/212.yml +22 -26
- data/data/problems/213.yml +5 -6
- data/data/problems/214.yml +8 -9
- data/data/problems/215.yml +4 -4
- data/data/problems/216.yml +5 -5
- data/data/problems/217.yml +8 -10
- data/data/problems/218.yml +1 -1
- data/data/problems/22.yml +1 -1
- data/data/problems/220.yml +15 -15
- data/data/problems/221.yml +4 -5
- data/data/problems/223.yml +5 -6
- data/data/problems/224.yml +5 -6
- data/data/problems/226.yml +8 -8
- data/data/problems/228.yml +4 -5
- data/data/problems/229.yml +16 -16
- data/data/problems/230.yml +4 -4
- data/data/problems/231.yml +4 -5
- data/data/problems/233.yml +1 -1
- data/data/problems/234.yml +9 -10
- data/data/problems/236.yml +4 -4
- data/data/problems/237.yml +3 -3
- data/data/problems/238.yml +3 -4
- data/data/problems/241.yml +4 -4
- data/data/problems/242.yml +2 -2
- data/data/problems/243.yml +12 -12
- data/data/problems/244.yml +10 -11
- data/data/problems/245.yml +14 -15
- data/data/problems/246.yml +10 -9
- data/data/problems/247.yml +12 -13
- data/data/problems/251.yml +3 -3
- data/data/problems/252.yml +6 -7
- data/data/problems/254.yml +2 -2
- data/data/problems/255.yml +35 -36
- data/data/problems/256.yml +16 -20
- data/data/problems/257.yml +9 -9
- data/data/problems/258.yml +5 -6
- data/data/problems/26.yml +1 -1
- data/data/problems/260.yml +6 -8
- data/data/problems/261.yml +6 -7
- data/data/problems/262.yml +1 -1
- data/data/problems/264.yml +10 -11
- data/data/problems/265.yml +1 -1
- data/data/problems/27.yml +10 -11
- data/data/problems/270.yml +3 -3
- data/data/problems/271.yml +5 -6
- data/data/problems/272.yml +6 -7
- data/data/problems/273.yml +3 -3
- data/data/problems/274.yml +15 -15
- data/data/problems/275.yml +3 -3
- data/data/problems/276.yml +3 -3
- data/data/problems/277.yml +3 -3
- data/data/problems/278.yml +15 -17
- data/data/problems/281.yml +4 -4
- data/data/problems/282.yml +2 -2
- data/data/problems/284.yml +7 -8
- data/data/problems/287.yml +18 -17
- data/data/problems/288.yml +1 -1
- data/data/problems/289.yml +1 -1
- data/data/problems/29.yml +12 -13
- data/data/problems/290.yml +1 -1
- data/data/problems/291.yml +3 -3
- data/data/problems/292.yml +1 -1
- data/data/problems/293.yml +7 -7
- data/data/problems/295.yml +8 -8
- data/data/problems/296.yml +4 -5
- data/data/problems/297.yml +4 -5
- data/data/problems/299.yml +11 -12
- data/data/problems/300.yml +10 -9
- data/data/problems/301.yml +2 -2
- data/data/problems/303.yml +3 -3
- data/data/problems/304.yml +6 -7
- data/data/problems/305.yml +3 -2
- data/data/problems/306.yml +8 -11
- data/data/problems/307.yml +2 -3
- data/data/problems/309.yml +8 -8
- data/data/problems/31.yml +1 -1
- data/data/problems/310.yml +6 -7
- data/data/problems/311.yml +11 -11
- data/data/problems/312.yml +5 -5
- data/data/problems/313.yml +4 -4
- data/data/problems/314.yml +4 -5
- data/data/problems/315.yml +26 -27
- data/data/problems/316.yml +2 -4
- data/data/problems/318.yml +27 -34
- data/data/problems/319.yml +11 -12
- data/data/problems/32.yml +1 -1
- data/data/problems/320.yml +1 -1
- data/data/problems/321.yml +3 -3
- data/data/problems/322.yml +4 -4
- data/data/problems/323.yml +7 -8
- data/data/problems/324.yml +8 -9
- data/data/problems/325.yml +1 -1
- data/data/problems/326.yml +2 -2
- data/data/problems/327.yml +27 -29
- data/data/problems/328.yml +2 -2
- data/data/problems/330.yml +13 -14
- data/data/problems/331.yml +12 -12
- data/data/problems/332.yml +10 -9
- data/data/problems/333.yml +15 -16
- data/data/problems/334.yml +14 -14
- data/data/problems/335.yml +2 -2
- data/data/problems/336.yml +5 -4
- data/data/problems/337.yml +7 -7
- data/data/problems/338.yml +21 -24
- data/data/problems/340.yml +6 -7
- data/data/problems/341.yml +3 -5
- data/data/problems/342.yml +6 -7
- data/data/problems/343.yml +8 -12
- data/data/problems/344.yml +1 -1
- data/data/problems/347.yml +8 -8
- data/data/problems/350.yml +5 -5
- data/data/problems/351.yml +1 -1
- data/data/problems/352.yml +25 -26
- data/data/problems/353.yml +1 -1
- data/data/problems/354.yml +6 -6
- data/data/problems/356.yml +2 -3
- data/data/problems/358.yml +13 -14
- data/data/problems/359.yml +1 -1
- data/data/problems/361.yml +2 -1
- data/data/problems/362.yml +11 -13
- data/data/problems/363.yml +6 -6
- data/data/problems/364.yml +3 -3
- data/data/problems/365.yml +2 -2
- data/data/problems/366.yml +4 -5
- data/data/problems/369.yml +1 -1
- data/data/problems/370.yml +3 -3
- data/data/problems/372.yml +6 -8
- data/data/problems/374.yml +5 -7
- data/data/problems/375.yml +5 -6
- data/data/problems/377.yml +2 -2
- data/data/problems/378.yml +2 -2
- data/data/problems/379.yml +7 -8
- data/data/problems/38.yml +9 -9
- data/data/problems/380.yml +12 -15
- data/data/problems/381.yml +8 -11
- data/data/problems/382.yml +6 -6
- data/data/problems/383.yml +4 -4
- data/data/problems/384.yml +7 -8
- data/data/problems/385.yml +8 -8
- data/data/problems/386.yml +2 -2
- data/data/problems/388.yml +5 -6
- data/data/problems/39.yml +1 -1
- data/data/problems/390.yml +4 -6
- data/data/problems/391.yml +11 -12
- data/data/problems/392.yml +1 -1
- data/data/problems/393.yml +2 -2
- data/data/problems/394.yml +6 -7
- data/data/problems/395.yml +5 -5
- data/data/problems/396.yml +15 -17
- data/data/problems/397.yml +5 -8
- data/data/problems/4.yml +1 -1
- data/data/problems/40.yml +1 -1
- data/data/problems/400.yml +5 -6
- data/data/problems/401.yml +2 -2
- data/data/problems/402.yml +7 -8
- data/data/problems/403.yml +9 -10
- data/data/problems/404.yml +5 -6
- data/data/problems/405.yml +7 -7
- data/data/problems/406.yml +8 -10
- data/data/problems/407.yml +9 -9
- data/data/problems/410.yml +5 -6
- data/data/problems/411.yml +11 -12
- data/data/problems/412.yml +9 -9
- data/data/problems/414.yml +13 -15
- data/data/problems/415.yml +2 -2
- data/data/problems/417.yml +4 -5
- data/data/problems/418.yml +7 -8
- data/data/problems/419.yml +8 -8
- data/data/problems/420.yml +5 -5
- data/data/problems/421.yml +11 -12
- data/data/problems/422.yml +9 -9
- data/data/problems/423.yml +5 -7
- data/data/problems/424.yml +8 -9
- data/data/problems/425.yml +2 -3
- data/data/problems/426.yml +3 -3
- data/data/problems/427.yml +8 -8
- data/data/problems/428.yml +16 -19
- data/data/problems/430.yml +4 -5
- data/data/problems/44.yml +3 -3
- data/data/problems/45.yml +2 -2
- data/data/problems/46.yml +8 -8
- data/data/problems/47.yml +6 -10
- data/data/problems/53.yml +8 -9
- data/data/problems/56.yml +1 -1
- data/data/problems/57.yml +5 -5
- data/data/problems/58.yml +1 -1
- data/data/problems/6.yml +1 -1
- data/data/problems/61.yml +4 -4
- data/data/problems/64.yml +39 -46
- data/data/problems/65.yml +13 -14
- data/data/problems/66.yml +10 -10
- data/data/problems/68.yml +4 -5
- data/data/problems/69.yml +2 -2
- data/data/problems/70.yml +3 -4
- data/data/problems/71.yml +3 -3
- data/data/problems/72.yml +3 -3
- data/data/problems/73.yml +3 -3
- data/data/problems/74.yml +15 -22
- data/data/problems/75.yml +1 -1
- data/data/problems/8.yml +14 -14
- data/data/problems/81.yml +7 -7
- data/data/problems/82.yml +4 -4
- data/data/problems/83.yml +4 -4
- data/data/problems/85.yml +1 -1
- data/data/problems/86.yml +8 -8
- data/data/problems/88.yml +22 -27
- data/data/problems/9.yml +6 -6
- data/data/problems/90.yml +13 -13
- data/data/problems/91.yml +8 -8
- data/data/problems/92.yml +7 -9
- data/data/problems/93.yml +9 -10
- data/data/problems/95.yml +1 -1
- data/data/problems/96.yml +17 -17
- data/data/problems/97.yml +2 -2
- data/data/problems/99.yml +2 -2
- data/lib/euler/problem.rb +6 -1
- data/lib/euler/version.rb +1 -1
- metadata +2 -2
data/data/problems/88.yml
CHANGED
@@ -5,30 +5,25 @@
|
|
5
5
|
:content: "A natural number, N, that can be written as the sum and product of a given
|
6
6
|
set of at least two natural numbers, {_a_<sub>1</sub>, _a_<sub>2</sub>, ... , _a_<sub><i>k</i></sub>}
|
7
7
|
is called a product-sum number: N = _a_<sub>1</sub> + _a_<sub>2</sub> + ... + _a_<sub><i>k</i></sub>
|
8
|
-
= _a_<sub>1</sub> ![×](/
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
1 ![×](/
|
22
|
-
2 ![×](/
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
of all the minimal product-sum numbers
|
29
|
-
|
30
|
-
for 2 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)_k_
|
31
|
-
![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)12 is {4,
|
32
|
-
6, 8, 12, 15, 16}, the sum is 61.\n\nWhat is the sum of all the minimal product-sum
|
33
|
-
numbers for 2 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)_k_
|
34
|
-
![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)12000?\n\n"
|
8
|
+
= _a_<sub>1</sub> ![×]({{ images_dir }}/symbol_times.gif) _a_<sub>2</sub> ![×]({{
|
9
|
+
images_dir }}/symbol_times.gif) ... ![×]({{ images_dir }}/symbol_times.gif) _a_<sub><i>k</i></sub>.\n\nFor
|
10
|
+
example, 6 = 1 + 2 + 3 = 1 ![×]({{ images_dir }}/symbol_times.gif) 2 ![×]({{ images_dir
|
11
|
+
}}/symbol_times.gif) 3.\n\nFor a given set of size, _k_, we shall call the smallest
|
12
|
+
N with this property a minimal product-sum number. The minimal product-sum numbers
|
13
|
+
for sets of size, _k_ = 2, 3, 4, 5, and 6 are as follows.\n\n_k_=2: 4 = 2 ![×]({{
|
14
|
+
images_dir }}/symbol_times.gif) 2 = 2 + 2 \n_k_=3: 6 = 1 ![×]({{ images_dir }}/symbol_times.gif)
|
15
|
+
2 ![×]({{ images_dir }}/symbol_times.gif) 3 = 1 + 2 + 3 \n_k_=4: 8 = 1 ![×]({{
|
16
|
+
images_dir }}/symbol_times.gif) 1 ![×]({{ images_dir }}/symbol_times.gif) 2 ![×]({{
|
17
|
+
images_dir }}/symbol_times.gif) 4 = 1 + 1 + 2 + 4 \n_k_=5: 8 = 1 ![×]({{ images_dir
|
18
|
+
}}/symbol_times.gif) 1 ![×]({{ images_dir }}/symbol_times.gif) 2 ![×]({{ images_dir
|
19
|
+
}}/symbol_times.gif) 2 ![×]({{ images_dir }}/symbol_times.gif) 2 = 1 + 1 + 2 + 2
|
20
|
+
+ 2 \n_k_=6: 12 = 1 ![×]({{ images_dir }}/symbol_times.gif) 1 ![×]({{ images_dir
|
21
|
+
}}/symbol_times.gif) 1 ![×]({{ images_dir }}/symbol_times.gif) 1 ![×]({{ images_dir
|
22
|
+
}}/symbol_times.gif) 2 ![×]({{ images_dir }}/symbol_times.gif) 6 = 1 + 1 + 1 + 1
|
23
|
+
+ 2 + 6\n\nHence for 2 ![≤]({{ images_dir }}/symbol_le.gif)_k_ ![≤]({{ images_dir
|
24
|
+
}}/symbol_le.gif)6, the sum of all the minimal product-sum numbers is 4+6+8+12 =
|
25
|
+
30; note that 8 is only counted once in the sum.\n\nIn fact, as the complete set
|
26
|
+
of minimal product-sum numbers for 2 ![≤]({{ images_dir }}/symbol_le.gif)_k_ ![≤]({{
|
27
|
+
images_dir }}/symbol_le.gif)12 is {4, 6, 8, 12, 15, 16}, the sum is 61.\n\nWhat
|
28
|
+
is the sum of all the minimal product-sum numbers for 2 ![≤]({{ images_dir }}/symbol_le.gif)_k_
|
29
|
+
![≤]({{ images_dir }}/symbol_le.gif)12000?\n\n"
|
data/data/problems/9.yml
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
:id: 9
|
3
3
|
:name: Special Pythagorean triplet
|
4
4
|
:url: http://projecteuler.net/problem=9
|
5
|
-
:content: "A Pythagorean triplet is a set of three natural numbers, <var>a</var> ![<](
|
6
|
-
<var>b</var> ![<](/
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
:content: "A Pythagorean triplet is a set of three natural numbers, <var>a</var> ![<]({{
|
6
|
+
images_dir }}/symbol_lt.gif) <var>b</var> ![<]({{ images_dir }}/symbol_lt.gif) <var>c</var>,
|
7
|
+
for which,\n\n <var>a</var><sup>2</sup> + <var>b</var><sup>2</sup> = <var>c</var><sup>2</sup>\n\nFor
|
8
|
+
example, 3<sup>2</sup> + 4<sup>2</sup> = 9 + 16 = 25 = 5<sup>2</sup>.\n\nThere exists
|
9
|
+
exactly one Pythagorean triplet for which <var>a</var> + <var>b</var> + <var>c</var>
|
10
|
+
= 1000. \nFind the product <var>abc</var>.\n\n"
|
data/data/problems/90.yml
CHANGED
@@ -5,17 +5,17 @@
|
|
5
5
|
:content: "Each of the six faces on a cube has a different digit (0 to 9) written
|
6
6
|
on it; the same is done to a second cube. By placing the two cubes side-by-side
|
7
7
|
in different positions we can form a variety of 2-digit numbers.\n\nFor example,
|
8
|
-
the square number 64 could be formed:\n\n ![](/
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
8
|
+
the square number 64 could be formed:\n\n ![]({{ images_dir }}/p_090.gif) \n\nIn
|
9
|
+
fact, by carefully choosing the digits on both cubes it is possible to display all
|
10
|
+
of the square numbers below one-hundred: 01, 04, 09, 16, 25, 36, 49, 64, and 81.\n\nFor
|
11
|
+
example, one way this can be achieved is by placing {0, 5, 6, 7, 8, 9} on one cube
|
12
|
+
and {1, 2, 3, 4, 8, 9} on the other cube.\n\nHowever, for this problem we shall
|
13
|
+
allow the 6 or 9 to be turned upside-down so that an arrangement like {0, 5, 6,
|
14
|
+
7, 8, 9} and {1, 2, 3, 4, 6, 7} allows for all nine square numbers to be displayed;
|
15
|
+
otherwise it would be impossible to obtain 09.\n\nIn determining a distinct arrangement
|
16
|
+
we are interested in the digits on each cube, not the order.\n\n{1, 2, 3, 4, 5,
|
17
|
+
6} is equivalent to {3, 6, 4, 1, 2, 5} \n\r{1, 2, 3, 4, 5, 6} is distinct from
|
18
|
+
{1, 2, 3, 4, 5, 9}\n\nBut because we are allowing 6 and 9 to be reversed, the two
|
19
|
+
distinct sets in the last example both represent the extended set {1, 2, 3, 4, 5,
|
20
|
+
6, 9} for the purpose of forming 2-digit numbers.\n\nHow many distinct arrangements
|
21
21
|
of the two cubes allow for all of the square numbers to be displayed?\n\n"
|
data/data/problems/91.yml
CHANGED
@@ -4,11 +4,11 @@
|
|
4
4
|
:url: http://projecteuler.net/problem=91
|
5
5
|
:content: "The points P (_x_<sub>1</sub>, _y_<sub>1</sub>) and Q (_x_<sub>2</sub>,
|
6
6
|
_y_<sub>2</sub>) are plotted at integer co-ordinates and are joined to the origin,
|
7
|
-
O(0,0), to form ΔOPQ.\n\n ![](/
|
8
|
-
|
9
|
-
|
10
|
-
_x_<sub>1</sub>, _y_<sub>1</sub>, _x_<sub>2</sub>, _y_<sub>2</sub> ![≤](
|
11
|
-
2.\n\n ![](/
|
12
|
-
|
13
|
-
_y_<sub>
|
14
|
-
|
7
|
+
O(0,0), to form ΔOPQ.\n\n ![]({{ images_dir }}/p_091_1.gif) \n\nThere are exactly
|
8
|
+
fourteen triangles containing a right angle that can be formed when each co-ordinate
|
9
|
+
lies between 0 and 2 inclusive; that is, \n0 ![≤]({{ images_dir }}/symbol_le.gif)
|
10
|
+
_x_<sub>1</sub>, _y_<sub>1</sub>, _x_<sub>2</sub>, _y_<sub>2</sub> ![≤]({{ images_dir
|
11
|
+
}}/symbol_le.gif) 2.\n\n ![]({{ images_dir }}/p_091_2.gif) \n\nGiven that 0 ![≤]({{
|
12
|
+
images_dir }}/symbol_le.gif) _x_<sub>1</sub>, _y_<sub>1</sub>, _x_<sub>2</sub>,
|
13
|
+
_y_<sub>2</sub> ![≤]({{ images_dir }}/symbol_le.gif) 50, how many right triangles
|
14
|
+
can be formed?\n\n"
|
data/data/problems/92.yml
CHANGED
@@ -4,15 +4,13 @@
|
|
4
4
|
:url: http://projecteuler.net/problem=92
|
5
5
|
:content: "A number chain is created by continuously adding the square of the digits
|
6
6
|
in a number to form a new number until it has been seen before.\n\nFor example,\n\n44
|
7
|
-
![→](/
|
8
|
-
13 ![→](/
|
9
|
-
**1** ![→](/
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
![→](/
|
14
|
-
4 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) 16 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif)
|
15
|
-
37 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) 58 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif)
|
7
|
+
![→]({{ images_dir }}/symbol_maps.gif) 32 ![→]({{ images_dir }}/symbol_maps.gif)
|
8
|
+
13 ![→]({{ images_dir }}/symbol_maps.gif) 10 ![→]({{ images_dir }}/symbol_maps.gif)
|
9
|
+
**1** ![→]({{ images_dir }}/symbol_maps.gif) **1** \n85 ![→]({{ images_dir }}/symbol_maps.gif)
|
10
|
+
**89** ![→]({{ images_dir }}/symbol_maps.gif) 145 ![→]({{ images_dir }}/symbol_maps.gif)
|
11
|
+
42 ![→]({{ images_dir }}/symbol_maps.gif) 20 ![→]({{ images_dir }}/symbol_maps.gif)
|
12
|
+
4 ![→]({{ images_dir }}/symbol_maps.gif) 16 ![→]({{ images_dir }}/symbol_maps.gif)
|
13
|
+
37 ![→]({{ images_dir }}/symbol_maps.gif) 58 ![→]({{ images_dir }}/symbol_maps.gif)
|
16
14
|
**89**\n\nTherefore any chain that arrives at 1 or 89 will become stuck in an endless
|
17
15
|
loop. What is most amazing is that EVERY starting number will eventually arrive
|
18
16
|
at 1 or 89.\n\nHow many starting numbers below ten million will arrive at 89?\n\n"
|
data/data/problems/93.yml
CHANGED
@@ -3,15 +3,14 @@
|
|
3
3
|
:name: Arithmetic expressions
|
4
4
|
:url: http://projecteuler.net/problem=93
|
5
5
|
:content: "By using each of the digits from the set, {1, 2, 3, 4}, exactly once, and
|
6
|
-
making use of the four arithmetic operations (+, ![−](/
|
6
|
+
making use of the four arithmetic operations (+, ![−]({{ images_dir }}/symbol_minus.gif),
|
7
7
|
\\*, /) and brackets/parentheses, it is possible to form different positive integer
|
8
8
|
targets.\n\nFor example,\n\n8 = (4 \\* (1 + 3)) / 2 \n14 = 4 \\* (3 + 1 / 2) \n19
|
9
|
-
= 4 \\* (2 + 3) ![−](/
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
obtained, giving your answer as a string: _abcd_.\n\n"
|
9
|
+
= 4 \\* (2 + 3) ![−]({{ images_dir }}/symbol_minus.gif) 1 \n36 = 3 \\* 4 \\* (2
|
10
|
+
+ 1)\n\nNote that concatenations of the digits, like 12 + 34, are not allowed.\n\nUsing
|
11
|
+
the set, {1, 2, 3, 4}, it is possible to obtain thirty-one different target numbers
|
12
|
+
of which 36 is the maximum, and each of the numbers 1 to 28 can be obtained before
|
13
|
+
encountering the first non-expressible number.\n\nFind the set of four distinct
|
14
|
+
digits, _a_ ![<]({{ images_dir }}/symbol_lt.gif) _b_ < _c_ ![<]({{ images_dir
|
15
|
+
}}/symbol_lt.gif) _d_, for which the longest set of consecutive positive integers,
|
16
|
+
1 to _n_, can be obtained, giving your answer as a string: _abcd_.\n\n"
|
data/data/problems/95.yml
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
Perhaps less well known are longer chains. For example, starting with 12496, we form a chain of five numbers:
|
11
11
|
|
12
|
-
12496 ![→](/
|
12
|
+
12496 ![→]({{ images_dir }}/symbol_maps.gif) 14288 ![→]({{ images_dir }}/symbol_maps.gif) 15472 ![→]({{ images_dir }}/symbol_maps.gif) 14536 ![→]({{ images_dir }}/symbol_maps.gif) 14264 ( ![→]({{ images_dir }}/symbol_maps.gif) 12496 ![→]({{ images_dir }}/symbol_maps.gif) ...)
|
13
13
|
|
14
14
|
Since this chain returns to its starting point, it is called an amicable chain.
|
15
15
|
|
data/data/problems/96.yml
CHANGED
@@ -11,20 +11,20 @@
|
|
11
11
|
its solution grid.\n\n| \n\n| 0 0 3 \n9 0 0 \n0 0 1 | 0 2 0 \n3 0 5 \n8 0 6
|
12
12
|
| 6 0 0 \n0 0 1 \n4 0 0 |\n| 0 0 8 \n7 0 0 \n0 0 6 | 1 0 2 \n0 0 0 \n7 0 8
|
13
13
|
| 9 0 0 \n0 0 8 \n2 0 0 |\n| 0 0 2 \n8 0 0 \n0 0 5 | 6 0 9 \n2 0 3 \n0 1 0
|
14
|
-
| 5 0 0 \n0 0 9 \n3 0 0 |\n\n | ![](/
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
14
|
+
| 5 0 0 \n0 0 9 \n3 0 0 |\n\n | ![]({{ images_dir }}/spacer.gif) \n | \n\n| 4
|
15
|
+
8 3 \n9 6 7 \n2 5 1 | 9 2 1 \n3 4 5 \n8 7 6 | 6 5 7 \n8 2 1 \n4 9 3 |\n| 5
|
16
|
+
4 8 \n7 2 9 \n1 3 6 | 1 3 2 \n5 6 4 \n7 9 8 | 9 7 6 \n1 3 8 \n2 4 5 |\n| 3
|
17
|
+
7 2 \n8 1 4 \n6 9 5 | 6 8 9 \n2 5 3 \n4 1 7 | 5 1 4 \n7 6 9 \n3 8 2 |\n\n
|
18
|
+
|\n\nA well constructed Su Doku puzzle has a unique solution and can be solved by
|
19
|
+
logic, although it may be necessary to employ \"guess and test\" methods in order
|
20
|
+
to eliminate options (there is much contested opinion over this). The complexity
|
21
|
+
of the search determines the difficulty of the puzzle; the example above is considered
|
22
|
+
_easy_ because it can be solved by straight forward direct deduction.\n\nThe 6K
|
23
|
+
text file, [sudoku.txt](project/sudoku.txt) (right click and 'Save Link/Target As...'),
|
24
|
+
contains fifty different Su Doku puzzles ranging in difficulty, but all with unique
|
25
|
+
solutions (the first puzzle in the file is the example above).\n\nBy solving all
|
26
|
+
fifty puzzles find the sum of the 3-digit numbers found in the top left corner of
|
27
|
+
each solution grid; for example, 483 is the 3-digit number found in the top left
|
28
|
+
corner of the solution grid above.\n\n<!--<p class='info'>Note: If you're convinced
|
29
|
+
that "guess and test" methods need not be employed please tell how you
|
30
|
+
would solve #6 and #46. (c;</p>-->\n"
|
data/data/problems/97.yml
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
:name: Large non-Mersenne prime
|
4
4
|
:url: http://projecteuler.net/problem=97
|
5
5
|
:content: |+
|
6
|
-
The first known prime found to exceed one million digits was discovered in 1999, and is a Mersenne prime of the form 2<sup>6972593</sup> ![−](/
|
6
|
+
The first known prime found to exceed one million digits was discovered in 1999, and is a Mersenne prime of the form 2<sup>6972593</sup> ![−]({{ images_dir }}/symbol_minus.gif)1; it contains exactly 2,098,960 digits. Subsequently other Mersenne primes, of the form 2<sup><i>p</i></sup> ![−]({{ images_dir }}/symbol_minus.gif)1, have been found which contain more digits.
|
7
7
|
|
8
|
-
However, in 2004 there was found a massive non-Mersenne prime which contains 2,357,207 digits: 28433 ![×](/
|
8
|
+
However, in 2004 there was found a massive non-Mersenne prime which contains 2,357,207 digits: 28433 ![×]({{ images_dir }}/symbol_times.gif)2<sup>7830457</sup>+1.
|
9
9
|
|
10
10
|
Find the last ten digits of this prime number.
|
11
11
|
|
data/data/problems/99.yml
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
:name: Largest exponential
|
4
4
|
:url: http://projecteuler.net/problem=99
|
5
5
|
:content: |+
|
6
|
-
Comparing two numbers written in index form like 2<sup>11</sup> and 3<sup>7</sup> is not difficult, as any calculator would confirm that 2<sup>11</sup> = 2048 ![<](/
|
6
|
+
Comparing two numbers written in index form like 2<sup>11</sup> and 3<sup>7</sup> is not difficult, as any calculator would confirm that 2<sup>11</sup> = 2048 ![<]({{ images_dir }}/symbol_lt.gif) 3<sup>7</sup> = 2187.
|
7
7
|
|
8
|
-
However, confirming that 632382<sup>518061</sup> ![>](/
|
8
|
+
However, confirming that 632382<sup>518061</sup> ![>]({{ images_dir }}/symbol_gt.gif) 519432<sup>525806</sup> would be much more difficult, as both numbers contain over three million digits.
|
9
9
|
|
10
10
|
Using [base\_exp.txt](project/base_exp.txt) (right click and 'Save Link/Target As...'), a 22K text file containing one thousand lines with a base/exponent pair on each line, determine which line number has the greatest numerical value.
|
11
11
|
|
data/lib/euler/problem.rb
CHANGED
@@ -24,6 +24,11 @@ module Euler
|
|
24
24
|
@content = options[:content]
|
25
25
|
end
|
26
26
|
|
27
|
+
# Content without going through the template engine
|
28
|
+
def template
|
29
|
+
@content
|
30
|
+
end
|
31
|
+
|
27
32
|
# Passing content though an ultra simple template engine before returning it
|
28
33
|
def content
|
29
34
|
@content.gsub(/\{\{\s?images_dir\s?\}\}/, Euler.images_dir)
|
@@ -46,7 +51,7 @@ module Euler
|
|
46
51
|
id: id,
|
47
52
|
name: name,
|
48
53
|
url: url,
|
49
|
-
content:
|
54
|
+
content: template
|
50
55
|
}
|
51
56
|
end
|
52
57
|
|
data/lib/euler/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: euler-manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Yaworsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|