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/287.yml
CHANGED
@@ -3,24 +3,25 @@
|
|
3
3
|
:name: Quadtree encoding (a simple compression algorithm)
|
4
4
|
:url: http://projecteuler.net/problem=287
|
5
5
|
:content: "The quadtree encoding allows us to describe a 2<sup><var>N</var></sup>
|
6
|
-
![×](/
|
7
|
-
|
8
|
-
|
9
|
-
![×](/
|
10
|
-
|
11
|
-
region is divided into 4 sub-regions of dimension 2<sup><var>n</var>-1</sup> ![×](
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
region contains only white pixels.\n\nConsider
|
16
|
-
|
6
|
+
![×]({{ images_dir }}/symbol_times.gif)2<sup><var>N</var></sup> black and white
|
7
|
+
image as a sequence of bits (0 and 1). Those sequences are to be read from left
|
8
|
+
to right like this:\n\n- the first bit deals with the complete 2<sup><var>N</var></sup>
|
9
|
+
![×]({{ images_dir }}/symbol_times.gif)2<sup><var>N</var></sup> region;\n- \"0\"
|
10
|
+
denotes a split:\r \nthe current 2<sup><var>n</var></sup> ![×]({{ images_dir }}/symbol_times.gif)2<sup><var>n</var></sup>
|
11
|
+
region is divided into 4 sub-regions of dimension 2<sup><var>n</var>-1</sup> ![×]({{
|
12
|
+
images_dir }}/symbol_times.gif)2<sup><var>n</var>-1</sup>, \n\rthe next bits contains
|
13
|
+
the description of the top left, top right, bottom left and bottom right sub-regions
|
14
|
+
- in that order;\n- \"10\" indicates that the current region contains only black
|
15
|
+
pixels;\n- \"11\" indicates that the current region contains only white pixels.\n\nConsider
|
16
|
+
the following 4 ![×]({{ images_dir }}/symbol_times.gif)4 image (colored marks denote
|
17
|
+
places where a split can occur):\n\n ![]({{ images_dir }}/p_287_quadtree.gif)\n\nThis
|
17
18
|
image can be described by several sequences, for example :<bp></bp>\r\" **0****
|
18
19
|
0 **10101010** 0 **1011111011** 0**10101010\", of length 30, or \n\r\" **0** 10
|
19
20
|
**0** 101111101110\", of length 16, which is the minimal sequence for this image.\n\nFor
|
20
21
|
a positive integer <var>N</var>, define <var>D<sub>N</sub></var> as the 2<sup><var>N</var></sup>
|
21
|
-
![×](/
|
22
|
-
|
23
|
-
|
24
|
-
![≤](/
|
25
|
-
|
26
|
-
|
22
|
+
![×]({{ images_dir }}/symbol_times.gif)2<sup><var>N</var></sup> image with the following
|
23
|
+
coloring scheme:\n\n- the pixel with coordinates <var>x</var> = 0, <var>y</var> = 0
|
24
|
+
corresponds to the bottom left pixel,\n- if (<var>x</var> - 2<sup><var>N</var>-1</sup>)<sup>2</sup> + (<var>y</var> - 2<sup><var>N</var>-1</sup>)<sup>2</sup>
|
25
|
+
![≤]({{ images_dir }}/symbol_le.gif) 2<sup>2<var>N</var>-2</sup> then the pixel
|
26
|
+
is black,\n- otherwise the pixel is white.\n\nWhat is the length of the minimal
|
27
|
+
sequence describing <var>D</var><sub>24</sub> ?\n\n"
|
data/data/problems/288.yml
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
:name: An enormous factorial
|
4
4
|
:url: http://projecteuler.net/problem=288
|
5
5
|
:content: "For any prime <var>p</var> the number N(<var>p</var>,<var>q</var>) is defined
|
6
|
-
by\rN(<var>p</var>,<var>q</var>) = ![∑](/
|
6
|
+
by\rN(<var>p</var>,<var>q</var>) = ![∑]({{ images_dir }}/symbol_sum.gif)<sub><var>n</var>=0
|
7
7
|
to <var>q</var></sub> T<sub><var>n</var></sub>\\*<var>p</var><sup><var>n</var></sup>
|
8
8
|
\ \n with T<sub><var>n</var></sub> generated by the following random number generator:\n\nS<sub>0</sub>
|
9
9
|
= 290797 \n\rS<sub><var>n</var>+1</sub> = S<sub><var>n</var></sub><sup>2</sup>
|
data/data/problems/289.yml
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
are possible on E(<var>m</var>,<var>n</var>), but we are only interested in those
|
13
13
|
which are not self-crossing: \rA non-crossing path just touches itself at lattice
|
14
14
|
points, but it never crosses itself.\n\nThe image below shows E(3,3) and an example
|
15
|
-
of an Eulerian non-crossing path.\n\n ![](/
|
15
|
+
of an Eulerian non-crossing path.\n\n ![]({{ images_dir }}/p_289_euler.gif)\n\nLet
|
16
16
|
L(<var>m</var>,<var>n</var>) be the number of Eulerian non-crossing paths on E(<var>m</var>,<var>n</var>).
|
17
17
|
\ \n\rFor example, L(1,2) = 2, L(2,2) = 37 and L(3,3) = 104290.\n\nFind L(6,10)
|
18
18
|
mod 10<sup>10</sup>.\n\n"
|
data/data/problems/29.yml
CHANGED
@@ -2,16 +2,15 @@
|
|
2
2
|
:id: 29
|
3
3
|
:name: Distinct powers
|
4
4
|
:url: http://projecteuler.net/problem=29
|
5
|
-
:content: "Consider all integer combinations of _a_<sup><i>b</i></sup> for 2 ![≤](
|
6
|
-
_a_ ![≤](/
|
7
|
-
|
8
|
-
|
9
|
-
3<sup>
|
10
|
-
4<sup>
|
11
|
-
5<sup>
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
_a_ ![≤](/
|
16
|
-
|
17
|
-
100?\n\n"
|
5
|
+
:content: "Consider all integer combinations of _a_<sup><i>b</i></sup> for 2 ![≤]({{
|
6
|
+
images_dir }}/symbol_le.gif) _a_ ![≤]({{ images_dir }}/symbol_le.gif) 5 and 2 ![≤]({{
|
7
|
+
images_dir }}/symbol_le.gif) _b_ ![≤]({{ images_dir }}/symbol_le.gif) 5:\n\n> 2<sup>2</sup>=4,
|
8
|
+
2<sup>3</sup>=8, 2<sup>4</sup>=16, 2<sup>5</sup>=32 \n> 3<sup>2</sup>=9, 3<sup>3</sup>=27,
|
9
|
+
3<sup>4</sup>=81, 3<sup>5</sup>=243 \n> 4<sup>2</sup>=16, 4<sup>3</sup>=64, 4<sup>4</sup>=256,
|
10
|
+
4<sup>5</sup>=1024 \n> 5<sup>2</sup>=25, 5<sup>3</sup>=125, 5<sup>4</sup>=625,
|
11
|
+
5<sup>5</sup>=3125\n\nIf they are then placed in numerical order, with any repeats
|
12
|
+
removed, we get the following sequence of 15 distinct terms:\n\n4, 8, 9, 16, 25,
|
13
|
+
27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125\n\nHow many distinct terms are in
|
14
|
+
the sequence generated by _a_<sup><i>b</i></sup> for 2 ![≤]({{ images_dir }}/symbol_le.gif)
|
15
|
+
_a_ ![≤]({{ images_dir }}/symbol_le.gif) 100 and 2 ![≤]({{ images_dir }}/symbol_le.gif)
|
16
|
+
_b_ ![≤]({{ images_dir }}/symbol_le.gif) 100?\n\n"
|
data/data/problems/290.yml
CHANGED
@@ -3,5 +3,5 @@
|
|
3
3
|
:name: Digital Signature
|
4
4
|
:url: http://projecteuler.net/problem=290
|
5
5
|
:content: |+
|
6
|
-
How many integers 0 ![≤](/
|
6
|
+
How many integers 0 ![≤]({{ images_dir }}/symbol_le.gif) <var>n</var> < 10<sup>18</sup> have the property that the sum of the digits of <var>n</var> equals the sum of digits of 137<var>n</var>?
|
7
7
|
|
data/data/problems/291.yml
CHANGED
@@ -2,6 +2,6 @@
|
|
2
2
|
:id: 291
|
3
3
|
:name: Panaitopol Primes
|
4
4
|
:url: http://projecteuler.net/problem=291
|
5
|
-
:content: "A prime number <var>p</var> is called a Panaitopol prime if ![](
|
6
|
-
for some positive integers \n <var>x</var> and <var>y</var>.\n\nFind
|
7
|
-
primes are less than 5 ![×](/
|
5
|
+
:content: "A prime number <var>p</var> is called a Panaitopol prime if ![]({{ images_dir
|
6
|
+
}}/p_291_formula.gif) for some positive integers \n <var>x</var> and <var>y</var>.\n\nFind
|
7
|
+
how many Panaitopol primes are less than 5 ![×]({{ images_dir }}/symbol_times.gif)10<sup>15</sup>.\n\n"
|
data/data/problems/292.yml
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
the following properties:\n\n- there are at least three vertices,\n- no three vertices
|
7
7
|
are aligned,\n- each vertex has **integer coordinates** ,\n- each edge has **integer
|
8
8
|
length** .\n\nFor a given integer <var>n</var>, define P(<var>n</var>) as the number
|
9
|
-
of distinct pythagorean polygons for which the perimeter is ![≤](/
|
9
|
+
of distinct pythagorean polygons for which the perimeter is ![≤]({{ images_dir }}/symbol_le.gif) <var>n</var>.
|
10
10
|
\ \n\rPythagorean polygons should be considered distinct as long as none is a translation
|
11
11
|
of another.\n\nYou are given that P(4) = 1, P(30) = 3655 and P(60) = 891045. \n\rFind
|
12
12
|
P(120).\n\n"
|
data/data/problems/293.yml
CHANGED
@@ -5,10 +5,10 @@
|
|
5
5
|
:content: "An even positive integer N will be called admissible, if it is a power
|
6
6
|
of 2 or its distinct prime factors are consecutive primes. \n\rThe first twelve
|
7
7
|
admissible numbers are 2,4,6,8,12,16,18,24,30,32,36,48.\n\nIf N is admissible, the
|
8
|
-
smallest integer M ![>](/
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
numbers
|
8
|
+
smallest integer M ![>]({{ images_dir }}/symbol_gt.gif) 1 such that N+M is prime,
|
9
|
+
will be called the pseudo-Fortunate number for N.\n\nFor example, N=630 is admissible
|
10
|
+
since it is even and its distinct prime factors are the consecutive primes 2,3,5
|
11
|
+
and 7. \n \rThe next prime number after 631 is 641; hence, the pseudo-Fortunate
|
12
|
+
number for 630 is M=11. \n\rIt can also be seen that the pseudo-Fortunate number
|
13
|
+
for 16 is 3.\n\nFind the sum of all distinct pseudo-Fortunate numbers for admissible
|
14
|
+
numbers N less than 10<sup>9</sup>.\n\n"
|
data/data/problems/295.yml
CHANGED
@@ -9,13 +9,13 @@
|
|
9
9
|
<var>x</var><sup>2</sup>+<var>y</var><sup>2</sup>=25 \n\rC<sub>1</sub>: (<var>x</var>+4)<sup>2</sup>+(<var>y</var>-4)<sup>2</sup>=1
|
10
10
|
\ \n\rC<sub>2</sub>: (<var>x</var>-12)<sup>2</sup>+(<var>y</var>-4)<sup>2</sup>=65\n\nThe
|
11
11
|
circles C<sub>0</sub>, C<sub>1</sub> and C<sub>2</sub> are drawn in the picture
|
12
|
-
below.\n\n ![](/
|
13
|
-
|
14
|
-
|
12
|
+
below.\n\n ![]({{ images_dir }}/p295_lenticular.gif)\n\nC<sub>0</sub> and C<sub>1</sub>
|
13
|
+
form a lenticular hole, as well as C<sub>0</sub> and C<sub>2</sub>.\n\nWe call an
|
14
|
+
ordered pair of positive real numbers (r<sub>1</sub>, r<sub>2</sub>) a _lenticular
|
15
15
|
pair_ if there exist two circles with radii r<sub>1</sub> and r<sub>2</sub> that
|
16
|
-
form a lenticular hole.\rWe can verify that (1, 5) and (5, ![√](/
|
16
|
+
form a lenticular hole.\rWe can verify that (1, 5) and (5, ![√]({{ images_dir }}/symbol_radic.gif)65)
|
17
17
|
are the lenticular pairs of the example above.\n\nLet L(N) be the number of **distinct**
|
18
|
-
lenticular pairs (r<sub>1</sub>, r<sub>2</sub>) for which 0 ![<](/
|
19
|
-
r<sub>1</sub> ![≤](/
|
20
|
-
|
21
|
-
|
18
|
+
lenticular pairs (r<sub>1</sub>, r<sub>2</sub>) for which 0 ![<]({{ images_dir }}/symbol_lt.gif)
|
19
|
+
r<sub>1</sub> ![≤]({{ images_dir }}/symbol_le.gif) r<sub>2</sub> ![≤]({{ images_dir
|
20
|
+
}}/symbol_le.gif) N. \n\rWe can verify that L(10) = 30 and L(100) = 3442.\n\nFind
|
21
|
+
L(100 000).\n\n"
|
data/data/problems/296.yml
CHANGED
@@ -2,12 +2,11 @@
|
|
2
2
|
:id: 296
|
3
3
|
:name: Angular Bisector and Tangent
|
4
4
|
:url: http://projecteuler.net/problem=296
|
5
|
-
:content: "Given is an integer sided triangle <var>ABC</var> with <var>BC</var> ![≤](
|
6
|
-
<var>AC</var> ![≤](/
|
5
|
+
:content: "Given is an integer sided triangle <var>ABC</var> with <var>BC</var> ![≤]({{
|
6
|
+
images_dir }}/symbol_le.gif) <var>AC</var> ![≤]({{ images_dir }}/symbol_le.gif)
|
7
7
|
<var>AB</var>. \n<var>k</var> is the angular bisector of angle <var>ACB</var>.
|
8
8
|
\ \n <var>m</var> is the tangent at <var>C</var> to the circumscribed circle of
|
9
9
|
<var>ABC</var>. \n <var>n</var> is a line parallel to <var>m</var> through <var>B</var>.
|
10
10
|
\ \n\rThe intersection of <var>n</var> and <var>k</var> is called <var>E</var>.\n\n
|
11
|
-
![](/
|
12
|
-
|
13
|
-
that <var>BE</var> has integral length?\n\n"
|
11
|
+
![]({{ images_dir }}/p296_bisector.gif)\n\nHow many triangles <var>ABC</var> with
|
12
|
+
a perimeter not exceeding 100 000 exist such that <var>BE</var> has integral length?\n\n"
|
data/data/problems/297.yml
CHANGED
@@ -9,8 +9,7 @@
|
|
9
9
|
a sum is called the **Zeckendorf representation** of the number.\n\nFor any integer
|
10
10
|
<var>n</var>>0, let <var>z</var>(<var>n</var>) be the number of terms in the Zeckendorf
|
11
11
|
representation of <var>n</var>. \n\rThus, <var>z</var>(5) = 1, <var>z</var>(14) = 2,
|
12
|
-
<var>z</var>(100) = 3 etc. \n\rAlso, for 0 ![<](/
|
13
|
-
![<](/
|
14
|
-
∑ <var>z</var>(<var>n</var>)
|
15
|
-
|
16
|
-
![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)10<sup>17</sup>.\n\n"
|
12
|
+
<var>z</var>(100) = 3 etc. \n\rAlso, for 0 ![<]({{ images_dir }}/symbol_lt.gif)<var>n</var>
|
13
|
+
![<]({{ images_dir }}/symbol_lt.gif)10<sup>6</sup>, ∑ <var>z</var>(<var>n</var>) = 7894453.\n\nFind
|
14
|
+
∑ <var>z</var>(<var>n</var>) for 0 ![<]({{ images_dir }}/symbol_lt.gif)<var>n</var>
|
15
|
+
![<]({{ images_dir }}/symbol_lt.gif)10<sup>17</sup>.\n\n"
|
data/data/problems/299.yml
CHANGED
@@ -3,23 +3,22 @@
|
|
3
3
|
:name: Three similar triangles
|
4
4
|
:url: http://projecteuler.net/problem=299
|
5
5
|
:content: "Four points with integer coordinates are selected: \nA(<var>a</var>, 0),
|
6
|
-
B(<var>b</var>, 0), C(0, <var>c</var>) and D(0, <var>d</var>), \rwith 0 ![<](
|
7
|
-
![<](/
|
8
|
-
and 0 ![<](/
|
9
|
-
![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif) <var>d</var>.
|
6
|
+
B(<var>b</var>, 0), C(0, <var>c</var>) and D(0, <var>d</var>), \rwith 0 ![<]({{
|
7
|
+
images_dir }}/symbol_lt.gif) <var>a</var> ![<]({{ images_dir }}/symbol_lt.gif) <var>b</var>
|
8
|
+
and 0 ![<]({{ images_dir }}/symbol_lt.gif) <var>c</var> ![<]({{ images_dir }}/symbol_lt.gif) <var>d</var>.
|
10
9
|
\ \n\rPoint P, also with integer coordinates, is chosen on the line AC so that the
|
11
10
|
three triangles ABP, CDP and BDP are all <dfn title=\"Have equal angles\">similar</dfn>.\n\n
|
12
|
-
![](/
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
![]({{ images_dir }}/p_299_ThreeSimTri.gif)\n\nIt is easy to prove that the three
|
12
|
+
triangles can be similar, only if <var>a</var>=<var>c</var>.\n\nSo, given that <var>a</var>=<var>c</var>,
|
13
|
+
we are looking for triplets (<var>a</var>,<var>b</var>,<var>d</var>) such that at
|
14
|
+
least one point P (with integer coordinates) exists on AC, making the three triangles
|
15
|
+
ABP, CDP and BDP all similar.\n\nFor example, if (<var>a</var>,<var>b</var>,<var>d</var>)=(2,3,4),
|
17
16
|
it can be easily verified that point P(1,1) satisfies the above condition. \rNote
|
18
17
|
that the triplets (2,3,4) and (2,4,3) are considered as distinct, although point
|
19
|
-
P(1,1) is common for both.\n\nIf <var>b</var>+<var>d</var> ![<](/
|
18
|
+
P(1,1) is common for both.\n\nIf <var>b</var>+<var>d</var> ![<]({{ images_dir }}/symbol_lt.gif) 100,
|
20
19
|
there are 92 distinct triplets (<var>a</var>,<var>b</var>,<var>d</var>) such that
|
21
|
-
point P exists. \n\rIf <var>b</var>+<var>d</var> ![<](/
|
20
|
+
point P exists. \n\rIf <var>b</var>+<var>d</var> ![<]({{ images_dir }}/symbol_lt.gif) 100
|
22
21
|
000, there are 320471 distinct triplets (<var>a</var>,<var>b</var>,<var>d</var>)
|
23
|
-
such that point P exists.\n\nIf <var>b</var>+<var>d</var> ![<](/
|
22
|
+
such that point P exists.\n\nIf <var>b</var>+<var>d</var> ![<]({{ images_dir }}/symbol_lt.gif) 100
|
24
23
|
000 000, how many distinct triplets (<var>a</var>,<var>b</var>,<var>d</var>) are
|
25
24
|
there such that point P exists?\n\n"
|
data/data/problems/300.yml
CHANGED
@@ -12,12 +12,13 @@
|
|
12
12
|
in the inner part, with the P-elements on the outside. \n\rNatural proteins are
|
13
13
|
folded in three dimensions of course, but we will only consider protein folding
|
14
14
|
in <u>two dimensions</u>.\n\nThe figure below shows two possible ways that our example
|
15
|
-
protein could be folded (H-H contact points are shown with red dots).\n\n ![](
|
16
|
-
folding on the left has only six H-H contact
|
17
|
-
|
18
|
-
is optimal for this string.\n\nAssuming
|
19
|
-
to occur in any position along the string,
|
20
|
-
in an optimal folding of a random protein
|
21
|
-
|
22
|
-
|
23
|
-
|
15
|
+
protein could be folded (H-H contact points are shown with red dots).\n\n ![]({{
|
16
|
+
images_dir }}/p_300_protein.gif)\n\nThe folding on the left has only six H-H contact
|
17
|
+
points, thus it would never occur naturally. \n\rOn the other hand, the folding
|
18
|
+
on the right has nine H-H contact points, which is optimal for this string.\n\nAssuming
|
19
|
+
that H and P elements are equally likely to occur in any position along the string,
|
20
|
+
the average number of H-H contact points in an optimal folding of a random protein
|
21
|
+
string of length 8 turns out to be 850 / 2<sup>8</sup>=3.3203125.\n\nWhat is the
|
22
|
+
average number of H-H contact points in an optimal folding of a random protein string
|
23
|
+
of length 15? \n\rGive your answer using as many decimal places as necessary for
|
24
|
+
an exact result.\n\n"
|
data/data/problems/301.yml
CHANGED
@@ -19,5 +19,5 @@
|
|
19
19
|
stones remain; so the current player loses. To illustrate: \n\r- current player
|
20
20
|
moves to (1,2,1) \n\r- opponent moves to (1,0,1) \n\r- current player moves to
|
21
21
|
(0,0,1) \n\r- opponent moves to (0,0,0), and so wins.\n\nFor how many positive
|
22
|
-
integers <var>n</var> ![≤](/
|
23
|
-
|
22
|
+
integers <var>n</var> ![≤]({{ images_dir }}/symbol_le.gif) 2<sup>30</sup> does
|
23
|
+
<var>X</var>(<var>n</var>,2<var>n</var>,3<var>n</var>) = 0 ?\n\n"
|
data/data/problems/303.yml
CHANGED
@@ -3,11 +3,11 @@
|
|
3
3
|
:name: Multiples with small digits
|
4
4
|
:url: http://projecteuler.net/problem=303
|
5
5
|
:content: |+
|
6
|
-
For a positive integer <var>n</var>, define <var>f</var>(<var>n</var>) as the least positive multiple of <var>n</var> that, written in base 10, uses only digits ![≤](/
|
6
|
+
For a positive integer <var>n</var>, define <var>f</var>(<var>n</var>) as the least positive multiple of <var>n</var> that, written in base 10, uses only digits ![≤]({{ images_dir }}/symbol_le.gif) 2.
|
7
7
|
|
8
8
|
Thus <var>f</var>(2)=2, <var>f</var>(3)=12, <var>f</var>(7)=21, <var>f</var>(42)=210, <var>f</var>(89)=1121222.
|
9
9
|
|
10
|
-
Also, ![](/
|
10
|
+
Also, ![]({{ images_dir }}/p303_formula100.gif).
|
11
11
|
|
12
|
-
Find ![](/
|
12
|
+
Find ![]({{ images_dir }}/p303_formula10000.gif).
|
13
13
|
|
data/data/problems/304.yml
CHANGED
@@ -3,12 +3,11 @@
|
|
3
3
|
:name: Primonacci
|
4
4
|
:url: http://projecteuler.net/problem=304
|
5
5
|
:content: "For any positive integer <var>n</var> the function next\\_prime(<var>n</var>)
|
6
|
-
returns the smallest prime p \n such that p ![>](/
|
6
|
+
returns the smallest prime p \n such that p ![>]({{ images_dir }}/symbol_gt.gif)<var>n</var>.\n\nThe
|
7
7
|
sequence a(<var>n</var>) is defined by: \n\ra(1)=next\\_prime(10<sup>14</sup>)
|
8
|
-
and a(<var>n</var>)=next\\_prime(a(<var>n</var>-1)) for n ![>](/
|
8
|
+
and a(<var>n</var>)=next\\_prime(a(<var>n</var>-1)) for n ![>]({{ images_dir }}/symbol_gt.gif)1.\n\nThe
|
9
9
|
fibonacci sequence f(<var>n</var>) is defined by:\rf(0)=0, f(1)=1 and f(<var>n</var>)=f(<var>n</var>-1)+f(<var>n</var>-2)
|
10
|
-
for <var>n</var> ![>](/
|
11
|
-
|
12
|
-
for 1 ![≤](/
|
13
|
-
|
14
|
-
your answer mod 1234567891011.\n\n"
|
10
|
+
for <var>n</var> ![>]({{ images_dir }}/symbol_gt.gif)1.\n\nThe sequence b(<var>n</var>)
|
11
|
+
is defined as f(a(<var>n</var>)).\n\nFind ![∑]({{ images_dir }}/symbol_sum.gif)b(<var>n</var>)
|
12
|
+
for 1 ![≤]({{ images_dir }}/symbol_le.gif)<var>n</var> ![≤]({{ images_dir }}/symbol_le.gif)100
|
13
|
+
000. \rGive your answer mod 1234567891011.\n\n"
|
data/data/problems/305.yml
CHANGED
@@ -6,5 +6,6 @@
|
|
6
6
|
positive integers (starting from 1) written down in base 10. \n \rThus, S = 1234567891011121314151617181920212223242...\n\nIt's
|
7
7
|
easy to see that any number will show up an infinite number of times in S.\n\nLet's
|
8
8
|
call f(n) the starting position of the n<sup>th</sup> occurrence of n in S. \n
|
9
|
-
\rFor example, f(1)=1, f(5)=81, f(12)=271 and f(7780)=111111365.\n\nFind ![∑](
|
10
|
-
|
9
|
+
\rFor example, f(1)=1, f(5)=81, f(12)=271 and f(7780)=111111365.\n\nFind ![∑]({{
|
10
|
+
images_dir }}/symbol_sum.gif)f(3<sup>k</sup>) for 1 ![≤]({{ images_dir }}/symbol_le.gif)k
|
11
|
+
![≤]({{ images_dir }}/symbol_le.gif)13.\n\n"
|
data/data/problems/306.yml
CHANGED
@@ -12,14 +12,11 @@
|
|
12
12
|
loses.\n- If <var>n</var> = 4, there are three valid moves for the first player;
|
13
13
|
she can win the game by painting the two middle squares.\n- If <var>n</var> = 5,
|
14
14
|
there are four valid moves for the first player (shown below in red); but no matter
|
15
|
-
what she does, the second player (blue) wins.\n\n ![](/
|
16
|
-
for 1 ![≤](/
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
![≤](/
|
21
|
-
|
22
|
-
|
23
|
-
![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) 1 000 000,
|
24
|
-
how many values of <var>n</var> are there for which the first player can force a
|
25
|
-
win?\n\n"
|
15
|
+
what she does, the second player (blue) wins.\n\n ![]({{ images_dir }}/p_306_pstrip.gif)\n\nSo,
|
16
|
+
for 1 ![≤]({{ images_dir }}/symbol_le.gif) <var>n</var> ![≤]({{ images_dir }}/symbol_le.gif)
|
17
|
+
5, there are 3 values of <var>n</var> for which the first player can force a win.
|
18
|
+
\ \n\rSimilarly, for 1 ![≤]({{ images_dir }}/symbol_le.gif) <var>n</var> ![≤]({{
|
19
|
+
images_dir }}/symbol_le.gif) 50, there are 40 values of <var>n</var> for which the
|
20
|
+
first player can force a win.\n\nFor 1 ![≤]({{ images_dir }}/symbol_le.gif) <var>n</var>
|
21
|
+
![≤]({{ images_dir }}/symbol_le.gif) 1 000 000, how many values of <var>n</var>
|
22
|
+
are there for which the first player can force a win?\n\n"
|
data/data/problems/307.yml
CHANGED
@@ -6,6 +6,5 @@
|
|
6
6
|
chips produced by a factory (any number of defects may be found on a chip and each
|
7
7
|
defect is independent of the other defects).\n\nLet p(<var>k,n</var>) represent
|
8
8
|
the probability that there is a chip with at least 3 defects. \n\rFor instance
|
9
|
-
p(3,7) ![≈](/
|
10
|
-
|
11
|
-
places in the form 0.abcdefghij\n\n"
|
9
|
+
p(3,7) ![≈]({{ images_dir }}/symbol_asymp.gif) 0.0204081633.\n\nFind p(20 000, 1
|
10
|
+
000 000) and give your answer rounded to 10 decimal places in the form 0.abcdefghij\n\n"
|
data/data/problems/309.yml
CHANGED
@@ -6,11 +6,11 @@
|
|
6
6
|
and <var>y</var> of two ladders resting on the opposite walls of a narrow, level
|
7
7
|
street. We are also given the height <var>h</var> above the street where the two
|
8
8
|
ladders cross and we are asked to find the width of the street (<var>w</var>).\n\n
|
9
|
-
![](/
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
9
|
+
![]({{ images_dir }}/p_309_ladders.gif)\n\nHere, we are only concerned with instances
|
10
|
+
where all four variables are positive integers. \n\rFor example, if <var>x</var>
|
11
|
+
= 70, <var>y</var> = 119 and <var>h</var> = 30, we can calculate that <var>w</var>
|
12
|
+
= 56.\n\nIn fact, for integer values <var>x</var>, <var>y</var>, <var>h</var> and
|
13
|
+
0 x y x,<var>y</var>,<var>h</var>) producing integer solutions for <var>w</var>:
|
14
|
+
\ \n\r(70, 119, 30), (74, 182, 21), (87, 105, 35), (100, 116, 35) and (119, 175,
|
15
|
+
40).\n\nFor integer values <var>x</var>, <var>y</var>, <var>h</var> and 0 x y x,<var>y</var>,<var>h</var>)
|
16
|
+
produce integer solutions for <var>w</var>?\n\n"
|
data/data/problems/31.yml
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
It is possible to make £2 in the following way:
|
11
11
|
|
12
|
-
> 1 ![×](/
|
12
|
+
> 1 ![×]({{ images_dir }}/symbol_times.gif)£1 + 1 ![×]({{ images_dir }}/symbol_times.gif)50p + 2 ![×]({{ images_dir }}/symbol_times.gif)20p + 1 ![×]({{ images_dir }}/symbol_times.gif)5p + 1 ![×]({{ images_dir }}/symbol_times.gif)2p + 3 ![×]({{ images_dir }}/symbol_times.gif)1p
|
13
13
|
|
14
14
|
How many different ways can £2 be made using any number of coins?
|
15
15
|
|
data/data/problems/310.yml
CHANGED
@@ -5,10 +5,9 @@
|
|
5
5
|
:content: "Alice and Bob play the game Nim Square. \n\rNim Square is just like ordinary
|
6
6
|
three-heap normal play Nim, but the players may only remove a square number of stones
|
7
7
|
from a heap. \n\rThe number of stones in the three heaps is represented by the
|
8
|
-
ordered triple (a,b,c). \n\rIf 0 ![≤](/
|
9
|
-
|
10
|
-
|
11
|
-
number of losing positions for the next player
|
12
|
-
|
13
|
-
|
14
|
-
![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)100 000.\n\n"
|
8
|
+
ordered triple (a,b,c). \n\rIf 0 ![≤]({{ images_dir }}/symbol_le.gif)a ![≤]({{
|
9
|
+
images_dir }}/symbol_le.gif)b ![≤]({{ images_dir }}/symbol_le.gif)c ![≤]({{ images_dir
|
10
|
+
}}/symbol_le.gif)29 then the number of losing positions for the next player is 1160.\n\nFind
|
11
|
+
the number of losing positions for the next player if 0 ![≤]({{ images_dir }}/symbol_le.gif)a
|
12
|
+
![≤]({{ images_dir }}/symbol_le.gif)b ![≤]({{ images_dir }}/symbol_le.gif)c ![≤]({{
|
13
|
+
images_dir }}/symbol_le.gif)100 000.\n\n"
|
data/data/problems/311.yml
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
:id: 311
|
3
3
|
:name: Biclinic Integral Quadrilaterals
|
4
4
|
:url: http://projecteuler.net/problem=311
|
5
|
-
:content: "ABCD is a convex, integer sided quadrilateral with 1 ![≤](
|
6
|
-
AB ![<](/
|
7
|
-
CD ![<](/
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
B(<var>N</var>) be the number of distinct biclinic
|
13
|
-
that satisfy AB<sup>2</sup>+BC<sup>2</sup>+CD<sup>2</sup>+AD<sup>2</sup>
|
14
|
-
<var>N</var>. \n\rWe can verify that B(10
|
15
|
-
B(10 000 000 000).\n\n"
|
5
|
+
:content: "ABCD is a convex, integer sided quadrilateral with 1 ![≤]({{ images_dir
|
6
|
+
}}/symbol_le.gif) AB ![<]({{ images_dir }}/symbol_lt.gif) BC ![<]({{ images_dir
|
7
|
+
}}/symbol_lt.gif) CD ![<]({{ images_dir }}/symbol_lt.gif) AD. \n\rBD has integer
|
8
|
+
length. O is the midpoint of BD. AO has integer length. \n\rWe'll call ABCD a _biclinic
|
9
|
+
integral quadrilateral_ if AO = CO ![≤]({{ images_dir }}/symbol_le.gif) BO = DO.\n\nFor
|
10
|
+
example, the following quadrilateral is a biclinic integral quadrilateral: \n\rAB
|
11
|
+
= 19, BC = 29, CD = 37, AD = 43, BD = 48 and AO = CO = 23.\n\n ![]({{ images_dir
|
12
|
+
}}/p_311_biclinic.gif)\n\nLet B(<var>N</var>) be the number of distinct biclinic
|
13
|
+
integral quadrilaterals ABCD that satisfy AB<sup>2</sup>+BC<sup>2</sup>+CD<sup>2</sup>+AD<sup>2</sup>
|
14
|
+
![≤]({{ images_dir }}/symbol_le.gif) <var>N</var>. \n\rWe can verify that B(10
|
15
|
+
000) = 49 and B(1 000 000) = 38239.\n\nFind B(10 000 000 000).\n\n"
|
data/data/problems/312.yml
CHANGED
@@ -5,10 +5,10 @@
|
|
5
5
|
:content: "- A **Sierpiński graph** of order-1 (<var>S</var><sub>1</sub>) is an equilateral
|
6
6
|
triangle. \n\r- <var>S</var><sub><var>n</var>+1</sub> is obtained from <var>S</var><sub><var>n</var></sub>
|
7
7
|
by positioning three copies of <var>S</var><sub><var>n</var></sub> so that every
|
8
|
-
pair of copies has one common corner.\n\n ![](/
|
8
|
+
pair of copies has one common corner.\n\n ![]({{ images_dir }}/p_312_sierpinskyAt.gif)\n\nLet
|
9
9
|
C(<var>n</var>) be the number of cycles that pass exactly once through all the vertices
|
10
10
|
of <var>S</var><sub><var>n</var></sub>. \n\rFor example, C(3) = 8 because eight
|
11
|
-
such cycles can be drawn on <var>S</var><sub>3</sub>, as shown below:\n\n ![](
|
12
|
-
can also be verified that : \n\rC(1)
|
13
|
-
|
14
|
-
C(C(C(10 000))) mod 13<sup>8</sup>.\n\n"
|
11
|
+
such cycles can be drawn on <var>S</var><sub>3</sub>, as shown below:\n\n ![]({{
|
12
|
+
images_dir }}/p_312_sierpinsky8t.gif)\n\nIt can also be verified that : \n\rC(1)
|
13
|
+
= C(2) = 1 \n\rC(5) = 71328803586048 \n\rC(10 000) mod 10<sup>8</sup> = 37652224
|
14
|
+
\ \n\rC(10 000) mod 13<sup>8</sup> = 617720485\n\nFind C(C(C(10 000))) mod 13<sup>8</sup>.\n\n"
|
data/data/problems/313.yml
CHANGED
@@ -5,13 +5,13 @@
|
|
5
5
|
:content: |+
|
6
6
|
In a sliding game a counter may slide horizontally or vertically into an empty space. The objective of the game is to move the red counter from the top left corner of a grid to the bottom right corner; the space always starts in the bottom right corner. For example, the following sequence of pictures show how the game can be completed in five moves on a 2 by 2 grid.
|
7
7
|
|
8
|
-
![](/
|
8
|
+
![]({{ images_dir }}/p_313_sliding_game_1.gif)
|
9
9
|
|
10
10
|
Let S(m,n) represent the minimum number of moves to complete the game on an m by n grid. For example, it can be verified that S(5,4) = 25.
|
11
11
|
|
12
|
-
![](/
|
12
|
+
![]({{ images_dir }}/p_313_sliding_game_2.gif)
|
13
13
|
|
14
|
-
There are exactly 5482 grids for which S(m,n) = p<sup>2</sup>, where p ![<](/
|
14
|
+
There are exactly 5482 grids for which S(m,n) = p<sup>2</sup>, where p ![<]({{ images_dir }}/symbol_lt.gif) 100 is prime.
|
15
15
|
|
16
|
-
How many grids does S(m,n) = p<sup>2</sup>, where p ![<](/
|
16
|
+
How many grids does S(m,n) = p<sup>2</sup>, where p ![<]({{ images_dir }}/symbol_lt.gif) 10<sup>6</sup> is prime?
|
17
17
|
|
data/data/problems/314.yml
CHANGED
@@ -18,10 +18,9 @@
|
|
18
18
|
inside the square area touching the four sides the area will be equal to π\\*250<sup>2</sup>
|
19
19
|
m<sup>2</sup> and the perimeter will be π\\*500 m, so the enclosed-area/wall-length
|
20
20
|
ratio will also be 125.\n\nHowever, if you cut off from the square four triangles
|
21
|
-
with sides 75 m, 75 m and 75 ![√](/
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
better.\n\n ![](/home/will/src/euler-manager/config/../data/images/p_314_landgrab.gif)\n\nFind
|
21
|
+
with sides 75 m, 75 m and 75 ![√]({{ images_dir }}/symbol_radic.gif)2 m the total
|
22
|
+
area becomes 238750 m<sup>2</sup> and the perimeter becomes 1400+300 ![√]({{ images_dir
|
23
|
+
}}/symbol_radic.gif)2 m. So this gives an enclosed-area/wall-length ratio of 130.87,
|
24
|
+
which is significantly better.\n\n ![]({{ images_dir }}/p_314_landgrab.gif)\n\nFind
|
26
25
|
the maximum enclosed-area/wall-length ratio. \n\rGive your answer rounded to 8
|
27
26
|
places behind the decimal point in the form abc.defghijk.\n\n"
|