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/186.yml
CHANGED
@@ -7,14 +7,13 @@
|
|
7
7
|
| 600863 | 701497 |\n| ... | ... | ... |\n\nThe telephone number of the caller and
|
8
8
|
the called number in record n are Caller(n) = S<sub>2n-1</sub> and Called(n) = S<sub>2n</sub>
|
9
9
|
where S<sub>1,2,3,...</sub> come from the \"Lagged Fibonacci Generator\":\n\nFor
|
10
|
-
1 ![≤](/
|
11
|
-
|
12
|
-
56 ![≤](/
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
friend etc., of the Prime Minister?\n\n"
|
10
|
+
1 ![≤]({{ images_dir }}/symbol_le.gif) k ![≤]({{ images_dir }}/symbol_le.gif) 55,
|
11
|
+
S<sub>k</sub> = [100003 - 200003k + 300007k<sup>3</sup>] (modulo 1000000) \n\rFor
|
12
|
+
56 ![≤]({{ images_dir }}/symbol_le.gif) k, S<sub>k</sub> = [S<sub>k-24</sub> + S<sub>k-55</sub>]
|
13
|
+
(modulo 1000000)\n\nIf Caller(n) = Called(n) then the user is assumed to have misdialled
|
14
|
+
and the call fails; otherwise the call is successful.\n\nFrom the start of the records,
|
15
|
+
we say that any pair of users X and Y are friends if X calls Y or vice-versa. Similarly,
|
16
|
+
X is a friend of a friend of Z if X is a friend of Y and Y is a friend of Z; and
|
17
|
+
so on for longer chains.\n\nThe Prime Minister's phone number is 524287. After how
|
18
|
+
many successful calls, not counting misdials, will 99% of the users (including the
|
19
|
+
PM) be a friend, or a friend of a friend etc., of the Prime Minister?\n\n"
|
data/data/problems/187.yml
CHANGED
@@ -3,11 +3,9 @@
|
|
3
3
|
:name: Semiprimes
|
4
4
|
:url: http://projecteuler.net/problem=187
|
5
5
|
:content: "A composite is a number containing at least two prime factors. For example,
|
6
|
-
15 = 3 ![×](/
|
7
|
-
|
8
|
-
3
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
<var>n</var> ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)
|
13
|
-
10<sup>8</sup>, have precisely two, not necessarily distinct, prime factors?\n\n"
|
6
|
+
15 = 3 ![×]({{ images_dir }}/symbol_times.gif) 5; 9 = 3 ![×]({{ images_dir }}/symbol_times.gif)
|
7
|
+
3; 12 = 2 ![×]({{ images_dir }}/symbol_times.gif) 2 ![×]({{ images_dir }}/symbol_times.gif)
|
8
|
+
3.\n\nThere are ten composites below thirty containing precisely two, not necessarily
|
9
|
+
distinct, prime factors:\r4, 6, 9, 10, 14, 15, 21, 22, 25, 26.\n\nHow many composite
|
10
|
+
integers, <var>n</var> ![<]({{ images_dir }}/symbol_lt.gif) 10<sup>8</sup>, have
|
11
|
+
precisely two, not necessarily distinct, prime factors?\n\n"
|
data/data/problems/189.yml
CHANGED
@@ -2,12 +2,13 @@
|
|
2
2
|
:id: 189
|
3
3
|
:name: Tri-colouring a triangular grid
|
4
4
|
:url: http://projecteuler.net/problem=189
|
5
|
-
:content: "Consider the following configuration of 64 triangles:\n\n ![](
|
6
|
-
wish to colour the interior of each triangle with one of
|
7
|
-
or blue, so that no two neighbouring triangles have the
|
8
|
-
shall be called valid. Here, two triangles are said
|
9
|
-
an edge. \n\rNote: if they only share a vertex,
|
10
|
-
example, here is a valid colouring of the above
|
11
|
-
|
12
|
-
|
13
|
-
are there for the above
|
5
|
+
:content: "Consider the following configuration of 64 triangles:\n\n ![]({{ images_dir
|
6
|
+
}}/p_189_grid.gif)\n\nWe wish to colour the interior of each triangle with one of
|
7
|
+
three colours: red, green or blue, so that no two neighbouring triangles have the
|
8
|
+
same colour. Such a colouring shall be called valid. Here, two triangles are said
|
9
|
+
to be neighbouring if they share an edge. \n\rNote: if they only share a vertex,
|
10
|
+
then they are not neighbours.\n\nFor example, here is a valid colouring of the above
|
11
|
+
grid:\n\n ![]({{ images_dir }}/p_189_colours.gif)\n\nA colouring C' which is obtained
|
12
|
+
from a colouring C by rotation or reflection is considered _distinct_ from C unless
|
13
|
+
the two are identical.\n\nHow many distinct valid colourings are there for the above
|
14
|
+
configuration?\n\n"
|
data/data/problems/190.yml
CHANGED
@@ -7,5 +7,5 @@
|
|
7
7
|
|
8
8
|
For example, it can be verified that [P<sub>10</sub>] = 4112 ([] is the integer part function).
|
9
9
|
|
10
|
-
Find Σ[P<sub>m</sub>] for 2 ![≤](/
|
10
|
+
Find Σ[P<sub>m</sub>] for 2 ![≤]({{ images_dir }}/symbol_le.gif) m ![≤]({{ images_dir }}/symbol_le.gif) 15.
|
11
11
|
|
data/data/problems/192.yml
CHANGED
@@ -4,16 +4,15 @@
|
|
4
4
|
:url: http://projecteuler.net/problem=192
|
5
5
|
:content: "Let <var>x</var> be a real number. \n\rA _best approximation_ to <var>x</var>
|
6
6
|
for the _denominator bound_ <var>d</var> is a rational number <var>r</var>/<var>s</var>
|
7
|
-
_in reduced form_, with <var>s</var> ![≤](/
|
8
|
-
|
9
|
-
|
10
|
-
![<](/
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
for the denominator bound
|
15
|
-
|
16
|
-
best approximations to ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)<var>n</var>
|
7
|
+
_in reduced form_, with <var>s</var> ![≤]({{ images_dir }}/symbol_le.gif) <var>d</var>,
|
8
|
+
such that any rational number which is closer to <var>x</var> than <var>r</var>/<var>s</var>
|
9
|
+
has a denominator larger than <var>d</var>:\n\n|<var>p</var>/<var>q</var>-<var>x</var>|
|
10
|
+
![<]({{ images_dir }}/symbol_lt.gif) |<var>r</var>/<var>s</var>-<var>x</var>| ![⇒]({{
|
11
|
+
images_dir }}/symbol_implies.gif) <var>q</var> ![>]({{ images_dir }}/symbol_gt.gif)
|
12
|
+
<var>d</var>\n\nFor example, the best approximation to ![√]({{ images_dir }}/symbol_radic.gif)13
|
13
|
+
for the denominator bound 20 is 18/5 and the best approximation to ![√]({{ images_dir
|
14
|
+
}}/symbol_radic.gif)13 for the denominator bound 30 is 101/28.\n\nFind the sum of
|
15
|
+
all denominators of the best approximations to ![√]({{ images_dir }}/symbol_radic.gif)<var>n</var>
|
17
16
|
for the denominator bound 10<sup>12</sup>, where <var>n</var> is not a perfect square
|
18
|
-
and 1 ![<](/
|
19
|
-
|
17
|
+
and 1 ![<]({{ images_dir }}/symbol_lt.gif) <var>n</var> ![≤]({{ images_dir }}/symbol_le.gif)
|
18
|
+
100000.\n\n"
|
data/data/problems/194.yml
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
:id: 194
|
3
3
|
:name: Coloured Configurations
|
4
4
|
:url: http://projecteuler.net/problem=194
|
5
|
-
:content: "Consider graphs built with the units A: ![](/
|
6
|
-
B: ![](/
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
:content: "Consider graphs built with the units A: ![]({{ images_dir }}/p_194_GraphA.png)\rand
|
6
|
+
B: ![]({{ images_dir }}/p_194_GraphB.png), where the units are glued along\rthe
|
7
|
+
vertical edges as in the graph ![]({{ images_dir }}/p_194_Fig.png).\n\nA configuration
|
8
|
+
of type (<var>a</var>,<var>b</var>,<var>c</var>) is a graph thus built of <var>a</var>
|
9
|
+
units A and <var>b</var> units B, where the graph's vertices are coloured using
|
10
|
+
up to <var>c</var> colours, so that no two adjacent vertices have the same colour.
|
11
|
+
\ \n\rThe compound graph above is an example of a configuration of type (2,2,6),
|
12
|
+
in fact of type (2,2,<var>c</var>) for all <var>c</var> ![≥]({{ images_dir }}/symbol_ge.gif)
|
13
13
|
4.\n\nLet N(<var>a</var>,<var>b</var>,<var>c</var>) be the number of configurations
|
14
14
|
of type (<var>a</var>,<var>b</var>,<var>c</var>). \n\rFor example, N(1,0,3) = 24,
|
15
15
|
N(0,2,4) = 92928 and N(2,2,3) = 20736.\n\nFind the last 8 digits of N(25,75,1984).\n\n"
|
data/data/problems/195.yml
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
:content: "Let's call an integer sided triangle with exactly one angle of 60 degrees
|
6
6
|
a 60-degree triangle. \n\rLet <var>r</var> be the radius of the inscribed circle
|
7
7
|
of such a 60-degree triangle.\n\nThere are 1234 60-degree triangles for which <var>r</var>
|
8
|
-
![≤](/
|
9
|
-
|
8
|
+
![≤]({{ images_dir }}/symbol_le.gif) 100.\r \nLet T(<var>n</var>) be the number
|
9
|
+
of 60-degree triangles for which <var>r</var> ![≤]({{ images_dir }}/symbol_le.gif)
|
10
10
|
<var>n</var>, so \n\r T(100) = 1234, T(1000) = 22767, and T(10000) = 359912.\n\nFind
|
11
11
|
T(1053779).\n\n"
|
data/data/problems/197.yml
CHANGED
@@ -2,11 +2,10 @@
|
|
2
2
|
:id: 197
|
3
3
|
:name: Investigating the behaviour of a recursively defined sequence
|
4
4
|
:url: http://projecteuler.net/problem=197
|
5
|
-
:content: "Given is the function <var>f</var>(<var>x</var>) = ![⌊](/
|
6
|
-
![⌋](/
|
7
|
-
10<sup>-9</sup> ( ![⌊](/
|
8
|
-
|
9
|
-
|
10
|
-
= -1 and <var>u</var><sub><var>n</var>+1</sub> = <var>f</var>(<var>u<sub>n</sub></var>).\n\nFind
|
5
|
+
:content: "Given is the function <var>f</var>(<var>x</var>) = ![⌊]({{ images_dir }}/symbol_lfloor.gif)2<sup>30.403243784-<var>x</var><sup>2</sup></sup>
|
6
|
+
![⌋]({{ images_dir }}/symbol_rfloor.gif) ![×]({{ images_dir }}/symbol_times.gif)
|
7
|
+
10<sup>-9</sup> ( ![⌊]({{ images_dir }}/symbol_lfloor.gif) ![⌋]({{ images_dir }}/symbol_rfloor.gif)
|
8
|
+
is the floor-function), \n\rthe sequence <var>u<sub>n</sub></var> is defined by
|
9
|
+
<var>u</var><sub>0</sub> = -1 and <var>u</var><sub><var>n</var>+1</sub> = <var>f</var>(<var>u<sub>n</sub></var>).\n\nFind
|
11
10
|
<var>u<sub>n</sub></var> + <var>u</var><sub><var>n</var>+1</sub> for <var>n</var>
|
12
11
|
= 10<sup>12</sup>. \n\rGive your answer with 9 digits after the decimal point.\n\n"
|
data/data/problems/198.yml
CHANGED
@@ -4,15 +4,14 @@
|
|
4
4
|
:url: http://projecteuler.net/problem=198
|
5
5
|
:content: "A best approximation to a real number <var>x</var> for the denominator
|
6
6
|
bound <var>d</var> is a rational number <var>r</var>/<var>s</var> (in reduced form)
|
7
|
-
with <var>s</var> ![≤](/
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
there whose denominator <var>q</var> does not exceed 10<sup>8</sup>?\n\n"
|
7
|
+
with <var>s</var> ![≤]({{ images_dir }}/symbol_le.gif) <var>d</var>, so that any
|
8
|
+
rational number <var>p</var>/<var>q</var> which is closer to <var>x</var> than <var>r</var>/<var>s</var>
|
9
|
+
has <var>q</var> ![>]({{ images_dir }}/symbol_gt.gif) <var>d</var>.\n\nUsually the
|
10
|
+
best approximation to a real number is uniquely determined for all denominator bounds.
|
11
|
+
However, there are some exceptions, e.g. 9/40 has the two best approximations 1/4
|
12
|
+
and 1/5 for the denominator bound 6.\rWe shall call a real number <var>x</var> _ambiguous_,
|
13
|
+
if there is at least one denominator bound for which <var>x</var> possesses two
|
14
|
+
best approximations. Clearly, an ambiguous number is necessarily rational.\n\nHow
|
15
|
+
many ambiguous numbers <var>x</var> = <var>p</var>/<var>q</var>,\r0 ![<]({{ images_dir
|
16
|
+
}}/symbol_lt.gif) <var>x</var> ![<]({{ images_dir }}/symbol_lt.gif) 1/100, are there
|
17
|
+
whose denominator <var>q</var> does not exceed 10<sup>8</sup>?\n\n"
|
data/data/problems/199.yml
CHANGED
@@ -5,10 +5,10 @@
|
|
5
5
|
:content: "Three circles of equal radius are placed inside a larger circle such that
|
6
6
|
each pair of circles is tangent to one another and the inner circles do not overlap.
|
7
7
|
There are four uncovered \"gaps\" which are to be filled iteratively with more tangent
|
8
|
-
circles.\n\n ![](/
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
8
|
+
circles.\n\n ![]({{ images_dir }}/p_199_circles_in_circles.gif)\n\nAt each iteration,
|
9
|
+
a maximally sized circle is placed in each gap, which creates more gaps for the
|
10
|
+
next iteration. After 3 iterations (pictured), there are 108 gaps and the fraction
|
11
|
+
of the area which is not covered by circles is 0.06790342, rounded to eight decimal
|
12
|
+
places.\n\nWhat fraction of the area is not covered by circles after 10 iterations?
|
13
|
+
\ \n\rGive your answer rounded to eight decimal places using the format x.xxxxxxxx
|
14
|
+
.\n\n"
|
data/data/problems/20.yml
CHANGED
@@ -2,13 +2,11 @@
|
|
2
2
|
:id: 20
|
3
3
|
:name: Factorial digit sum
|
4
4
|
:url: http://projecteuler.net/problem=20
|
5
|
-
:content: "_n_! means _n_ ![×](/
|
6
|
-
|
7
|
-
![×](/
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
!
|
12
|
-
|
13
|
-
3628800, \nand the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0
|
14
|
-
+ 0 = 27.\n\nFind the sum of the digits in the number 100!\n\n"
|
5
|
+
:content: "_n_! means _n_ ![×]({{ images_dir }}/symbol_times.gif) (_n_ ![−]({{ images_dir
|
6
|
+
}}/symbol_minus.gif) 1) ![×]({{ images_dir }}/symbol_times.gif) ... ![×]({{ images_dir
|
7
|
+
}}/symbol_times.gif) 3 ![×]({{ images_dir }}/symbol_times.gif) 2 ![×]({{ images_dir
|
8
|
+
}}/symbol_times.gif) 1\n\nFor example, 10! = 10 ![×]({{ images_dir }}/symbol_times.gif)
|
9
|
+
9 ![×]({{ images_dir }}/symbol_times.gif) ... ![×]({{ images_dir }}/symbol_times.gif)
|
10
|
+
3 ![×]({{ images_dir }}/symbol_times.gif) 2 ![×]({{ images_dir }}/symbol_times.gif)
|
11
|
+
1 = 3628800, \nand the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8
|
12
|
+
+ 0 + 0 = 27.\n\nFind the sum of the digits in the number 100!\n\n"
|
data/data/problems/202.yml
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
Label the vertices A, B and C. There are 2 ways in which a laser beam may enter vertex C, bounce off 11 surfaces, then exit through the same vertex: one way is shown below; the other is the reverse of that.
|
9
9
|
|
10
|
-
![](/
|
10
|
+
![]({{ images_dir }}/p_201_laserbeam.gif)
|
11
11
|
|
12
12
|
There are 80840 ways in which a laser beam may enter vertex C, bounce off 1000001 surfaces, then exit through the same vertex.
|
13
13
|
|
data/data/problems/207.yml
CHANGED
@@ -8,10 +8,10 @@
|
|
8
8
|
real number.\n\nThe first two such partitions are 4<sup>1</sup> = 2<sup>1</sup>
|
9
9
|
+ 2 and 4<sup>1.5849625...</sup> = 2<sup>1.5849625...</sup> + 6.\n\nPartitions where
|
10
10
|
<var>t</var> is also an integer are called _perfect_. \n \rFor any <var>m</var>
|
11
|
-
![≥](/
|
12
|
-
|
11
|
+
![≥]({{ images_dir }}/symbol_ge.gif) 1 let P(<var>m</var>) be the proportion of
|
12
|
+
such partitions that are perfect with <var>k</var> ![≤]({{ images_dir }}/symbol_le.gif)
|
13
13
|
<var>m</var>. \n\rThus P(6) = 1/2.\n\nIn the following table are listed some values
|
14
14
|
of P(<var>m</var>)\n\n P(5) = 1/1 \n\r P(10) = 1/2 \n\r P(15) = 2/3 \n\r P(20)
|
15
15
|
= 1/2 \n\r P(25) = 1/2 \n\r P(30) = 2/5 \n\r ... \n\r P(180) = 1/4 \n\r P(185)
|
16
|
-
= 3/13\n\nFind the smallest <var>m</var> for which P(<var>m</var>) ![<](
|
17
|
-
1/12345\n\n"
|
16
|
+
= 3/13\n\nFind the smallest <var>m</var> for which P(<var>m</var>) ![<]({{ images_dir
|
17
|
+
}}/symbol_lt.gif) 1/12345\n\n"
|
data/data/problems/208.yml
CHANGED
@@ -5,8 +5,7 @@
|
|
5
5
|
:content: "A robot moves in a series of one-fifth circular arcs (72°), with a free
|
6
6
|
choice of a clockwise or an anticlockwise arc for each step, but no turning on the
|
7
7
|
spot.\n\nOne of 70932 possible closed paths of 25 arcs starting northward is\n\n
|
8
|
-
![](/
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
multiple times.)\n\n"
|
8
|
+
![]({{ images_dir }}/p_208_robotwalk.gif)\n\nGiven that the robot starts facing
|
9
|
+
North, how many journeys of 70 arcs in length can it take that return it, after
|
10
|
+
the final arc, to its starting position? \n<!--(Journeys are allowed to return
|
11
|
+
multiple times to the start.)-->\r(Any arc may be traversed multiple times.)\n\n"
|
data/data/problems/21.yml
CHANGED
@@ -4,9 +4,8 @@
|
|
4
4
|
:url: http://projecteuler.net/problem=21
|
5
5
|
:content: "Let d(_n_) be defined as the sum of proper divisors of _n_ (numbers less
|
6
6
|
than _n_ which divide evenly into _n_). \n\rIf d(_a_) = _b_ and d(_b_) = _a_, where
|
7
|
-
_a_ ![≠](/
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
under 10000.\n\n"
|
7
|
+
_a_ ![≠]({{ images_dir }}/symbol_ne.gif) _b_, then _a_ and _b_ are an amicable pair
|
8
|
+
and each of _a_ and _b_ are called amicable numbers.\n\nFor example, the proper
|
9
|
+
divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110; therefore d(220)
|
10
|
+
= 284. The proper divisors of 284 are 1, 2, 4, 71 and 142; so d(284) = 220.\n\nEvaluate
|
11
|
+
the sum of all the amicable numbers under 10000.\n\n"
|
data/data/problems/210.yml
CHANGED
@@ -3,8 +3,7 @@
|
|
3
3
|
:name: Obtuse Angled Triangles
|
4
4
|
:url: http://projecteuler.net/problem=210
|
5
5
|
:content: "\rConsider the set S(r) of points (x,y) with integer coordinates satisfying
|
6
|
-
|x| + |y| ![≤](/
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
is N(1,000,000,000)?\n\n"
|
6
|
+
|x| + |y| ![≤]({{ images_dir }}/symbol_le.gif) r. \n\rLet O be the point (0,0)
|
7
|
+
and C the point (r/4,r/4). \n\rLet N(r) be the number of points B in S(r), so
|
8
|
+
that the triangle OBC has an obtuse angle, i.e. the largest angle α satisfies 90°\rSo,
|
9
|
+
for example, N(4)=24 and N(8)=100.\r\n\nWhat is N(1,000,000,000)?\n\n"
|
data/data/problems/211.yml
CHANGED
@@ -7,5 +7,5 @@
|
|
7
7
|
|
8
8
|
σ<sub>2</sub>(10) = 1 + 4 + 25 + 100 = 130.
|
9
9
|
|
10
|
-
Find the sum of all <var>n</var>, 0 ![<](/
|
10
|
+
Find the sum of all <var>n</var>, 0 ![<]({{ images_dir }}/symbol_lt.gif) <var>n</var> ![<]({{ images_dir }}/symbol_lt.gif) 64,000,000 such that σ<sub>2</sub>(<var>n</var>) is a perfect square.
|
11
11
|
|
data/data/problems/212.yml
CHANGED
@@ -3,29 +3,25 @@
|
|
3
3
|
:name: Combined Volume of Cuboids
|
4
4
|
:url: http://projecteuler.net/problem=212
|
5
5
|
:content: "An axis-aligned cuboid, specified by parameters { (x<sub>0</sub>,y<sub>0</sub>,z<sub>0</sub>),
|
6
|
-
(dx,dy,dz) }, consists of all points (X,Y,Z) such that x<sub>0</sub> ![≤](
|
7
|
-
X ![≤](/
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
modulo
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
<var>k</var>
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
C<sub>2</sub> has parameters {(2383,3563,5079),(42,212,344)}, and so on.\n\nThe
|
29
|
-
combined volume of the first 100 cuboids, C<sub>1</sub>,...,C<sub>100</sub>, is
|
30
|
-
723581599.\n\nWhat is the combined volume of all 50000 cuboids, C<sub>1</sub>,...,C<sub>50000</sub>
|
31
|
-
?\n\n"
|
6
|
+
(dx,dy,dz) }, consists of all points (X,Y,Z) such that x<sub>0</sub> ![≤]({{ images_dir
|
7
|
+
}}/symbol_le.gif) X ![≤]({{ images_dir }}/symbol_le.gif) x<sub>0</sub>+dx, y<sub>0</sub>
|
8
|
+
![≤]({{ images_dir }}/symbol_le.gif) Y ![≤]({{ images_dir }}/symbol_le.gif) y<sub>0</sub>+dy
|
9
|
+
and z<sub>0</sub> ![≤]({{ images_dir }}/symbol_le.gif) Z ![≤]({{ images_dir }}/symbol_le.gif)
|
10
|
+
z<sub>0</sub>+dz. The volume of the cuboid is the product, dx ![×]({{ images_dir
|
11
|
+
}}/symbol_times.gif) dy ![×]({{ images_dir }}/symbol_times.gif) dz. The combined
|
12
|
+
volume of a collection of cuboids is the volume of their union and will be less
|
13
|
+
than the sum of the individual volumes if any cuboids overlap.\n\nLet C<sub>1</sub>,...,C<sub>50000</sub>
|
14
|
+
be a collection of 50000 axis-aligned cuboids such that C<sub><var>n</var></sub>
|
15
|
+
has parameters\n\nx<sub>0</sub> = S<sub>6<var>n</var>-5</sub> modulo 10000 \ny<sub>0</sub>
|
16
|
+
= S<sub>6<var>n</var>-4</sub> modulo 10000 \nz<sub>0</sub> = S<sub>6<var>n</var>-3</sub>
|
17
|
+
modulo 10000 \ndx = 1 + (S<sub>6<var>n</var>-2</sub> modulo 399) \ndy = 1 + (S<sub>6<var>n</var>-1</sub>
|
18
|
+
modulo 399) \ndz = 1 + (S<sub>6<var>n</var></sub> modulo 399)\n\nwhere S<sub>1</sub>,...,S<sub>300000</sub>
|
19
|
+
come from the \"Lagged Fibonacci Generator\":\n\nFor 1 ![≤]({{ images_dir }}/symbol_le.gif)
|
20
|
+
<var>k</var> ![≤]({{ images_dir }}/symbol_le.gif) 55, S<sub><var>k</var></sub> =
|
21
|
+
[100003 - 200003<var>k</var> + 300007<var>k</var><sup>3</sup>] (modulo 1000000)
|
22
|
+
\ \nFor 56 ![≤]({{ images_dir }}/symbol_le.gif) <var>k</var>, S<sub><var>k</var></sub>
|
23
|
+
= [S<sub><var>k</var>-24</sub> + S<sub><var>k</var>-55</sub>] (modulo 1000000)\n\nThus,
|
24
|
+
C<sub>1</sub> has parameters {(7,53,183),(94,369,56)}, C<sub>2</sub> has parameters
|
25
|
+
{(2383,3563,5079),(42,212,344)}, and so on.\n\nThe combined volume of the first
|
26
|
+
100 cuboids, C<sub>1</sub>,...,C<sub>100</sub>, is 723581599.\n\nWhat is the combined
|
27
|
+
volume of all 50000 cuboids, C<sub>1</sub>,...,C<sub>50000</sub> ?\n\n"
|
data/data/problems/213.yml
CHANGED
@@ -2,9 +2,8 @@
|
|
2
2
|
:id: 213
|
3
3
|
:name: Flea Circus
|
4
4
|
:url: http://projecteuler.net/problem=213
|
5
|
-
:content: "A 30 ![×](/
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
to six decimal places.\n\n"
|
5
|
+
:content: "A 30 ![×]({{ images_dir }}/symbol_times.gif)30 grid of squares contains
|
6
|
+
900 fleas, initially one flea per square. \n\rWhen a bell is rung, each flea jumps
|
7
|
+
to an adjacent square at random (usually 4 possibilities, except for fleas on the
|
8
|
+
edge of the grid or at the corners).\n\nWhat is the expected number of unoccupied
|
9
|
+
squares after 50 rings of the bell? Give your answer rounded to six decimal places.\n\n"
|
data/data/problems/214.yml
CHANGED
@@ -3,12 +3,11 @@
|
|
3
3
|
:name: Totient Chains
|
4
4
|
:url: http://projecteuler.net/problem=214
|
5
5
|
:content: "Let φ be Euler's totient function, i.e. for a natural number <var>n</var>,\rφ(<var>n</var>)
|
6
|
-
is the number of <var>k</var>, 1 ![≤](/
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
generate a chain of length 25?\n\n"
|
6
|
+
is the number of <var>k</var>, 1 ![≤]({{ images_dir }}/symbol_le.gif) <var>k</var>
|
7
|
+
![≤]({{ images_dir }}/symbol_le.gif) <var>n</var>, for which gcd(<var>k</var>,<var>n</var>)
|
8
|
+
= 1.\n\nBy iterating φ, each positive integer generates a decreasing chain of numbers
|
9
|
+
ending in 1. \n\rE.g. if we start with 5 the sequence 5,4,2,1 is generated. \n\rHere
|
10
|
+
is a listing of all chains with length 4:\n\n\r5,4,2,1 \n\r7,6,2,1 \n\r8,4,2,1
|
11
|
+
\ \n\r9,6,2,1 \n\r10,4,2,1 \n\r12,4,2,1 \n\r14,6,2,1 \n\r18,6,2,1\n\nOnly two
|
12
|
+
of these chains start with a prime, their sum is 12.\n\nWhat is the sum of all primes
|
13
|
+
less than 40000000 which generate a chain of length 25?\n\n"
|
data/data/problems/215.yml
CHANGED
@@ -3,13 +3,13 @@
|
|
3
3
|
:name: Crack-free Walls
|
4
4
|
:url: http://projecteuler.net/problem=215
|
5
5
|
:content: |+
|
6
|
-
Consider the problem of building a wall out of 2 ![×](/
|
6
|
+
Consider the problem of building a wall out of 2 ![×]({{ images_dir }}/symbol_times.gif)1 and 3 ![×]({{ images_dir }}/symbol_times.gif)1 bricks (horizontal ![×]({{ images_dir }}/symbol_times.gif)vertical dimensions) such that, for extra strength, the gaps between horizontally-adjacent bricks never line up in consecutive layers, i.e. never form a "running crack".
|
7
7
|
|
8
|
-
For example, the following 9 ![×](/
|
8
|
+
For example, the following 9 ![×]({{ images_dir }}/symbol_times.gif)3 wall is not acceptable due to the running crack shown in red:
|
9
9
|
|
10
|
-
![](/
|
10
|
+
![]({{ images_dir }}/p_215_crackfree.gif)
|
11
11
|
|
12
|
-
There are eight ways of forming a crack-free 9 ![×](/
|
12
|
+
There are eight ways of forming a crack-free 9 ![×]({{ images_dir }}/symbol_times.gif)3 wall, written W(9,3) = 8.
|
13
13
|
|
14
14
|
Calculate W(32,10).
|
15
15
|
|
data/data/problems/216.yml
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
:name: Investigating the primality of numbers of the form 2<var>n</var><sup>2</sup>-1
|
4
4
|
:url: http://projecteuler.net/problem=216
|
5
5
|
:content: "Consider numbers <var>t</var>(<var>n</var>) of the form <var>t</var>(<var>n</var>)
|
6
|
-
= 2<var>n</var><sup>2</sup>-1 with <var>n</var> ![>](/
|
6
|
+
= 2<var>n</var><sup>2</sup>-1 with <var>n</var> ![>]({{ images_dir }}/symbol_gt.gif)
|
7
7
|
1. \n\rThe first such numbers are 7, 17, 31, 49, 71, 97, 127 and 161. \n\rIt turns
|
8
|
-
out that only 49 = 7\\*7 and 161 = 7\\*23 are not prime. \n\rFor <var>n</var> ![≤](
|
9
|
-
10000 there are 2202 numbers <var>t</var>(<var>n</var>)
|
10
|
-
numbers <var>t</var>(<var>n</var>) are prime for <var>n</var>
|
11
|
-
50,000,000 ?\n\n"
|
8
|
+
out that only 49 = 7\\*7 and 161 = 7\\*23 are not prime. \n\rFor <var>n</var> ![≤]({{
|
9
|
+
images_dir }}/symbol_le.gif) 10000 there are 2202 numbers <var>t</var>(<var>n</var>)
|
10
|
+
that are prime.\n\nHow many numbers <var>t</var>(<var>n</var>) are prime for <var>n</var>
|
11
|
+
![≤]({{ images_dir }}/symbol_le.gif) 50,000,000 ?\n\n"
|
data/data/problems/217.yml
CHANGED
@@ -3,16 +3,14 @@
|
|
3
3
|
:name: Balanced Numbers
|
4
4
|
:url: http://projecteuler.net/problem=217
|
5
5
|
:content: "A positive integer with <var>k</var> (decimal) digits is called balanced
|
6
|
-
if its first ![⌈](/
|
7
|
-
![⌉](/
|
8
|
-
|
9
|
-
![
|
10
|
-
|
11
|
-
![
|
12
|
-
|
13
|
-
|
14
|
-
![⌉](/home/will/src/euler-manager/config/../data/images/symbol_rceil.gif) = 4 and
|
15
|
-
![⌈](/home/will/src/euler-manager/config/../data/images/symbol_lceil.gif)5 ![⌉](/home/will/src/euler-manager/config/../data/images/symbol_rceil.gif)
|
6
|
+
if its first ![⌈]({{ images_dir }}/symbol_lceil.gif)<sup><var>k</var></sup>/<sub>2</sub>
|
7
|
+
![⌉]({{ images_dir }}/symbol_rceil.gif) digits sum to the same value as its last
|
8
|
+
![⌈]({{ images_dir }}/symbol_lceil.gif)<sup><var>k</var></sup>/<sub>2</sub> ![⌉]({{
|
9
|
+
images_dir }}/symbol_rceil.gif) digits, where ![⌈]({{ images_dir }}/symbol_lceil.gif)<var>x</var>
|
10
|
+
![⌉]({{ images_dir }}/symbol_rceil.gif), pronounced ceiling of <var>x</var>, is
|
11
|
+
the smallest integer ![≥]({{ images_dir }}/symbol_ge.gif) <var>x</var>, thus ![⌈]({{
|
12
|
+
images_dir }}/symbol_lceil.gif)π ![⌉]({{ images_dir }}/symbol_rceil.gif) = 4 and
|
13
|
+
![⌈]({{ images_dir }}/symbol_lceil.gif)5 ![⌉]({{ images_dir }}/symbol_rceil.gif)
|
16
14
|
= 5.\n\nSo, for example, all palindromes are balanced, as is 13722.\n\nLet T(<var>n</var>)
|
17
15
|
be the sum of all balanced numbers less than 10<sup><var>n</var></sup>. \n\rThus:
|
18
16
|
T(1) = 45, T(2) = 540 and T(5) = 334795890.\n\nFind T(47) mod 3<sup>15</sup>\n\n"
|
data/data/problems/218.yml
CHANGED
@@ -9,5 +9,5 @@
|
|
9
9
|
if \n\r-it is a primitive right angled triangle \n\r-its hypotenuse is a perfect
|
10
10
|
square\n\nWe will call a right angled triangle super-perfect if \n\r-it is a perfect
|
11
11
|
right angled triangle and \n\r-its area is a multiple of the perfect numbers 6
|
12
|
-
and 28.\n\nHow many perfect right-angled triangles with c ![≤](/
|
12
|
+
and 28.\n\nHow many perfect right-angled triangles with c ![≤]({{ images_dir }}/symbol_le.gif)10<sup>16</sup>
|
13
13
|
exist that are not super-perfect?\n\n"
|
data/data/problems/22.yml
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
:content: |+
|
6
6
|
Using [names.txt](project/names.txt) (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical position in the list to obtain a name score.
|
7
7
|
|
8
|
-
For example, when the list is sorted into alphabetical order, COLIN, which is worth 3 + 15 + 12 + 9 + 14 = 53, is the 938th name in the list. So, COLIN would obtain a score of 938 ![×](/
|
8
|
+
For example, when the list is sorted into alphabetical order, COLIN, which is worth 3 + 15 + 12 + 9 + 14 = 53, is the 938th name in the list. So, COLIN would obtain a score of 938 ![×]({{ images_dir }}/symbol_times.gif) 53 = 49714.
|
9
9
|
|
10
10
|
What is the total of all the name scores in the file?
|
11
11
|
|
data/data/problems/220.yml
CHANGED
@@ -2,18 +2,18 @@
|
|
2
2
|
:id: 220
|
3
3
|
:name: Heighway Dragon
|
4
4
|
:url: http://projecteuler.net/problem=220
|
5
|
-
:content: "Let **_D_** <sub>0</sub> be the two-letter string \"Fa\". For n ![≥](
|
6
|
-
derive **_D_** <sub>n</sub> from **_D_** <sub>n-1</sub>
|
7
|
-
rules:\n\n\"a\" ![→](/
|
8
|
-
\
|
9
|
-
\"
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
5
|
+
:content: "Let **_D_** <sub>0</sub> be the two-letter string \"Fa\". For n ![≥]({{
|
6
|
+
images_dir }}/symbol_ge.gif)1, derive **_D_** <sub>n</sub> from **_D_** <sub>n-1</sub>
|
7
|
+
by the string-rewriting rules:\n\n\"a\" ![→]({{ images_dir }}/symbol_maps.gif) \"aRbFR\"
|
8
|
+
\ \n\r\"b\" ![→]({{ images_dir }}/symbol_maps.gif) \"LFaLb\"\n\nThus, **_D_** <sub>0</sub>
|
9
|
+
= \"Fa\", **_D_** <sub>1</sub> = \"FaRbFR\", **_D_** <sub>2</sub> = \"FaRbFRRLFaLbFR\",
|
10
|
+
and so on.\n\nThese strings can be interpreted as instructions to a computer graphics
|
11
|
+
program, with \"F\" meaning \"draw forward one unit\", \"L\" meaning \"turn left
|
12
|
+
90 degrees\", \"R\" meaning \"turn right 90 degrees\", and \"a\" and \"b\" being
|
13
|
+
ignored. The initial position of the computer cursor is (0,0), pointing up towards
|
14
|
+
(0,1).\n\nThen **_D_** <sub>n</sub> is an exotic drawing known as the _Heighway
|
15
|
+
Dragon_ of order _n_. For example, **_D_** <sub>10</sub> is shown below; counting
|
16
|
+
each \"F\" as one step, the highlighted spot at (18,16) is the position reached
|
17
|
+
after 500 steps.\n\n ![]({{ images_dir }}/p_220.gif)\n\nWhat is the position of
|
18
|
+
the cursor after 10<sup>12</sup> steps in **_D_** <sub>50</sub> ? \n\rGive your
|
19
|
+
answer in the form _x_,_y_ with no spaces.\n\n"
|
data/data/problems/221.yml
CHANGED
@@ -7,8 +7,7 @@
|
|
7
7
|
<var>A</var> = <var>p</var> · <var>q</var> · <var>r</var> and \r | \n\n| 1 |\n|
|
8
8
|
<var>A</var> |\n\n | = | \n\n| 1 |\n| <var>p</var> |\n\n | + | \n\n| 1 |\n| <var>q</var>
|
9
9
|
|\n\n | + | \n\n| 1 |\n| <var>r</var> |\n\n |\n\nFor example, 630 is an Alexandrian
|
10
|
-
integer (<var>p</var> = 5, <var>q</var> = ![−](/
|
11
|
-
<var>r</var> = ![−](/
|
12
|
-
|
13
|
-
|
14
|
-
integer.\n\n"
|
10
|
+
integer (<var>p</var> = 5, <var>q</var> = ![−]({{ images_dir }}/symbol_minus.gif)7,
|
11
|
+
<var>r</var> = ![−]({{ images_dir }}/symbol_minus.gif)18).\rIn fact, 630 is the
|
12
|
+
6<sup>th</sup> Alexandrian integer, the first 6 Alexandrian integers being: 6, 42,
|
13
|
+
120, 156, 420 and 630.\n\nFind the 150000<sup>th</sup> Alexandrian integer.\n\n"
|