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/375.yml
CHANGED
@@ -11,9 +11,8 @@
|
|
11
11
|
\ <td>=<sub> </sub>\n</td>\r\n <td>\n<var>S</var><sub><var>n</var></sub><sup>2</sup>
|
12
12
|
mod 50515093</td>\r\n </tr>\r\n</table></center>\n\nLet A(<var>i</var>, <var>j</var>)
|
13
13
|
be the minimum of the numbers <var>S</var><sub><var>i</var></sub>, <var>S</var><sub><var>i</var>+1</sub>,
|
14
|
-
... , <var>S</var><sub><var>j</var></sub> for <var>i</var> ![≤](/
|
15
|
-
<var>j</var>. \n\rLet M(<var>N</var>) = ΣA(<var>i</var>, <var>j</var>) for 1 ![≤](
|
16
|
-
<var>i</var> ![≤](/
|
17
|
-
|
18
|
-
|
19
|
-
M(2 000 000 000).\n\n"
|
14
|
+
... , <var>S</var><sub><var>j</var></sub> for <var>i</var> ![≤]({{ images_dir }}/symbol_le.gif)
|
15
|
+
<var>j</var>. \n\rLet M(<var>N</var>) = ΣA(<var>i</var>, <var>j</var>) for 1 ![≤]({{
|
16
|
+
images_dir }}/symbol_le.gif) <var>i</var> ![≤]({{ images_dir }}/symbol_le.gif) <var>j</var>
|
17
|
+
![≤]({{ images_dir }}/symbol_le.gif) <var>N</var>. \n\rWe can verify that M(10)
|
18
|
+
= 432256955 and M(10 000) = 3264567774119.\n\nFind M(2 000 000 000).\n\n"
|
data/data/problems/377.yml
CHANGED
@@ -6,5 +6,5 @@
|
|
6
6
|
and that have a digital sum equal to 5, namely: \n\r5, 14, 23, 32, 41, 113, 122,
|
7
7
|
131, 212, 221, 311, 1112, 1121, 1211, 2111 and 11111. \n\rTheir sum is 17891.\n\nLet
|
8
8
|
<var>f</var>(<var>n</var>) be the sum of all positive integers that do not have
|
9
|
-
a zero in their digits and have a digital sum equal to <var>n</var>.\n\nFind ![](
|
10
|
-
|
9
|
+
a zero in their digits and have a digital sum equal to <var>n</var>.\n\nFind ![]({{
|
10
|
+
images_dir }}/sod_13.gif). \n\rGive the last 9 digits as your answer.\n\n"
|
data/data/problems/378.yml
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
so T(<var>n</var>) =\r | \n\n| <var>n</var> (<var>n</var>+1) |\n| 2 |\n\n | \r.\r
|
7
7
|
|\n\nLet dT(<var>n</var>) be the number of divisors of T(<var>n</var>). \n\rE.g.:\rT(7)
|
8
8
|
= 28 and dT(7) = 6.\n\nLet Tr(<var>n</var>) be the number of triples (<var>i</var>,
|
9
|
-
<var>j</var>, <var>k</var>) such that 1 ![≤](/
|
10
|
-
|
9
|
+
<var>j</var>, <var>k</var>) such that 1 ![≤]({{ images_dir }}/symbol_le.gif) <var>i
|
10
|
+
n</var> and dT(<var>i</var>) > dT(<var>j</var>) > dT(<var>k</var>). \n\rTr(20)
|
11
11
|
= 14, Tr(100) = 5772 and Tr(1000) = 11174776.\n\nFind Tr(60 000 000). \n\rGive
|
12
12
|
the last 18 digits of your answer.\n\n"
|
data/data/problems/379.yml
CHANGED
@@ -3,11 +3,10 @@
|
|
3
3
|
:name: Least common multiple count
|
4
4
|
:url: http://projecteuler.net/problem=379
|
5
5
|
:content: "Let <var>f</var>(<var>n</var>) be the number of couples (<var>x</var>,<var>y</var>)
|
6
|
-
with <var>x</var> and <var>y</var> positive integers, <var>x</var> ![≤](
|
7
|
-
<var>y</var> and the least common multiple of <var>x</var> and
|
8
|
-
to <var>n</var>.\n\nLet <var>g</var> be the **summatory function**
|
9
|
-
i.e.: \r<var>g</var>(<var>n</var>) = ![∑](/
|
10
|
-
<var>f</var>(<var>i</var>) for 1 ![≤](/
|
11
|
-
|
12
|
-
|
13
|
-
<var>g</var>(10<sup>12</sup>).\n\n"
|
6
|
+
with <var>x</var> and <var>y</var> positive integers, <var>x</var> ![≤]({{ images_dir
|
7
|
+
}}/symbol_le.gif) <var>y</var> and the least common multiple of <var>x</var> and
|
8
|
+
<var>y</var> equal to <var>n</var>.\n\nLet <var>g</var> be the **summatory function**
|
9
|
+
of <var>f</var>, i.e.: \r<var>g</var>(<var>n</var>) = ![∑]({{ images_dir }}/symbol_sum.gif)
|
10
|
+
<var>f</var>(<var>i</var>) for 1 ![≤]({{ images_dir }}/symbol_le.gif) <var>i</var>
|
11
|
+
![≤]({{ images_dir }}/symbol_le.gif) <var>n</var>.\n\nYou are given that <var>g</var>(10<sup>6</sup>)
|
12
|
+
= 37429395.\n\nFind <var>g</var>(10<sup>12</sup>).\n\n"
|
data/data/problems/38.yml
CHANGED
@@ -2,13 +2,13 @@
|
|
2
2
|
:id: 38
|
3
3
|
:name: Pandigital multiples
|
4
4
|
:url: http://projecteuler.net/problem=38
|
5
|
-
:content: "Take the number 192 and multiply it by each of 1, 2, and 3:\n\n> 192 ![×](
|
6
|
-
1 = 192 \n> \r192 ![×](/
|
7
|
-
2 = 384 \n> \r192 ![×](/
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
:content: "Take the number 192 and multiply it by each of 1, 2, and 3:\n\n> 192 ![×]({{
|
6
|
+
images_dir }}/symbol_times.gif) 1 = 192 \n> \r192 ![×]({{ images_dir }}/symbol_times.gif)
|
7
|
+
2 = 384 \n> \r192 ![×]({{ images_dir }}/symbol_times.gif) 3 = 576\n\nBy concatenating
|
8
|
+
each product we get the 1 to 9 pandigital, 192384576. We will call 192384576 the
|
9
|
+
concatenated product of 192 and (1,2,3)\n\nThe same can be achieved by starting
|
10
|
+
with 9 and multiplying by 1, 2, 3, 4, and 5, giving the pandigital, 918273645, which
|
11
|
+
is the concatenated product of 9 and (1,2,3,4,5).\n\nWhat is the largest 1 to 9
|
12
|
+
pandigital 9-digit number that can be formed as the concatenated product of an integer
|
13
|
+
with (1,2, ... , <var>n</var>) where <var>n</var> ![>]({{ images_dir }}/symbol_gt.gif)
|
14
14
|
1?\n\n"
|
data/data/problems/380.yml
CHANGED
@@ -2,18 +2,15 @@
|
|
2
2
|
:id: 380
|
3
3
|
:name: Amazing Mazes!
|
4
4
|
:url: http://projecteuler.net/problem=380
|
5
|
-
:content: "An m ![×](/
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
maze
|
12
|
-
C(
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
significant digits.\n\nWhen giving your answer, use a lowercase e to separate mantissa
|
18
|
-
and exponent.\rE.g. if the answer is 1234567891011 then the answer format would
|
19
|
-
be 1.2346e12.\n\n"
|
5
|
+
:content: "An m ![×]({{ images_dir }}/symbol_times.gif)n maze is an m ![×]({{ images_dir
|
6
|
+
}}/symbol_times.gif)n rectangular grid with walls placed between grid cells such
|
7
|
+
that there is exactly one path from the top-left square to any other square. \nThe
|
8
|
+
following are examples of a 9 ![×]({{ images_dir }}/symbol_times.gif)12 maze and
|
9
|
+
a 15 ![×]({{ images_dir }}/symbol_times.gif)20 maze:\n\n![]({{ images_dir }}/p_380_mazes.gif)\n\nLet
|
10
|
+
C(m,n) be the number of distinct m ![×]({{ images_dir }}/symbol_times.gif)n mazes.
|
11
|
+
Mazes which can be formed by rotation and reflection from another maze are considered
|
12
|
+
distinct.\n\nIt can be verified that C(1,1) = 1, C(2,2) = 4, C(3,4) = 2415, and
|
13
|
+
C(9,12) = 2.5720e46 (in scientific notation rounded to 5 significant digits). \n\rFind
|
14
|
+
C(100,500) and write your answer in scientific notation rounded to 5 significant
|
15
|
+
digits.\n\nWhen giving your answer, use a lowercase e to separate mantissa and exponent.\rE.g.
|
16
|
+
if the answer is 1234567891011 then the answer format would be 1.2346e12.\n\n"
|
data/data/problems/381.yml
CHANGED
@@ -2,14 +2,11 @@
|
|
2
2
|
:id: 381
|
3
3
|
:name: (prime-k) factorial
|
4
4
|
:url: http://projecteuler.net/problem=381
|
5
|
-
:content: "For a prime p let S(p) = ( ![∑](/
|
6
|
-
mod(p) for 1 ![≤](/
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
p ![<](/
|
13
|
-
![∑](/home/will/src/euler-manager/config/../data/images/symbol_sum.gif)S(p) for
|
14
|
-
5 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) p ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)
|
15
|
-
10<sup>8</sup>.\n\n"
|
5
|
+
:content: "For a prime p let S(p) = ( ![∑]({{ images_dir }}/symbol_sum.gif)(p-k)!)
|
6
|
+
mod(p) for 1 ![≤]({{ images_dir }}/symbol_le.gif) k ![≤]({{ images_dir }}/symbol_le.gif)
|
7
|
+
5.\n\nFor example, if p=7, \n\r(7-1)! + (7-2)! + (7-3)! + (7-4)! + (7-5)! = 6!
|
8
|
+
+ 5! + 4! + 3! + 2! = 720+120+24+6+2 = 872. \n \rAs 872 mod(7) = 4, S(7) = 4.\n\nIt
|
9
|
+
can be verified that ![∑]({{ images_dir }}/symbol_sum.gif)S(p) = 480 for 5 ![≤]({{
|
10
|
+
images_dir }}/symbol_le.gif) p ![<]({{ images_dir }}/symbol_lt.gif) 100.\n\nFind
|
11
|
+
![∑]({{ images_dir }}/symbol_sum.gif)S(p) for 5 ![≤]({{ images_dir }}/symbol_le.gif)
|
12
|
+
p ![<]({{ images_dir }}/symbol_lt.gif) 10<sup>8</sup>.\n\n"
|
data/data/problems/382.yml
CHANGED
@@ -12,9 +12,9 @@
|
|
12
12
|
\ \n\rThe sets {1, 2, 3} and {2, 3, 4, 9} do not generate any polygon at all.\n\nConsider
|
13
13
|
the sequence s, defined as follows:\n\n- s<sub>1</sub> = 1, s<sub>2</sub> = 2, s<sub>3</sub>
|
14
14
|
= 3\r\n- s<sub><var>n</var></sub> = s<sub><var>n</var>-1</sub> + s<sub><var>n</var>-3</sub>
|
15
|
-
for <var>n</var> ![>](/
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
15
|
+
for <var>n</var> ![>]({{ images_dir }}/symbol_gt.gif) 3.\r\n\nLet U<sub><var>n</var></sub>
|
16
|
+
be the set {s<sub>1</sub>, s<sub>2</sub>, ..., s<sub><var>n</var></sub>}. For example,
|
17
|
+
U<sub>10</sub> = {1, 2, 3, 4, 6, 9, 13, 19, 28, 41}. \n\rLet f(<var>n</var>) be
|
18
|
+
the number of subsets of U<sub><var>n</var></sub> which generate at least one polygon.
|
19
|
+
\ \n\rFor example, f(5) = 7, f(10) = 501 and f(25) = 18635853.\n\nFind the last
|
20
|
+
9 digits of f(10<sup>18</sup>).\n\n"
|
data/data/problems/383.yml
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
:content: "Let f<sub>5</sub>(<var>n</var>) be the largest integer <var>x</var> for
|
6
6
|
which 5<sup><var>x</var></sup> divides <var>n</var>. \n\rFor example, f<sub>5</sub>(625000)
|
7
7
|
= 7.\n\nLet T<sub>5</sub>(<var>n</var>) be the number of integers <var>i</var> which
|
8
|
-
satisfy f<sub>5</sub>((2·<var>i</var>-1)!) 5(<var>i</var>!) and 1 ![≤](
|
9
|
-
<var>i</var> ![≤](/
|
10
|
-
|
11
|
-
|
8
|
+
satisfy f<sub>5</sub>((2·<var>i</var>-1)!) 5(<var>i</var>!) and 1 ![≤]({{ images_dir
|
9
|
+
}}/symbol_le.gif) <var>i</var> ![≤]({{ images_dir }}/symbol_le.gif) <var>n</var>.
|
10
|
+
\ \n\rIt can be verified that T<sub>5</sub>(10<sup>3</sup>) = 68 and T<sub>5</sub>(10<sup>9</sup>)
|
11
|
+
= 2408210.\n\nFind T<sub>5</sub>(10<sup>18</sup>).\n\n"
|
data/data/problems/384.yml
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
binary expansion of n (possibly overlapping).\r \nE.g.: a(5) = a(101<sub>2</sub>)
|
7
7
|
= 0, a(6) = a(110<sub>2</sub>) = 1, a(7) = a(111<sub>2</sub>) = 2\n\nDefine the
|
8
8
|
sequence b(n) = (-1)<sup>a(n)</sup>.\r \nThis sequence is called the **Rudin-Shapiro**
|
9
|
-
sequence.\n\nAlso consider the summatory sequence of b(n): ![](/
|
9
|
+
sequence.\n\nAlso consider the summatory sequence of b(n): ![]({{ images_dir }}/p_384_formula.gif).\n\nThe
|
10
10
|
first couple of values of these sequences are:\r \n<tt>n &nbsp 0 &nbsp
|
11
11
|
1 &nbsp 2 &nbsp 3 &nbsp 4 &nbsp 5 &nbsp 6 &nbsp
|
12
12
|
7\r\n<br>a(n) &nbsp 0 &nbsp 0 &nbsp 0 &nbsp 1 &nbsp
|
@@ -15,10 +15,9 @@
|
|
15
15
|
1\r\n<br>s(n) &nbsp 1 &nbsp 2 &nbsp 3 &nbsp 2 &nbsp
|
16
16
|
3 &nbsp 4 &nbsp 3 &nbsp 4</tt>\n\nThe sequence s(n) has the
|
17
17
|
remarkable property that all elements are positive and every positive integer k
|
18
|
-
occurs exactly k times.\n\nDefine g(t,c), with 1 ![≤](/
|
19
|
-
c ![≤](/
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)45.\n\n"
|
18
|
+
occurs exactly k times.\n\nDefine g(t,c), with 1 ![≤]({{ images_dir }}/symbol_le.gif)
|
19
|
+
c ![≤]({{ images_dir }}/symbol_le.gif) t, as the index in s(n) for which t occurs
|
20
|
+
for the c'th time in s(n).\r \nE.g.: g(3,3) = 6, g(4,2) = 7 and g(54321,12345)
|
21
|
+
= 1220847710.\n\nLet F(n) be the fibonacci sequence defined by:\r \nF(0)=F(1)=1
|
22
|
+
and\r \nF(n)=F(n-1)+F(n-2) for n>1.\n\nDefine GF(t)=g(F(t),F(t-1)).\n\nFind ΣGF(t)
|
23
|
+
for 2 ![≤]({{ images_dir }}/symbol_le.gif)t ![≤]({{ images_dir }}/symbol_le.gif)45.\n\n"
|
data/data/problems/385.yml
CHANGED
@@ -3,14 +3,14 @@
|
|
3
3
|
:name: Ellipses inside triangles
|
4
4
|
:url: http://projecteuler.net/problem=385
|
5
5
|
:content: "For any triangle <var>T</var> in the plane, it can be shown that there
|
6
|
-
is a unique ellipse with largest area that is completely inside <var>T</var>.\n\n![](
|
7
|
-
a given <var>n</var>, consider triangles
|
8
|
-
of <var>T</var> have integer coordinates
|
9
|
-
n, and \n\r- the **foci**
|
10
|
-
are ( ![√](
|
11
|
-
and (- ![√](/
|
12
|
-
|
13
|
-
|
6
|
+
is a unique ellipse with largest area that is completely inside <var>T</var>.\n\n![]({{
|
7
|
+
images_dir }}/p_385_ellipsetriangle.png)\n\nFor a given <var>n</var>, consider triangles
|
8
|
+
<var>T</var> such that: \n\r- the vertices of <var>T</var> have integer coordinates
|
9
|
+
with absolute value ![≤]({{ images_dir }}/symbol_le.gif) n, and \n\r- the **foci**
|
10
|
+
<sup>1</sup> of the largest-area ellipse inside <var>T</var> are ( ![√]({{ images_dir
|
11
|
+
}}/symbol_radic.gif)13,0) and (- ![√]({{ images_dir }}/symbol_radic.gif)13,0). \n\rLet
|
12
|
+
A(<var>n</var>) be the sum of the areas of all such triangles.\n\nFor example, if
|
13
|
+
<var>n</var> = 8, there are two such triangles. Their vertices are (-4,-3),(-4,3),(8,0)
|
14
14
|
and (4,3),(4,-3),(-8,0), and the area of each triangle is 36. Thus A(8) = 36 + 36
|
15
15
|
= 72.\n\nIt can be verified that A(10) = 252, A(100) = 34632 and A(1000) = 3529008.\n\nFind
|
16
16
|
A(1 000 000 000).\n\n<sup>1</sup>The **foci** (plural of **focus** ) of an ellipse
|
data/data/problems/386.yml
CHANGED
@@ -10,5 +10,5 @@
|
|
10
10
|
15, 30}\r \n{2, 5, 6} is not an antichain of <var>S</var>(30).\r \n{2, 3, 5} is
|
11
11
|
an antichain of <var>S</var>(30).\n\nLet <var>N</var>(<var>n</var>) be the maximum
|
12
12
|
length of an antichain of <var>S</var>(<var>n</var>).\n\nFind Σ<var>N</var>(<var>n</var>)
|
13
|
-
for 1 ![≤](/
|
14
|
-
|
13
|
+
for 1 ![≤]({{ images_dir }}/symbol_le.gif) <var>n</var> ![≤]({{ images_dir }}/symbol_le.gif)
|
14
|
+
10<sup>8</sup>\n\n"
|
data/data/problems/388.yml
CHANGED
@@ -2,9 +2,8 @@
|
|
2
2
|
:id: 388
|
3
3
|
:name: Distinct Lines
|
4
4
|
:url: http://projecteuler.net/problem=388
|
5
|
-
:content: "Consider all lattice points (a,b,c) with 0 ![≤](/
|
6
|
-
a,b,c ![≤](/
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
nine digits.\n\n"
|
5
|
+
:content: "Consider all lattice points (a,b,c) with 0 ![≤]({{ images_dir }}/symbol_le.gif)
|
6
|
+
a,b,c ![≤]({{ images_dir }}/symbol_le.gif) N.\n\nFrom the origin O(0,0,0) all lines
|
7
|
+
are drawn to the other lattice points. \n\rLet D(N) be the number of _distinct_
|
8
|
+
such lines.\n\nYou are given that D(1 000 000) = 831909254469114121.\n\nFind D(10<sup>10</sup>).
|
9
|
+
Give as your answer the first nine digits followed by the last nine digits.\n\n"
|
data/data/problems/39.yml
CHANGED
@@ -7,5 +7,5 @@
|
|
7
7
|
|
8
8
|
{20,48,52}, {24,45,51}, {30,40,50}
|
9
9
|
|
10
|
-
For which value of _p_ ![≤](/
|
10
|
+
For which value of _p_ ![≤]({{ images_dir }}/symbol_le.gif) 1000, is the number of solutions maximised?
|
11
11
|
|
data/data/problems/390.yml
CHANGED
@@ -2,12 +2,10 @@
|
|
2
2
|
:id: 390
|
3
3
|
:name: Triangles with non rational sides and integral area
|
4
4
|
:url: http://projecteuler.net/problem=390
|
5
|
-
:content: "Consider the triangle with sides ![√](/
|
6
|
-
![√](/
|
7
|
-
![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)68.\rIt
|
5
|
+
:content: "Consider the triangle with sides ![√]({{ images_dir }}/symbol_radic.gif)5,
|
6
|
+
![√]({{ images_dir }}/symbol_radic.gif)65 and ![√]({{ images_dir }}/symbol_radic.gif)68.\rIt
|
8
7
|
can be shown that this triangle has area 9.\n\nS(n) is the sum of the areas of all
|
9
|
-
triangles with sides ![√](/
|
10
|
-
![√](/
|
11
|
-
and ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)(b<sup>2</sup>+c<sup>2</sup>)
|
8
|
+
triangles with sides ![√]({{ images_dir }}/symbol_radic.gif)(1+b<sup>2</sup>), ![√]({{
|
9
|
+
images_dir }}/symbol_radic.gif)(1+c<sup>2</sup>) and ![√]({{ images_dir }}/symbol_radic.gif)(b<sup>2</sup>+c<sup>2</sup>)
|
12
10
|
(for positive integers b and c ) that have an integral area not exceeding n.\n\nThe
|
13
11
|
example triangle has b=2 and c=8.\n\nS(10<sup>6</sup>)=18018206.\n\nFind S(10<sup>10</sup>).\n\n"
|
data/data/problems/391.yml
CHANGED
@@ -5,21 +5,20 @@
|
|
5
5
|
:content: "Let <var>s<sub>k</sub></var> be the number of 1’s when writing the numbers
|
6
6
|
from 0 to <var>k</var> in binary. \n\rFor example, writing 0 to 5 in binary, we
|
7
7
|
have 0, 1, 10, 11, 100, 101. There are seven 1’s, so <var>s</var><sub>5</sub> =
|
8
|
-
7. \n\rThe sequence S = {<var>s<sub>k</sub></var> : <var>k</var> ![≥](
|
9
|
-
0} starts {0, 1, 2, 4, 5, 7, 9, 12, ...}.\n\nA game is played
|
10
|
-
the game starts, a number <var>n</var> is chosen. A counter
|
11
|
-
at 0. At each turn, the player chooses a number from 1 to <var>n</var>
|
12
|
-
and increases <var>c</var> by that number. The resulting value of <var>c</var>
|
13
|
-
be a member of S. If there are no more valid moves, the player loses.\n\nFor
|
14
|
-
\
|
15
|
-
<var>c</var> becomes 0 + 4 = 4. \n\rPlayer 2 chooses 5, so <var>c</var> becomes
|
8
|
+
7. \n\rThe sequence S = {<var>s<sub>k</sub></var> : <var>k</var> ![≥]({{ images_dir
|
9
|
+
}}/symbol_ge.gif) 0} starts {0, 1, 2, 4, 5, 7, 9, 12, ...}.\n\nA game is played
|
10
|
+
by two players. Before the game starts, a number <var>n</var> is chosen. A counter
|
11
|
+
<var>c</var> starts at 0. At each turn, the player chooses a number from 1 to <var>n</var>
|
12
|
+
(inclusive) and increases <var>c</var> by that number. The resulting value of <var>c</var>
|
13
|
+
must be a member of S. If there are no more valid moves, the player loses.\n\nFor
|
14
|
+
example: \n\rLet <var>n</var> = 5. <var>c</var> starts at 0. \n\rPlayer 1 chooses
|
15
|
+
4, so <var>c</var> becomes 0 + 4 = 4. \n\rPlayer 2 chooses 5, so <var>c</var> becomes
|
16
16
|
4 + 5 = 9. \n\rPlayer 1 chooses 3, so <var>c</var> becomes 9 + 3 = 12. \n\retc.
|
17
17
|
\ \n\rNote that <var>c</var> must always belong to S, and each player can increase
|
18
18
|
<var>c</var> by at most <var>n</var>.\n\nLet M(<var>n</var>) be the highest number
|
19
19
|
the first player can choose at her first turn to force a win, and M(<var>n</var>)
|
20
20
|
= 0 if there is no such move. For example, M(2) = 2, M(7) = 1 and M(20) = 4.\n\nGiven
|
21
|
-
Σ(M(<var>n</var>))<sup>3</sup> = 8150 for 1 ![≤](/
|
22
|
-
<var>n</var> ![≤](/
|
23
|
-
|
24
|
-
<var>n</var> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
|
21
|
+
Σ(M(<var>n</var>))<sup>3</sup> = 8150 for 1 ![≤]({{ images_dir }}/symbol_le.gif)
|
22
|
+
<var>n</var> ![≤]({{ images_dir }}/symbol_le.gif) 20.\n\nFind Σ(M(<var>n</var>))<sup>3</sup>
|
23
|
+
for 1 ![≤]({{ images_dir }}/symbol_le.gif) <var>n</var> ![≤]({{ images_dir }}/symbol_le.gif)
|
25
24
|
1000.\n\n"
|
data/data/problems/392.yml
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
the origin\">unit circle</dfn>, black otherwise.\nFor this problem we would like
|
15
15
|
you to find the postions of the remaining N inner horizontal and N inner vertical
|
16
16
|
gridlines so that the area occupied by the red cells is minimized.\r\r\n\nE.g. here
|
17
|
-
is a picture of the solution for N = 10:\n\n![](/
|
17
|
+
is a picture of the solution for N = 10:\n\n![]({{ images_dir }}/p392_gridlines.png)\n\n\r\r\rThe
|
18
18
|
area occupied by the red cells for N = 10 rounded to 10 digits behind the decimal
|
19
19
|
point is 3.3469640797.\r\r\n\nFind the positions for N = 400. \n \rGive as your
|
20
20
|
answer the area occupied by the red cells rounded to 10 digits behind the decimal
|
data/data/problems/393.yml
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
:id: 393
|
3
3
|
:name: Migrating ants
|
4
4
|
:url: http://projecteuler.net/problem=393
|
5
|
-
:content: "An <var>n</var> ![×](/
|
6
|
-
|
5
|
+
:content: "An <var>n</var> ![×]({{ images_dir }}/symbol_times.gif)<var>n</var> grid
|
6
|
+
of squares contains <var>n</var><sup>2</sup> ants, one ant per square. \n\rAll
|
7
7
|
ants decide to move simultaneously to an adjacent square (usually 4 possibilities,
|
8
8
|
except for ants on the edge of the grid or at the corners). \n\rWe define <var>f</var>(<var>n</var>)
|
9
9
|
to be the number of ways this can happen without any ants ending on the same square
|
data/data/problems/394.yml
CHANGED
@@ -10,10 +10,9 @@
|
|
10
10
|
divide the remaining pie into three pieces. \n \r- Going counterclockwise from
|
11
11
|
the initial cut, he takes the first two pie pieces and eats them. \n\rWhen less
|
12
12
|
than a fraction <var>F</var> of pie remains, he does not repeat this procedure.
|
13
|
-
Instead, he eats all of the remaining pie.\n\n![](/
|
14
|
-
<var>x</var> ![≥](/
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
2.1215732071.\n\nFind E(40) rounded to 10 decimal places behind the decimal point.\n\n"
|
13
|
+
Instead, he eats all of the remaining pie.\n\n![]({{ images_dir }}/p_394_eatpie.gif)\n\nFor
|
14
|
+
<var>x</var> ![≥]({{ images_dir }}/symbol_ge.gif) 1, let E(<var>x</var>) be the
|
15
|
+
expected number of times Jeff repeats the procedure above with <var>F</var> = <sup>1</sup>/<sub><var>x</var></sub>.
|
16
|
+
\ \n\rIt can be verified that E(1) = 1, E(2) ![≈]({{ images_dir }}/symbol_asymp.gif)
|
17
|
+
1.2676536759, and E(7.5) ![≈]({{ images_dir }}/symbol_asymp.gif) 2.1215732071.\n\nFind
|
18
|
+
E(40) rounded to 10 decimal places behind the decimal point.\n\n"
|
data/data/problems/395.yml
CHANGED
@@ -11,8 +11,8 @@
|
|
11
11
|
triangle, with one of its sides coinciding with that leg.\n3. Repeat this procedure
|
12
12
|
for both squares, considering as their bases the sides touching the triangle.\n\rThe
|
13
13
|
resulting figure, after an infinite number of iterations, is the Pythagorean tree.\r\r\r\n
|
14
|
-
![](/
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
![]({{ images_dir }}/p_395_pythagorean.gif)\n\nIt can be shown that there exists
|
15
|
+
at least one rectangle, whose sides are parallel to the largest square of the Pythagorean
|
16
|
+
tree, which encloses the Pythagorean tree completely.\n\nFind the smallest area
|
17
|
+
possible for such a bounding rectangle, and give your answer rounded to 10 decimal
|
18
|
+
places.\n\n"
|
data/data/problems/396.yml
CHANGED
@@ -4,20 +4,18 @@
|
|
4
4
|
:url: http://projecteuler.net/problem=396
|
5
5
|
:content: "For any positive integer n, the **nth weak Goodstein sequence** {g<sub>1</sub>,
|
6
6
|
g<sub>2</sub>, g<sub>3</sub>, ...} is defined as:\n\n- g<sub>1</sub> = <var>n</var>\n-
|
7
|
-
for <var>k</var> ![>](/
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
=
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
<var>n</var> ![
|
21
|
-
|
22
|
-
<var>n</var> ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)
|
23
|
-
16.\n\n"
|
7
|
+
for <var>k</var> ![>]({{ images_dir }}/symbol_gt.gif) 1, g<sub><var>k</var></sub>
|
8
|
+
is obtained by writing g<sub><var>k</var>-1</sub> in base <var>k</var>, interpreting
|
9
|
+
it as a base <var>k</var> + 1 number, and subtracting 1.\r\n\rThe sequence terminates
|
10
|
+
when g<sub><var>k</var></sub> becomes 0.\r\r\n\nFor example, the 6th weak Goodstein
|
11
|
+
sequence is {6, 11, 17, 25, ...}:\n\n- g<sub>1</sub> = 6.\r\n- g<sub>2</sub> = 11
|
12
|
+
since 6 = 110<sub>2</sub>, 110<sub>3</sub> = 12, and 12 - 1 = 11.\r\n- g<sub>3</sub>
|
13
|
+
= 17 since 11 = 102<sub>3</sub>, 102<sub>4</sub> = 18, and 18 - 1 = 17.\r\n- g<sub>4</sub>
|
14
|
+
= 25 since 17 = 101<sub>4</sub>, 101<sub>5</sub> = 26, and 26 - 1 = 25.\r\n\rand
|
15
|
+
so on.\r\r\n\nIt can be shown that every weak Goodstein sequence terminates.\n\nLet
|
16
|
+
G(<var>n</var>) be the number of nonzero elements in the <var>n</var>th weak Goodstein
|
17
|
+
sequence. \n\rIt can be verified that G(2) = 3, G(4) = 21 and G(6) = 381. \n\rIt
|
18
|
+
can also be verified that ΣG(<var>n</var>) = 2517 for 1 ![≤]({{ images_dir }}/symbol_le.gif)
|
19
|
+
<var>n</var> ![<]({{ images_dir }}/symbol_lt.gif) 8.\n\nFind the last 9 digits of
|
20
|
+
ΣG(<var>n</var>) for 1 ![≤]({{ images_dir }}/symbol_le.gif) <var>n</var> ![<]({{
|
21
|
+
images_dir }}/symbol_lt.gif) 16.\n\n"
|
data/data/problems/397.yml
CHANGED
@@ -7,11 +7,8 @@
|
|
7
7
|
and C(<var>c</var>, <var>c</var><sup>2</sup>/<var>k</var>) are chosen.\n\nLet F(<var>K</var>,
|
8
8
|
<var>X</var>) be the number of the integer quadruplets (<var>k</var>, <var>a</var>,
|
9
9
|
<var>b</var>, <var>c</var>) such that at least one angle of the triangle ABC is
|
10
|
-
45-degree, with 1 ![≤](/
|
11
|
-
<var>
|
12
|
-
<var>
|
13
|
-
<var>
|
14
|
-
<
|
15
|
-
<var>c</var> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
|
16
|
-
<var>X</var>.\n\nFor example, F(1, 10) = 41 and F(10, 100) = 12492. \n\rFind F(10<sup>6</sup>,
|
17
|
-
10<sup>9</sup>).\n\n"
|
10
|
+
45-degree, with 1 ![≤]({{ images_dir }}/symbol_le.gif) <var>k</var> ![≤]({{ images_dir
|
11
|
+
}}/symbol_le.gif) <var>K</var> and -<var>X</var> ![≤]({{ images_dir }}/symbol_le.gif)
|
12
|
+
<var>a</var> ![<]({{ images_dir }}/symbol_lt.gif) <var>b</var> ![<]({{ images_dir
|
13
|
+
}}/symbol_lt.gif) <var>c</var> ![≤]({{ images_dir }}/symbol_le.gif) <var>X</var>.\n\nFor
|
14
|
+
example, F(1, 10) = 41 and F(10, 100) = 12492. \n\rFind F(10<sup>6</sup>, 10<sup>9</sup>).\n\n"
|
data/data/problems/4.yml
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
:name: Largest palindrome product
|
4
4
|
:url: http://projecteuler.net/problem=4
|
5
5
|
:content: |+
|
6
|
-
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 ![×](/
|
6
|
+
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 ![×]({{ images_dir }}/symbol_times.gif) 99.
|
7
7
|
|
8
8
|
Find the largest palindrome made from the product of two 3-digit numbers.
|
9
9
|
|
data/data/problems/40.yml
CHANGED
@@ -11,5 +11,5 @@
|
|
11
11
|
|
12
12
|
If _d_<sub><i>n</i></sub> represents the _n_<sup>th</sup> digit of the fractional part, find the value of the following expression.
|
13
13
|
|
14
|
-
_d_<sub>1</sub> ![×](/
|
14
|
+
_d_<sub>1</sub> ![×]({{ images_dir }}/symbol_times.gif) _d_<sub>10</sub> ![×]({{ images_dir }}/symbol_times.gif) _d_<sub>100</sub> ![×]({{ images_dir }}/symbol_times.gif) _d_<sub>1000</sub> ![×]({{ images_dir }}/symbol_times.gif) _d_<sub>10000</sub> ![×]({{ images_dir }}/symbol_times.gif) _d_<sub>100000</sub> ![×]({{ images_dir }}/symbol_times.gif) _d_<sub>1000000</sub>
|
15
15
|
|
data/data/problems/400.yml
CHANGED
@@ -9,9 +9,8 @@
|
|
9
9
|
and removes that node along with the subtree rooted at that node. \n\rThe player
|
10
10
|
who is forced to take the root node of the entire tree loses.\n\nHere are the winning
|
11
11
|
moves of the first player on the first turn for T(<var>k</var>) from <var>k</var>=1
|
12
|
-
to <var>k</var>=6.\n\n![](/
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
=
|
17
|
-
of your answer.\n\n"
|
12
|
+
to <var>k</var>=6.\n\n![]({{ images_dir }}/p400_winning.png)\n\n\r\r\r\rLet <var>f</var>(<var>k</var>)
|
13
|
+
be the number of winning moves of the first player (i.e. the moves for which the
|
14
|
+
second player has no winning strategy) on the first turn of the game when this game
|
15
|
+
is played on T(<var>k</var>).\r\r\r\n\nFor example, <var>f</var>(5) = 1 and <var>f</var>(10)
|
16
|
+
= 17.\n\nFind <var>f</var>(10000). Give the last 18 digits of your answer.\n\n"
|
data/data/problems/401.yml
CHANGED
@@ -5,6 +5,6 @@
|
|
5
5
|
:content: "The divisors of 6 are 1,2,3 and 6. \n\rThe sum of the squares of these
|
6
6
|
numbers is 1+4+9+36=50.\n\nLet sigma2(n) represent the sum of the squares of the
|
7
7
|
divisors of n.\rThus sigma2(6)=50.\n\n\rLet SIGMA2 represent the summatory function
|
8
|
-
of sigma2, that is SIGMA2(n)= ![∑](/
|
9
|
-
|
8
|
+
of sigma2, that is SIGMA2(n)= ![∑]({{ images_dir }}/symbol_sum.gif)sigma2(i) for
|
9
|
+
i=1 to n. \n\rThe first 6 values of SIGMA2 are: 1,6,16,37,63 and 113.\r\r\n\nFind
|
10
10
|
SIGMA2(10<sup>15</sup>) modulo 10<sup>9</sup>.\n\n"
|
data/data/problems/402.yml
CHANGED
@@ -9,12 +9,11 @@
|
|
9
9
|
such that <var>n</var><sup>4</sup> + <var>a</var><var>n</var><sup>3</sup> + <var>b</var><var>n</var><sup>2</sup>
|
10
10
|
+ <var>c</var><var>n</var> is a multiple of <var>m</var> for all integers <var>n</var>.
|
11
11
|
For example, M(4, 2, 5) = 6.\n\nAlso, define S(<var>N</var>) as the sum of M(<var>a</var>,
|
12
|
-
<var>b</var>, <var>c</var>) for all 0 ![<](/
|
13
|
-
<var>
|
14
|
-
|
15
|
-
|
16
|
-
=
|
17
|
-
|
18
|
-
2
|
19
|
-
<var>k</var> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
|
12
|
+
<var>b</var>, <var>c</var>) for all 0 ![<]({{ images_dir }}/symbol_lt.gif) <var>a</var>,
|
13
|
+
<var>b</var>, <var>c</var> ![≤]({{ images_dir }}/symbol_le.gif) <var>N</var>.\n\nWe
|
14
|
+
can verify that S(10) = 1972 and S(10000) = 2024258331114.\n\nLet F<sub><var>k</var></sub>
|
15
|
+
be the Fibonacci sequence: \n\rF<sub>0</sub> = 0, F<sub>1</sub> = 1 and \n\rF<sub><var>k</var></sub>
|
16
|
+
= F<sub><var>k</var>-1</sub> + F<sub><var>k</var>-2</sub> for <var>k</var> ![≥]({{
|
17
|
+
images_dir }}/symbol_ge.gif) 2.\n\nFind the last 9 digits of Σ S(F<sub><var>k</var></sub>)
|
18
|
+
for 2 ![≤]({{ images_dir }}/symbol_le.gif) <var>k</var> ![≤]({{ images_dir }}/symbol_le.gif)
|
20
19
|
1234567890123.\n\n"
|
data/data/problems/403.yml
CHANGED
@@ -5,13 +5,12 @@
|
|
5
5
|
:content: "For integers <var>a</var> and <var>b</var>, we define <var>D</var>(<var>a</var>,
|
6
6
|
<var>b</var>) as the domain enclosed by the parabola <var>y</var> = <var>x</var><sup>2</sup>
|
7
7
|
and the line <var>y</var> = <var>a</var>·<var>x</var> + <var>b</var>: \n<var>D</var>(<var>a</var>,
|
8
|
-
<var>b</var>) = { (<var>x</var>, <var>y</var>) | <var>x</var><sup>2</sup> ![≤](
|
9
|
-
<var>y</var> ![≤](/
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
S(10<sup>12</sup>). Give your answer mod 10<sup>8</sup>.\n\n"
|
8
|
+
<var>b</var>) = { (<var>x</var>, <var>y</var>) | <var>x</var><sup>2</sup> ![≤]({{
|
9
|
+
images_dir }}/symbol_le.gif) <var>y</var> ![≤]({{ images_dir }}/symbol_le.gif) <var>a</var>·<var>x</var>
|
10
|
+
+ <var>b</var> }.\n\nL(<var>a</var>, <var>b</var>) is defined as the number of lattice
|
11
|
+
points contained in <var>D</var>(<var>a</var>, <var>b</var>). \n\rFor example,
|
12
|
+
L(1, 2) = 8 and L(2, -1) = 1.\n\nWe also define S(<var>N</var>) as the sum of L(<var>a</var>,
|
13
|
+
<var>b</var>) for all the pairs (<var>a</var>, <var>b</var>) such that the area
|
14
|
+
of <var>D</var>(<var>a</var>, <var>b</var>) is a rational number and |<var>a</var>|,|<var>b</var>|
|
15
|
+
![≤]({{ images_dir }}/symbol_le.gif) <var>N</var>. \n\rWe can verify that S(5)
|
16
|
+
= 344 and S(100) = 26709528.\n\nFind S(10<sup>12</sup>). Give your answer mod 10<sup>8</sup>.\n\n"
|
data/data/problems/404.yml
CHANGED
@@ -5,15 +5,14 @@
|
|
5
5
|
:content: "E<sub><var>a</var></sub> is an ellipse with an equation of the form x<sup>2</sup>
|
6
6
|
+ 4y<sup>2</sup> = 4<var>a</var><sup>2</sup>. \n\rE<sub><var>a</var></sub>' is
|
7
7
|
the rotated image of E<sub><var>a</var></sub> by θ degrees counterclockwise around
|
8
|
-
the origin O(0, 0) for 0° ![<](/
|
9
|
-
|
10
|
-
![](/home/will/src/euler-manager/config/../data/images/p_404_c_ellipse.gif)\n\n<var>b</var>
|
8
|
+
the origin O(0, 0) for 0° ![<]({{ images_dir }}/symbol_lt.gif) θ ![<]({{ images_dir
|
9
|
+
}}/symbol_lt.gif) 90°.\n\n ![]({{ images_dir }}/p_404_c_ellipse.gif)\n\n<var>b</var>
|
11
10
|
is the distance to the origin of the two intersection points closest to the origin
|
12
11
|
and <var>c</var> is the distance of the two other intersection points. \n\rWe call
|
13
12
|
an ordered triplet (<var>a</var>, <var>b</var>, <var>c</var>) a _canonical ellipsoidal
|
14
13
|
triplet_ if <var>a</var>, <var>b</var> and <var>c</var> are positive integers. \n\rFor
|
15
14
|
example, (209, 247, 286) is a canonical ellipsoidal triplet.\n\nLet C(<var>N</var>)
|
16
15
|
be the number of distinct canonical ellipsoidal triplets (<var>a</var>, <var>b</var>,
|
17
|
-
<var>c</var>) for <var>a</var> ![≤](/
|
18
|
-
|
19
|
-
|
16
|
+
<var>c</var>) for <var>a</var> ![≤]({{ images_dir }}/symbol_le.gif) <var>N</var>.
|
17
|
+
\ \n\rIt can be verified that C(10<sup>3</sup>) = 7, C(10<sup>4</sup>) = 106 and
|
18
|
+
C(10<sup>6</sup>) = 11845.\n\nFind C(10<sup>17</sup>).\n\n"
|