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/117.yml
CHANGED
@@ -5,36 +5,27 @@
|
|
5
5
|
:content: "Using a combination of black square tiles and oblong tiles chosen from:
|
6
6
|
red tiles measuring two units, green tiles measuring three units, and blue tiles
|
7
7
|
measuring four units, it is possible to tile a row measuring five units in length
|
8
|
-
in exactly fifteen different ways.\n\n| \n\n| ![](/
|
9
|
-
|
10
|
-
| ![](/
|
11
|
-
|
12
|
-
| ![](/
|
13
|
-
| ![](/
|
14
|
-
|
15
|
-
| ![](/
|
16
|
-
|\n\n | \n\n| ![](/
|
17
|
-
| ![](/
|
18
|
-
| ![](/
|
19
|
-
\n\n| ![](/
|
20
|
-
| ![](/
|
21
|
-
|
22
|
-
| ![](/
|
23
|
-
|\n\n | \n\n| ![](/
|
24
|
-
| ![](/
|
25
|
-
|
26
|
-
| ![](/
|
27
|
-
|\n\n |\n| \n\n| ![](/
|
28
|
-
| ![](/
|
29
|
-
|\n\n | \n\n| ![](/
|
30
|
-
|
31
|
-
|
32
|
-
| ![](/home/will/src/euler-manager/config/../data/images/spacer.gif) | ![](/home/will/src/euler-manager/config/../data/images/spacer.gif)
|
33
|
-
|\n\n | \n\n| ![](/home/will/src/euler-manager/config/../data/images/spacer.gif)
|
34
|
-
| ![](/home/will/src/euler-manager/config/../data/images/spacer.gif) |\n\n |\n|
|
35
|
-
\n\n| ![](/home/will/src/euler-manager/config/../data/images/spacer.gif) | ![](/home/will/src/euler-manager/config/../data/images/spacer.gif)
|
36
|
-
|\n\n | \n\n| ![](/home/will/src/euler-manager/config/../data/images/spacer.gif)
|
37
|
-
| ![](/home/will/src/euler-manager/config/../data/images/spacer.gif) |\n\n | \n\n|
|
38
|
-
![](/home/will/src/euler-manager/config/../data/images/spacer.gif) | ![](/home/will/src/euler-manager/config/../data/images/spacer.gif)
|
39
|
-
|\n\n | |\n\nHow many ways can a row measuring fifty units in length be tiled?\n\nNOTE:
|
40
|
-
This is related to [Problem 116](problem=116).\n\n"
|
8
|
+
in exactly fifteen different ways.\n\n| \n\n| ![]({{ images_dir }}/spacer.gif) |
|
9
|
+
![]({{ images_dir }}/spacer.gif) | ![]({{ images_dir }}/spacer.gif) | ![]({{ images_dir
|
10
|
+
}}/spacer.gif) | ![]({{ images_dir }}/spacer.gif) |\n\n | \n\n| ![]({{ images_dir
|
11
|
+
}}/spacer.gif) | ![]({{ images_dir }}/spacer.gif) | ![]({{ images_dir }}/spacer.gif)
|
12
|
+
| ![]({{ images_dir }}/spacer.gif) |\n\n | \n\n| ![]({{ images_dir }}/spacer.gif)
|
13
|
+
| ![]({{ images_dir }}/spacer.gif) | ![]({{ images_dir }}/spacer.gif) | ![]({{ images_dir
|
14
|
+
}}/spacer.gif) |\n\n | \n\n| ![]({{ images_dir }}/spacer.gif) | ![]({{ images_dir
|
15
|
+
}}/spacer.gif) | ![]({{ images_dir }}/spacer.gif) | ![]({{ images_dir }}/spacer.gif)
|
16
|
+
|\n\n |\n| \n\n| ![]({{ images_dir }}/spacer.gif) | ![]({{ images_dir }}/spacer.gif)
|
17
|
+
| ![]({{ images_dir }}/spacer.gif) | ![]({{ images_dir }}/spacer.gif) |\n\n | \n\n|
|
18
|
+
![]({{ images_dir }}/spacer.gif) | ![]({{ images_dir }}/spacer.gif) | ![]({{ images_dir
|
19
|
+
}}/spacer.gif) |\n\n | \n\n| ![]({{ images_dir }}/spacer.gif) | ![]({{ images_dir
|
20
|
+
}}/spacer.gif) | ![]({{ images_dir }}/spacer.gif) |\n\n | \n\n| ![]({{ images_dir
|
21
|
+
}}/spacer.gif) | ![]({{ images_dir }}/spacer.gif) | ![]({{ images_dir }}/spacer.gif)
|
22
|
+
|\n\n |\n| \n\n| ![]({{ images_dir }}/spacer.gif) | ![]({{ images_dir }}/spacer.gif)
|
23
|
+
| ![]({{ images_dir }}/spacer.gif) |\n\n | \n\n| ![]({{ images_dir }}/spacer.gif)
|
24
|
+
| ![]({{ images_dir }}/spacer.gif) | ![]({{ images_dir }}/spacer.gif) |\n\n | \n\n|
|
25
|
+
![]({{ images_dir }}/spacer.gif) | ![]({{ images_dir }}/spacer.gif) | ![]({{ images_dir
|
26
|
+
}}/spacer.gif) |\n\n | \n\n| ![]({{ images_dir }}/spacer.gif) | ![]({{ images_dir
|
27
|
+
}}/spacer.gif) |\n\n |\n| \n\n| ![]({{ images_dir }}/spacer.gif) | ![]({{ images_dir
|
28
|
+
}}/spacer.gif) |\n\n | \n\n| ![]({{ images_dir }}/spacer.gif) | ![]({{ images_dir
|
29
|
+
}}/spacer.gif) |\n\n | \n\n| ![]({{ images_dir }}/spacer.gif) | ![]({{ images_dir
|
30
|
+
}}/spacer.gif) |\n\n | |\n\nHow many ways can a row measuring fifty units in length
|
31
|
+
be tiled?\n\nNOTE: This is related to [Problem 116](problem=116).\n\n"
|
data/data/problems/120.yml
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
:name: Square remainders
|
4
4
|
:url: http://projecteuler.net/problem=120
|
5
5
|
:content: |+
|
6
|
-
Let _r_ be the remainder when (_a_ ![−](/
|
6
|
+
Let _r_ be the remainder when (_a_ ![−]({{ images_dir }}/symbol_minus.gif)1)<sup><i>n</i></sup> + (_a_+1)<sup><i>n</i></sup> is divided by _a_<sup>2</sup>.
|
7
7
|
|
8
|
-
For example, if _a_ = 7 and _n_ = 3, then _r_ = 42: 6<sup>3</sup> + 8<sup>3</sup> = 728 ![≡](/
|
8
|
+
For example, if _a_ = 7 and _n_ = 3, then _r_ = 42: 6<sup>3</sup> + 8<sup>3</sup> = 728 ![≡]({{ images_dir }}/symbol_cong.gif) 42 mod 49. And as _n_ varies, so too will _r_, but for _a_ = 7 it turns out that _r_<sub>max</sub> = 42.
|
9
9
|
|
10
|
-
For 3 ![≤](/
|
10
|
+
For 3 ![≤]({{ images_dir }}/symbol_le.gif) _a_ ![≤]({{ images_dir }}/symbol_le.gif) 1000, find ![∑]({{ images_dir }}/symbol_sum.gif) _r_<sub>max</sub>.
|
11
11
|
|
data/data/problems/122.yml
CHANGED
@@ -3,23 +3,21 @@
|
|
3
3
|
:name: Efficient exponentiation
|
4
4
|
:url: http://projecteuler.net/problem=122
|
5
5
|
:content: "The most naive way of computing _n_<sup>15</sup> requires fourteen multiplications:\n\n_n_
|
6
|
-
![×](/
|
7
|
-
... ![×](/
|
8
|
-
|
9
|
-
|
10
|
-
_n_<sup>2</sup> \n_n_<sup>
|
11
|
-
_n_<sup>
|
12
|
-
_n_<sup>4</sup> = _n_<sup>
|
13
|
-
_n_<sup>
|
14
|
-
_n_
|
15
|
-
|
16
|
-
|
17
|
-
_n_ = _n_<sup>
|
18
|
-
_n_ = _n_<sup>
|
19
|
-
_n_<sup>
|
20
|
-
_n_<sup>
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
200, find ![∑](/home/will/src/euler-manager/config/../data/images/symbol_sum.gif)
|
25
|
-
m(_k_).\n\n"
|
6
|
+
![×]({{ images_dir }}/symbol_times.gif) _n_ ![×]({{ images_dir }}/symbol_times.gif)
|
7
|
+
... ![×]({{ images_dir }}/symbol_times.gif) _n_ = _n_<sup>15</sup>\n\nBut using
|
8
|
+
a \"binary\" method you can compute it in six multiplications:\n\n_n_ ![×]({{ images_dir
|
9
|
+
}}/symbol_times.gif) _n_ = _n_<sup>2</sup> \n_n_<sup>2</sup> ![×]({{ images_dir
|
10
|
+
}}/symbol_times.gif) _n_<sup>2</sup> = _n_<sup>4</sup> \n_n_<sup>4</sup> ![×]({{
|
11
|
+
images_dir }}/symbol_times.gif) _n_<sup>4</sup> = _n_<sup>8</sup> \n_n_<sup>8</sup>
|
12
|
+
![×]({{ images_dir }}/symbol_times.gif) _n_<sup>4</sup> = _n_<sup>12</sup> \n_n_<sup>12</sup>
|
13
|
+
![×]({{ images_dir }}/symbol_times.gif) _n_<sup>2</sup> = _n_<sup>14</sup> \n_n_<sup>14</sup>
|
14
|
+
![×]({{ images_dir }}/symbol_times.gif) _n_ = _n_<sup>15</sup>\n\nHowever it is
|
15
|
+
yet possible to compute it in only five multiplications:\n\n_n_ ![×]({{ images_dir
|
16
|
+
}}/symbol_times.gif) _n_ = _n_<sup>2</sup> \n_n_<sup>2</sup> ![×]({{ images_dir
|
17
|
+
}}/symbol_times.gif) _n_ = _n_<sup>3</sup> \n_n_<sup>3</sup> ![×]({{ images_dir
|
18
|
+
}}/symbol_times.gif) _n_<sup>3</sup> = _n_<sup>6</sup> \n_n_<sup>6</sup> ![×]({{
|
19
|
+
images_dir }}/symbol_times.gif) _n_<sup>6</sup> = _n_<sup>12</sup> \n_n_<sup>12</sup>
|
20
|
+
![×]({{ images_dir }}/symbol_times.gif) _n_<sup>3</sup> = _n_<sup>15</sup>\n\nWe
|
21
|
+
shall define m(_k_) to be the minimum number of multiplications to compute _n_<sup><i>k</i></sup>;
|
22
|
+
for example m(15) = 5.\n\nFor 1 ![≤]({{ images_dir }}/symbol_le.gif) _k_ ![≤]({{
|
23
|
+
images_dir }}/symbol_le.gif) 200, find ![∑]({{ images_dir }}/symbol_sum.gif) m(_k_).\n\n"
|
data/data/problems/123.yml
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
:name: Prime square remainders
|
4
4
|
:url: http://projecteuler.net/problem=123
|
5
5
|
:content: |+
|
6
|
-
Let _p_<sub>n</sub> be the _n_th prime: 2, 3, 5, 7, 11, ..., and let _r_ be the remainder when (_p_<sub>n</sub> ![−](/
|
6
|
+
Let _p_<sub>n</sub> be the _n_th prime: 2, 3, 5, 7, 11, ..., and let _r_ be the remainder when (_p_<sub>n</sub> ![−]({{ images_dir }}/symbol_minus.gif)1)<sup><i>n</i></sup> + (_p_<sub>n</sub>+1)<sup><i>n</i></sup> is divided by _p_<sub>n</sub><sup>2</sup>.
|
7
7
|
|
8
|
-
For example, when _n_ = 3, _p_<sub>3</sub> = 5, and 4<sup>3</sup> + 6<sup>3</sup> = 280 ![≡](/
|
8
|
+
For example, when _n_ = 3, _p_<sub>3</sub> = 5, and 4<sup>3</sup> + 6<sup>3</sup> = 280 ![≡]({{ images_dir }}/symbol_cong.gif) 5 mod 25.
|
9
9
|
|
10
10
|
The least value of _n_ for which the remainder first exceeds 10<sup>9</sup> is 7037.
|
11
11
|
|
data/data/problems/124.yml
CHANGED
@@ -3,26 +3,21 @@
|
|
3
3
|
:name: Ordered radicals
|
4
4
|
:url: http://projecteuler.net/problem=124
|
5
5
|
:content: "The radical of _n_, rad(_n_), is the product of the distinct prime factors
|
6
|
-
of _n_. For example, 504 = 2<sup>3</sup> ![×](/
|
7
|
-
3<sup>2</sup> ![×](/
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
\ \n**_n_**\n | \n ![](/
|
15
|
-
\ \n**
|
16
|
-
|
17
|
-
| \n
|
18
|
-
| \n
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
\n7\n | \n7\n | \n9\n |\n| \n10\n | \n10\n | | \n10\n | \n10\n | \n10\n |\n\nLet
|
25
|
-
E(_k_) be the _k_th element in the sorted _n_ column; for example, E(4) = 8 and
|
26
|
-
E(6) = 9.\n\nIf rad(_n_) is sorted for 1 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
|
27
|
-
_n_ ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) 100000,
|
28
|
-
find E(10000).\n\n"
|
6
|
+
of _n_. For example, 504 = 2<sup>3</sup> ![×]({{ images_dir }}/symbol_times.gif)
|
7
|
+
3<sup>2</sup> ![×]({{ images_dir }}/symbol_times.gif) 7, so rad(504) = 2 ![×]({{
|
8
|
+
images_dir }}/symbol_times.gif) 3 ![×]({{ images_dir }}/symbol_times.gif) 7 = 42.\n\nIf
|
9
|
+
we calculate rad(_n_) for _1_ ![≤]({{ images_dir }}/symbol_le.gif) _n_ ![≤]({{ images_dir
|
10
|
+
}}/symbol_le.gif) 10, then sort them on rad(_n_), and sorting on _n_ if the radical
|
11
|
+
values are equal, we get:\n\n| \n**Unsorted**\n | | \n**Sorted**\n |\n| \n ![]({{
|
12
|
+
images_dir }}/spacer.gif) \n**_n_**\n | \n ![]({{ images_dir }}/spacer.gif) \n**rad(_n_)**\n
|
13
|
+
| ![]({{ images_dir }}/spacer.gif) \n | \n ![]({{ images_dir }}/spacer.gif) \n**_n_**\n
|
14
|
+
| \n ![]({{ images_dir }}/spacer.gif) \n**rad(_n_)**\n | \n ![]({{ images_dir }}/spacer.gif)
|
15
|
+
\ \n**k**\n |\n| \n1\n | \n1\n | | \n1\n | \n1\n | \n1\n |\n| \n2\n | \n2\n |
|
16
|
+
| \n2\n | \n2\n | \n2\n |\n| \n3\n | \n3\n | | \n4\n | \n2\n | \n3\n |\n| \n4\n
|
17
|
+
| \n2\n | | \n8\n | \n2\n | \n4\n |\n| \n5\n | \n5\n | | \n3\n | \n3\n | \n5\n
|
18
|
+
|\n| \n6\n | \n6\n | | \n9\n | \n3\n | \n6\n |\n| \n7\n | \n7\n | | \n5\n |
|
19
|
+
\n5\n | \n7\n |\n| \n8\n | \n2\n | | \n6\n | \n6\n | \n8\n |\n| \n9\n | \n3\n
|
20
|
+
| | \n7\n | \n7\n | \n9\n |\n| \n10\n | \n10\n | | \n10\n | \n10\n | \n10\n
|
21
|
+
|\n\nLet E(_k_) be the _k_th element in the sorted _n_ column; for example, E(4)
|
22
|
+
= 8 and E(6) = 9.\n\nIf rad(_n_) is sorted for 1 ![≤]({{ images_dir }}/symbol_le.gif)
|
23
|
+
_n_ ![≤]({{ images_dir }}/symbol_le.gif) 100000, find E(10000).\n\n"
|
data/data/problems/126.yml
CHANGED
@@ -3,14 +3,13 @@
|
|
3
3
|
:name: Cuboid layers
|
4
4
|
:url: http://projecteuler.net/problem=126
|
5
5
|
:content: "The minimum number of cubes to cover every visible face on a cuboid measuring
|
6
|
-
3 x 2 x 1 is twenty-two.\n\n ![](/
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
1000.\n\n"
|
6
|
+
3 x 2 x 1 is twenty-two.\n\n ![]({{ images_dir }}/p_126.gif) \n\nIf we then add
|
7
|
+
a second layer to this solid it would require forty-six cubes to cover every visible
|
8
|
+
face, the third layer would require seventy-eight cubes, and the fourth layer would
|
9
|
+
require one-hundred and eighteen cubes to cover every visible face.\n\nHowever,
|
10
|
+
the first layer on a cuboid measuring 5 x 1 x 1 also requires twenty-two cubes;
|
11
|
+
similarly the first layer on cuboids measuring 5 x 3 x 1, 7 x 2 x 1, and 11 x 1 x 1
|
12
|
+
all contain forty-six cubes.\n\nWe shall define C(_n_) to represent the number of
|
13
|
+
cuboids that contain _n_ cubes in one of its layers. So C(22) = 2, C(46) = 4, C(78)
|
14
|
+
= 5, and C(118) = 8.\n\nIt turns out that 154 is the least value of _n_ for which
|
15
|
+
C(_n_) = 10.\n\nFind the least value of _n_ for which C(_n_) = 1000.\n\n"
|
data/data/problems/127.yml
CHANGED
@@ -3,23 +3,23 @@
|
|
3
3
|
:name: abc-hits
|
4
4
|
:url: http://projecteuler.net/problem=127
|
5
5
|
:content: |+
|
6
|
-
The radical of _n_, rad(_n_), is the product of distinct prime factors of _n_. For example, 504 = 2<sup>3</sup> ![×](/
|
6
|
+
The radical of _n_, rad(_n_), is the product of distinct prime factors of _n_. For example, 504 = 2<sup>3</sup> ![×]({{ images_dir }}/symbol_times.gif) 3<sup>2</sup> ![×]({{ images_dir }}/symbol_times.gif) 7, so rad(504) = 2 ![×]({{ images_dir }}/symbol_times.gif) 3 ![×]({{ images_dir }}/symbol_times.gif) 7 = 42.
|
7
7
|
|
8
8
|
We shall define the triplet of positive integers (_a_, _b_, _c_) to be an abc-hit if:
|
9
9
|
|
10
10
|
1. GCD(_a,_ _b_) = GCD(_a_, _c_) = GCD(_b_, _c_) = 1
|
11
|
-
2. _a_ ![<](/
|
11
|
+
2. _a_ ![<]({{ images_dir }}/symbol_lt.gif) _b_
|
12
12
|
3. _a_ + _b_ = _c_
|
13
|
-
4. rad(_abc_) ![<](/
|
13
|
+
4. rad(_abc_) ![<]({{ images_dir }}/symbol_lt.gif) _c_
|
14
14
|
|
15
15
|
For example, (5, 27, 32) is an abc-hit, because:
|
16
16
|
|
17
17
|
1. GCD(5, 27) = GCD(5, 32) = GCD(27, 32) = 1
|
18
|
-
2. 5 ![<](/
|
18
|
+
2. 5 ![<]({{ images_dir }}/symbol_lt.gif) 27
|
19
19
|
3. 5 + 27 = 32
|
20
|
-
4. rad(4320) = 30 ![<](/
|
20
|
+
4. rad(4320) = 30 ![<]({{ images_dir }}/symbol_lt.gif) 32
|
21
21
|
|
22
|
-
It turns out that abc-hits are quite rare and there are only thirty-one abc-hits for _c_ ![<](/
|
22
|
+
It turns out that abc-hits are quite rare and there are only thirty-one abc-hits for _c_ ![<]({{ images_dir }}/symbol_lt.gif) 1000, with ![∑]({{ images_dir }}/symbol_sum.gif)_c_ = 12523.
|
23
23
|
|
24
|
-
Find ![∑](/
|
24
|
+
Find ![∑]({{ images_dir }}/symbol_sum.gif)_c_ for _c_ ![<]({{ images_dir }}/symbol_lt.gif) 120000.
|
25
25
|
|
data/data/problems/128.yml
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
New rings are added in the same fashion, with the next rings being numbered 8 to 19, 20 to 37, 38 to 61, and so on. The diagram below shows the first three rings.
|
9
9
|
|
10
|
-
![](/
|
10
|
+
![]({{ images_dir }}/p_128.gif)
|
11
11
|
|
12
12
|
By finding the difference between tile _n_ and each its six neighbours we shall define PD(_n_) to be the number of those differences which are prime.
|
13
13
|
|
data/data/problems/130.yml
CHANGED
@@ -7,10 +7,9 @@
|
|
7
7
|
_n_ is a positive integer and GCD(_n_, 10) = 1, it can be shown that there always
|
8
8
|
exists a value, _k_, for which R(_k_) is divisible by _n_, and let A(_n_) be the
|
9
9
|
least such value of _k_; for example, A(7) = 6 and A(41) = 5.\n\nYou are given that
|
10
|
-
for all primes, _p_ ![>](/
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
1 is divisible by A(_n_).\n\n"
|
10
|
+
for all primes, _p_ ![>]({{ images_dir }}/symbol_gt.gif) 5, that _p_ ![−]({{ images_dir
|
11
|
+
}}/symbol_minus.gif) 1 is divisible by A(_p_). For example, when _p_ = 41, A(41)
|
12
|
+
= 5, and 40 is divisible by 5.\n\nHowever, there are rare composite values for which
|
13
|
+
this is also true; the first five examples being 91, 259, 451, 481, and 703.\n\nFind
|
14
|
+
the sum of the first twenty-five composite values of _n_ for which \nGCD(_n_, 10)
|
15
|
+
= 1 and _n_ ![−]({{ images_dir }}/symbol_minus.gif) 1 is divisible by A(_n_).\n\n"
|
data/data/problems/131.yml
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
:content: |+
|
6
6
|
There are some prime values, _p_, for which there exists a positive integer, _n_, such that the expression _n_<sup>3</sup> + _n_<sup>2</sup>_p_ is a perfect cube.
|
7
7
|
|
8
|
-
For example, when _p_ = 19, 8<sup>3</sup> + 8<sup>2</sup> ![×](/
|
8
|
+
For example, when _p_ = 19, 8<sup>3</sup> + 8<sup>2</sup> ![×]({{ images_dir }}/symbol_times.gif)19 = 12<sup>3</sup>.
|
9
9
|
|
10
10
|
What is perhaps most surprising is that for each prime with this property the value of _n_ is unique, and there are only four such primes below one-hundred.
|
11
11
|
|
data/data/problems/132.yml
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
:content: |+
|
6
6
|
A number consisting entirely of ones is called a repunit. We shall define R(_k_) to be a repunit of length _k_.
|
7
7
|
|
8
|
-
For example, R(10) = 1111111111 = 11 ![×](/
|
8
|
+
For example, R(10) = 1111111111 = 11 ![×]({{ images_dir }}/symbol_times.gif)41 ![×]({{ images_dir }}/symbol_times.gif)271 ![×]({{ images_dir }}/symbol_times.gif)9091, and the sum of these prime factors is 9414.
|
9
9
|
|
10
10
|
Find the sum of the first forty prime factors of R(10<sup>9</sup>).
|
11
11
|
|
data/data/problems/134.yml
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
:content: |+
|
6
6
|
Consider the consecutive primes _p_<sub>1</sub> = 19 and _p_<sub>2</sub> = 23. It can be verified that 1219 is the smallest number such that the last digits are formed by _p_<sub>1</sub> whilst also being divisible by _p_<sub>2</sub>.
|
7
7
|
|
8
|
-
In fact, with the exception of _p_<sub>1</sub> = 3 and _p_<sub>2</sub> = 5, for every pair of consecutive primes, _p_<sub>2</sub> ![>](/
|
8
|
+
In fact, with the exception of _p_<sub>1</sub> = 3 and _p_<sub>2</sub> = 5, for every pair of consecutive primes, _p_<sub>2</sub> ![>]({{ images_dir }}/symbol_gt.gif) _p_<sub>1</sub>, there exist values of _n_ for which the last digits are formed by _p_<sub>1</sub> and _n_ is divisible by _p_<sub>2</sub>. Let _S_ be the smallest of these values of _n_.
|
9
9
|
|
10
|
-
Find ![∑](/
|
10
|
+
Find ![∑]({{ images_dir }}/symbol_sum.gif) _S_ for every pair of consecutive primes with 5 ![≤]({{ images_dir }}/symbol_le.gif) _p_<sub>1</sub> ![≤]({{ images_dir }}/symbol_le.gif) 1000000.
|
11
11
|
|
data/data/problems/135.yml
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
:name: Same differences
|
4
4
|
:url: http://projecteuler.net/problem=135
|
5
5
|
:content: |+
|
6
|
-
Given the positive integers, _x_, _y_, and _z_, are consecutive terms of an arithmetic progression, the least value of the positive integer, _n_, for which the equation, _x_<sup>2</sup> ![−](/
|
6
|
+
Given the positive integers, _x_, _y_, and _z_, are consecutive terms of an arithmetic progression, the least value of the positive integer, _n_, for which the equation, _x_<sup>2</sup> ![−]({{ images_dir }}/symbol_minus.gif) _y_<sup>2</sup> ![−]({{ images_dir }}/symbol_minus.gif) _z_<sup>2</sup> = _n_, has exactly two solutions is _n_ = 27:
|
7
7
|
|
8
|
-
34<sup>2</sup> ![−](/
|
8
|
+
34<sup>2</sup> ![−]({{ images_dir }}/symbol_minus.gif) 27<sup>2</sup> ![−]({{ images_dir }}/symbol_minus.gif) 20<sup>2</sup> = 12<sup>2</sup> ![−]({{ images_dir }}/symbol_minus.gif) 9<sup>2</sup> ![−]({{ images_dir }}/symbol_minus.gif) 6<sup>2</sup> = 27
|
9
9
|
|
10
10
|
It turns out that _n_ = 1155 is the least value which has exactly ten solutions.
|
11
11
|
|
data/data/problems/136.yml
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
:name: Singleton difference
|
4
4
|
:url: http://projecteuler.net/problem=136
|
5
5
|
:content: |+
|
6
|
-
The positive integers, _x_, _y_, and _z_, are consecutive terms of an arithmetic progression. Given that _n_ is a positive integer, the equation, _x_<sup>2</sup> ![−](/
|
6
|
+
The positive integers, _x_, _y_, and _z_, are consecutive terms of an arithmetic progression. Given that _n_ is a positive integer, the equation, _x_<sup>2</sup> ![−]({{ images_dir }}/symbol_minus.gif) _y_<sup>2</sup> ![−]({{ images_dir }}/symbol_minus.gif) _z_<sup>2</sup> = _n_, has exactly one solution when _n_ = 20:
|
7
7
|
|
8
|
-
13<sup>2</sup> ![−](/
|
8
|
+
13<sup>2</sup> ![−]({{ images_dir }}/symbol_minus.gif) 10<sup>2</sup> ![−]({{ images_dir }}/symbol_minus.gif) 7<sup>2</sup> = 20
|
9
9
|
|
10
10
|
In fact there are twenty-five values of _n_ below one hundred for which the equation has a unique solution.
|
11
11
|
|
data/data/problems/137.yml
CHANGED
@@ -14,11 +14,11 @@
|
|
14
14
|
The corresponding values of _x_ for the first five natural numbers are shown below.
|
15
15
|
|
16
16
|
| **_x_** | **A<sub>F</sub>(_x_)** |
|
17
|
-
| ![√](/
|
17
|
+
| ![√]({{ images_dir }}/symbol_radic.gif)2 ![−]({{ images_dir }}/symbol_minus.gif)1 | 1 |
|
18
18
|
| 1/2 | 2 |
|
19
|
-
| ( ![√](/
|
20
|
-
| ( ![√](/
|
21
|
-
| ( ![√](/
|
19
|
+
| ( ![√]({{ images_dir }}/symbol_radic.gif)13 ![−]({{ images_dir }}/symbol_minus.gif)2)/3 | 3 |
|
20
|
+
| ( ![√]({{ images_dir }}/symbol_radic.gif)89 ![−]({{ images_dir }}/symbol_minus.gif)5)/8 | 4 |
|
21
|
+
| ( ![√]({{ images_dir }}/symbol_radic.gif)34 ![−]({{ images_dir }}/symbol_minus.gif)3)/5 | 5 |
|
22
22
|
|
23
23
|
We shall call A<sub>F</sub>(_x_) a golden nugget if _x_ is rational, because they become increasingly rarer; for example, the 10th golden nugget is 74049690.
|
24
24
|
|
data/data/problems/138.yml
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
:content: |+
|
6
6
|
Consider the isosceles triangle with base length, _b_ = 16, and legs, L = 17.
|
7
7
|
|
8
|
-
![](/
|
8
|
+
![]({{ images_dir }}/p_138.gif)
|
9
9
|
|
10
|
-
By using the Pythagorean theorem it can be seen that the height of the triangle, _h_ = ![√](/
|
10
|
+
By using the Pythagorean theorem it can be seen that the height of the triangle, _h_ = ![√]({{ images_dir }}/symbol_radic.gif)(17<sup>2</sup> ![−]({{ images_dir }}/symbol_minus.gif) 8<sup>2</sup>) = 15, which is one less than the base length.
|
11
11
|
|
12
|
-
With _b_ = 272 and L = 305, we get _h_ = 273, which is one more than the base length, and this is the second smallest isosceles triangle with the property that _h_ = _b_ ![±](/
|
12
|
+
With _b_ = 272 and L = 305, we get _h_ = 273, which is one more than the base length, and this is the second smallest isosceles triangle with the property that _h_ = _b_ ![±]({{ images_dir }}/symbol_plusmn.gif) 1.
|
13
13
|
|
14
|
-
Find ![∑](/
|
14
|
+
Find ![∑]({{ images_dir }}/symbol_sum.gif) L for the twelve smallest isosceles triangles for which _h_ = _b_ ![±]({{ images_dir }}/symbol_plusmn.gif) 1 and _b_, L are positive integers.
|
15
15
|
|
data/data/problems/139.yml
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
For example, (3, 4, 5) triangles can be placed together to form a 5 by 5 square with a 1 by 1 hole in the middle and it can be seen that the 5 by 5 square can be tiled with twenty-five 1 by 1 squares.
|
9
9
|
|
10
|
-
![](/
|
10
|
+
![]({{ images_dir }}/p_139.gif)
|
11
11
|
|
12
12
|
However, if (5, 12, 13) triangles were used then the hole would measure 7 by 7 and these could not be used to tile the 13 by 13 square.
|
13
13
|
|
data/data/problems/14.yml
CHANGED
@@ -3,16 +3,15 @@
|
|
3
3
|
:name: Longest Collatz sequence
|
4
4
|
:url: http://projecteuler.net/problem=14
|
5
5
|
:content: "The following iterative sequence is defined for the set of positive integers:\n\n<var>n</var>
|
6
|
-
![→](/
|
7
|
-
(<var>n</var>
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
the
|
18
|
-
above one million.\n\n"
|
6
|
+
![→]({{ images_dir }}/symbol_maps.gif) <var>n</var>/2 (<var>n</var> is even) \n<var>n</var>
|
7
|
+
![→]({{ images_dir }}/symbol_maps.gif) 3<var>n</var> + 1 (<var>n</var> is odd)\n\nUsing
|
8
|
+
the rule above and starting with 13, we generate the following sequence:\n\n13 ![→]({{
|
9
|
+
images_dir }}/symbol_maps.gif) 40 ![→]({{ images_dir }}/symbol_maps.gif) 20 ![→]({{
|
10
|
+
images_dir }}/symbol_maps.gif) 10 ![→]({{ images_dir }}/symbol_maps.gif) 5 ![→]({{
|
11
|
+
images_dir }}/symbol_maps.gif) 16 ![→]({{ images_dir }}/symbol_maps.gif) 8 ![→]({{
|
12
|
+
images_dir }}/symbol_maps.gif) 4 ![→]({{ images_dir }}/symbol_maps.gif) 2 ![→]({{
|
13
|
+
images_dir }}/symbol_maps.gif) 1\n\nIt can be seen that this sequence (starting
|
14
|
+
at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet
|
15
|
+
(Collatz Problem), it is thought that all starting numbers finish at 1.\n\nWhich
|
16
|
+
starting number, under one million, produces the longest chain?\n\n**NOTE:** Once
|
17
|
+
the chain starts the terms are allowed to go above one million.\n\n"
|
data/data/problems/140.yml
CHANGED
@@ -10,10 +10,10 @@
|
|
10
10
|
The corresponding values of _x_ for the first five natural numbers are shown below.
|
11
11
|
|
12
12
|
| **_x_** | **A<sub>G</sub>(_x_)** |
|
13
|
-
| ( ![√](/
|
13
|
+
| ( ![√]({{ images_dir }}/symbol_radic.gif)5 ![−]({{ images_dir }}/symbol_minus.gif)1)/4 | 1 |
|
14
14
|
| 2/5 | 2 |
|
15
|
-
| ( ![√](/
|
16
|
-
| ( ![√](/
|
15
|
+
| ( ![√]({{ images_dir }}/symbol_radic.gif)22 ![−]({{ images_dir }}/symbol_minus.gif)2)/6 | 3 |
|
16
|
+
| ( ![√]({{ images_dir }}/symbol_radic.gif)137 ![−]({{ images_dir }}/symbol_minus.gif)5)/14 | 4 |
|
17
17
|
| 1/2 | 5 |
|
18
18
|
|
19
19
|
We shall call A<sub>G</sub>(_x_) a golden nugget if _x_ is rational, because they become increasingly rarer; for example, the 20th golden nugget is 211345365.
|
data/data/problems/142.yml
CHANGED
@@ -3,5 +3,5 @@
|
|
3
3
|
:name: Perfect Square Collection
|
4
4
|
:url: http://projecteuler.net/problem=142
|
5
5
|
:content: |+
|
6
|
-
Find the smallest x + y + z with integers x ![>](/
|
6
|
+
Find the smallest x + y + z with integers x ![>]({{ images_dir }}/symbol_gt.gif) y ![>]({{ images_dir }}/symbol_gt.gif) z ![>]({{ images_dir }}/symbol_gt.gif) 0 such that x + y, x ![−]({{ images_dir }}/symbol_minus.gif) y, x + z, x ![−]({{ images_dir }}/symbol_minus.gif) z, y + z, y ![−]({{ images_dir }}/symbol_minus.gif) z are all perfect squares.
|
7
7
|
|
data/data/problems/143.yml
CHANGED
@@ -9,9 +9,9 @@
|
|
9
9
|
|
10
10
|
Torricelli was able to prove that if equilateral triangles AOB, BNC and AMC are constructed on each side of triangle ABC, the circumscribed circles of AOB, BNC, and AMC will intersect at a single point, T, inside the triangle. Moreover he proved that T, called the Torricelli/Fermat point, minimises p + q + r. Even more remarkable, it can be shown that when the sum is minimised, AN = BM = CO = p + q + r and that AN, BM and CO also intersect at T.
|
11
11
|
|
12
|
-
![](/
|
12
|
+
![]({{ images_dir }}/p_143_torricelli.gif)
|
13
13
|
|
14
14
|
If the sum is minimised and a, b, c, p, q and r are all positive integers we shall call triangle ABC a Torricelli triangle. For example, a = 399, b = 455, c = 511 is an example of a Torricelli triangle, with p + q + r = 784.
|
15
15
|
|
16
|
-
Find the sum of all distinct values of p + q + r ![≤](/
|
16
|
+
Find the sum of all distinct values of p + q + r ![≤]({{ images_dir }}/symbol_le.gif) 120000 for Torricelli triangles.
|
17
17
|
|
data/data/problems/144.yml
CHANGED
@@ -7,9 +7,9 @@
|
|
7
7
|
|
8
8
|
The specific white cell we will be considering is an ellipse with the equation 4_x_<sup>2</sup> + _y_<sup>2</sup> = 100
|
9
9
|
|
10
|
-
The section corresponding to ![−](/
|
10
|
+
The section corresponding to ![−]({{ images_dir }}/symbol_minus.gif)0.01 ![≤]({{ images_dir }}/symbol_le.gif) _x_ ![≤]({{ images_dir }}/symbol_le.gif) +0.01 at the top is missing, allowing the light to enter and exit through the hole.
|
11
11
|
|
12
|
-
![](/
|
12
|
+
![]({{ images_dir }}/p_144_1.gif) ![]({{ images_dir }}/p_144_2.gif)
|
13
13
|
|
14
14
|
The light beam in this problem starts at the point (0.0,10.1) just outside the white cell, and the beam first impacts the mirror at (1.4,-9.6).
|
15
15
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
|
18
18
|
In the figure on the left, the red line shows the first two points of contact between the laser beam and the wall of the white cell; the blue line shows the line tangent to the ellipse at the point of incidence of the first bounce.
|
19
19
|
|
20
|
-
The slope _m_ of the tangent line at any point (_x_,_y_) of the given ellipse is: _m_ = ![−](/
|
20
|
+
The slope _m_ of the tangent line at any point (_x_,_y_) of the given ellipse is: _m_ = ![−]({{ images_dir }}/symbol_minus.gif)4_x_/_y_
|
21
21
|
|
22
22
|
The normal line is perpendicular to this tangent line at the point of incidence.
|
23
23
|
|
data/data/problems/147.yml
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
:name: Rectangles in cross-hatched grids
|
4
4
|
:url: http://projecteuler.net/problem=147
|
5
5
|
:content: "In a 3x2 cross-hatched grid, a total of 37 different rectangles could be
|
6
|
-
situated within that grid as indicated in the sketch.\n\n ![](/
|
6
|
+
situated within that grid as indicated in the sketch.\n\n ![]({{ images_dir }}/p_147.gif)\n\nThere
|
7
7
|
are 5 grids smaller than 3x2, vertical and horizontal dimensions being important,
|
8
8
|
i.e. 1x1, 2x1, 3x1, 1x2 and 2x2. If each of them is cross-hatched, the following
|
9
9
|
number of different rectangles could be situated within those smaller grids:\n\n1x1:
|
data/data/problems/149.yml
CHANGED
@@ -13,19 +13,17 @@
|
|
13
13
|
width=\"9\" height=\"3\" alt=\"−\" border=\"0\" style=\"vertical-align:middle;\">4</td>\n<td>
|
14
14
|
8</td>\n</tr>\n</tbody>\n\nNow, let us repeat the search, but on a much larger scale:\n\nFirst,
|
15
15
|
generate four million pseudo-random numbers using a specific form of what is known
|
16
|
-
as a \"Lagged Fibonacci Generator\":\n\nFor 1 ![≤](/
|
17
|
-
_k_ ![≤](/
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
width=\"9\" height=\"3\" alt=\"−\" border=\"0\" style=\"vertical-align:middle;\">
|
24
|
-
+
|
25
|
-
|
26
|
-
|
27
|
-
500000.\n\nThus, _s_<sub>10</sub> = ![−](/home/will/src/euler-manager/config/../data/images/symbol_minus.gif)393027
|
28
|
-
and _s_<sub>100</sub> = 86613.\n\nThe terms of _s_ are then arranged in a 2000 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)2000
|
16
|
+
as a \"Lagged Fibonacci Generator\":\n\nFor 1 ![≤]({{ images_dir }}/symbol_le.gif)
|
17
|
+
_k_ ![≤]({{ images_dir }}/symbol_le.gif) 55, _s_<sub><i>k</i></sub> = [100003 ![−]({{
|
18
|
+
images_dir }}/symbol_minus.gif) 200003_k_ + 300007_k_<sup>3</sup>] (modulo 1000000)
|
19
|
+
![−]({{ images_dir }}/symbol_minus.gif) 500000. \n\rFor 56 ![≤]({{ images_dir }}/symbol_le.gif)
|
20
|
+
_k_ ![≤]({{ images_dir }}/symbol_le.gif) 4000000, _s_<sub><i>k</i></sub> = [_s_<sub><i>k<img
|
21
|
+
src=\"%7B%7B%20images_dir%20%7D%7D/symbol_minus.gif\" width=\"9\" height=\"3\" alt=\"−\"
|
22
|
+
border=\"0\" style=\"vertical-align:middle;\">24</i></sub> + _s_<sub><i>k<img src=\"%7B%7B%20images_dir%20%7D%7D/symbol_minus.gif\"
|
23
|
+
width=\"9\" height=\"3\" alt=\"−\" border=\"0\" style=\"vertical-align:middle;\">55</i></sub>
|
24
|
+
+ 1000000] (modulo 1000000) ![−]({{ images_dir }}/symbol_minus.gif) 500000.\n\nThus,
|
25
|
+
_s_<sub>10</sub> = ![−]({{ images_dir }}/symbol_minus.gif)393027 and _s_<sub>100</sub>
|
26
|
+
= 86613.\n\nThe terms of _s_ are then arranged in a 2000 ![×]({{ images_dir }}/symbol_times.gif)2000
|
29
27
|
table, using the first 2000 numbers to fill the first row (sequentially), the next
|
30
28
|
2000 numbers to fill the second row, and so on.\n\nFinally, find the greatest sum
|
31
29
|
of (any number of) adjacent entries in any direction (horizontal, vertical, diagonal
|
data/data/problems/15.yml
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
:name: Lattice paths
|
4
4
|
:url: http://projecteuler.net/problem=15
|
5
5
|
:content: |+
|
6
|
-
Starting in the top left corner of a 2 ![×](/
|
6
|
+
Starting in the top left corner of a 2 ![×]({{ images_dir }}/symbol_times.gif)2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner.
|
7
7
|
|
8
|
-
![](/
|
8
|
+
![]({{ images_dir }}/p_015.gif)
|
9
9
|
|
10
|
-
How many such routes are there through a 20 ![×](/
|
10
|
+
How many such routes are there through a 20 ![×]({{ images_dir }}/symbol_times.gif)20 grid?
|
11
11
|
|