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/335.yml
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
:content: |+
|
6
6
|
Whenever Peter feels bored, he places some bowls, containing one bean each, in a circle. After this, he takes all the beans out of a certain bowl and drops them one by one in the bowls going clockwise. He repeats this, starting from the bowl he dropped the last bean in, until the initial situation appears again. For example with 5 bowls he acts as follows:
|
7
7
|
|
8
|
-
![](/
|
8
|
+
![]({{ images_dir }}/p_335_mancala.gif)
|
9
9
|
|
10
10
|
So with 5 bowls it takes Peter 15 moves to return to the initial situation.
|
11
11
|
|
12
12
|
Let <var>M</var>(<var>x</var>) represent the number of moves required to return to the initial situation, starting with <var>x</var> bowls. Thus, <var>M</var>(5) = 15. It can also be verified that <var>M</var>(100) = 10920.
|
13
13
|
|
14
|
-
Find ![](/
|
14
|
+
Find ![]({{ images_dir }}/p_335_sum.gif)<var>M</var>(2<sup><var>k</var></sup>+1). Give your answer modulo 7<sup>9</sup>.
|
15
15
|
|
data/data/problems/336.yml
CHANGED
@@ -16,7 +16,8 @@
|
|
16
16
|
then carriage B, and so on.\n\nUsing four carriages, the worst possible arrangements
|
17
17
|
for Simon, which we shall call _maximix arrangements_, are DACB and DBAC; each requiring
|
18
18
|
him five rotations (although, using the most efficient approach, they could be solved
|
19
|
-
using just three rotations). The process he uses for DACB is shown below.\n\n ![](
|
20
|
-
can be verified that there are 24 maximix
|
21
|
-
the tenth lexicographic maximix arrangement
|
22
|
-
lexicographic maximix arrangement for eleven
|
19
|
+
using just three rotations). The process he uses for DACB is shown below.\n\n ![]({{
|
20
|
+
images_dir }}/p_336_maximix.gif)\n\nIt can be verified that there are 24 maximix
|
21
|
+
arrangements for six carriages, of which the tenth lexicographic maximix arrangement
|
22
|
+
is DFAECB.\n\nFind the 2011<sup>th</sup> lexicographic maximix arrangement for eleven
|
23
|
+
carriages.\n\n"
|
data/data/problems/337.yml
CHANGED
@@ -4,10 +4,10 @@
|
|
4
4
|
:url: http://projecteuler.net/problem=337
|
5
5
|
:content: "Let {a<sub>1</sub>, a<sub>2</sub>,..., a<sub><var>n</var></sub>} be an
|
6
6
|
integer sequence of length <var>n</var> such that:\n\n- a<sub>1</sub> = 6\n- for
|
7
|
-
all 1 ![≤](/
|
8
|
-
|
9
|
-
|
10
|
-
<var>N</var>. \n\rFor example, S(10) = 4: {6}, {6, 8}, {6, 8,
|
11
|
-
can verify that S(100) = 482073668 and S(10 000) mod 10<sup>8</sup>
|
12
|
-
S(20 000 000) mod 10<sup>8</sup>.\n\n<sup>1</sup> φ denotes
|
13
|
-
.\n\n"
|
7
|
+
all 1 ![≤]({{ images_dir }}/symbol_le.gif) <var>i</var> n : φ(a<sub><var>i</var></sub>)
|
8
|
+
<var>i</var>+1) <var>i</var> <var>i</var>+1 <sup>1</sup>\n\nLet S(<var>N</var>)
|
9
|
+
be the number of such sequences with a<sub><var>n</var></sub> ![≤]({{ images_dir
|
10
|
+
}}/symbol_le.gif) <var>N</var>. \n\rFor example, S(10) = 4: {6}, {6, 8}, {6, 8,
|
11
|
+
9} and {6, 10}. \n\rWe can verify that S(100) = 482073668 and S(10 000) mod 10<sup>8</sup>
|
12
|
+
= 73808307.\n\nFind S(20 000 000) mod 10<sup>8</sup>.\n\n<sup>1</sup> φ denotes
|
13
|
+
**Euler's totient function** .\n\n"
|
data/data/problems/338.yml
CHANGED
@@ -3,29 +3,26 @@
|
|
3
3
|
:name: Cutting Rectangular Grid Paper
|
4
4
|
:url: http://projecteuler.net/problem=338
|
5
5
|
:content: "A rectangular sheet of grid paper with integer dimensions <var>w</var>
|
6
|
-
![×](/
|
7
|
-
is
|
8
|
-
|
9
|
-
|
10
|
-
4 , we can make rectangles with dimensions 18 ![×](/
|
11
|
-
2, 12 ![×](/
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
be the number of distinct rectangles that can be made from a sheet with dimensions
|
19
|
-
<var>w</var> ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
|
6
|
+
![×]({{ images_dir }}/symbol_times.gif) <var>h</var> is given. Its grid spacing
|
7
|
+
is 1. \n\rWhen we cut the sheet along the grid lines into two pieces and rearrange
|
8
|
+
those pieces without overlap, we can make new rectangles with different dimensions.\n\nFor
|
9
|
+
example, from a sheet with dimensions 9 ![×]({{ images_dir }}/symbol_times.gif)
|
10
|
+
4 , we can make rectangles with dimensions 18 ![×]({{ images_dir }}/symbol_times.gif)
|
11
|
+
2, 12 ![×]({{ images_dir }}/symbol_times.gif) 3 and 6 ![×]({{ images_dir }}/symbol_times.gif)
|
12
|
+
6 by cutting and rearranging as below:\n\n ![]({{ images_dir }}/p_338_gridpaper.gif)
|
13
|
+
\ \n\nSimilarly, from a sheet with dimensions 9 ![×]({{ images_dir }}/symbol_times.gif)
|
14
|
+
8 , we can make rectangles with dimensions 18 ![×]({{ images_dir }}/symbol_times.gif)
|
15
|
+
4 and 12 ![×]({{ images_dir }}/symbol_times.gif) 6 .\n\nFor a pair <var>w</var>
|
16
|
+
and <var>h</var>, let F(<var>w</var>,<var>h</var>) be the number of distinct rectangles
|
17
|
+
that can be made from a sheet with dimensions <var>w</var> ![×]({{ images_dir }}/symbol_times.gif)
|
20
18
|
<var>h</var> . \n\rFor example, F(2,1) = 0, F(2,2) = 1, F(9,4) = 3 and F(9,8) =
|
21
19
|
2. \n\rNote that rectangles congruent to the initial one are not counted in F(<var>w</var>,<var>h</var>).
|
22
|
-
\ \n\rNote also that rectangles with dimensions <var>w</var> ![×](
|
23
|
-
<var>h</var> and dimensions <var>h</var> ![×](
|
24
|
-
<var>w</var> are not considered distinct.\n\nFor an integer
|
25
|
-
|
26
|
-
which satisfy 0 ![<](/
|
27
|
-
<var>h</var> ![≤](/
|
28
|
-
<var>
|
29
|
-
|
30
|
-
|
31
|
-
10<sup>8</sup>.\n\n"
|
20
|
+
\ \n\rNote also that rectangles with dimensions <var>w</var> ![×]({{ images_dir
|
21
|
+
}}/symbol_times.gif) <var>h</var> and dimensions <var>h</var> ![×]({{ images_dir
|
22
|
+
}}/symbol_times.gif) <var>w</var> are not considered distinct.\n\nFor an integer
|
23
|
+
<var>N</var>, let G(<var>N</var>) be the sum of F(<var>w</var>,<var>h</var>) for
|
24
|
+
all pairs <var>w</var> and <var>h</var> which satisfy 0 ![<]({{ images_dir }}/symbol_lt.gif)
|
25
|
+
<var>h</var> ![≤]({{ images_dir }}/symbol_le.gif) <var>w</var> ![≤]({{ images_dir
|
26
|
+
}}/symbol_le.gif) <var>N</var>. \n\rWe can verify that G(10) = 55, G(10<sup>3</sup>)
|
27
|
+
= 971745 and G(10<sup>5</sup>) = 9992617687.\n\nFind G(10<sup>12</sup>). Give your
|
28
|
+
answer modulo 10<sup>8</sup>.\n\n"
|
data/data/problems/340.yml
CHANGED
@@ -3,10 +3,9 @@
|
|
3
3
|
:name: Crazy Function
|
4
4
|
:url: http://projecteuler.net/problem=340
|
5
5
|
:content: "For fixed integers a, b, c, define the _crazy function_ F(<var>n</var>)
|
6
|
-
as follows: \n\rF(<var>n</var>) = <var>n</var> - c for all <var>n</var> ![>](
|
7
|
-
b \n\rF(<var>n</var>) = F(a + F(a + F(a + F(a + <var>n</var>))))
|
8
|
-
![≤](/
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
12<sup>7</sup>).\n\n"
|
6
|
+
as follows: \n\rF(<var>n</var>) = <var>n</var> - c for all <var>n</var> ![>]({{
|
7
|
+
images_dir }}/symbol_gt.gif) b \n\rF(<var>n</var>) = F(a + F(a + F(a + F(a + <var>n</var>))))
|
8
|
+
for all <var>n</var> ![≤]({{ images_dir }}/symbol_le.gif) b.\n\nAlso, define S(a,
|
9
|
+
b, c) = ![]({{ images_dir }}/p_340_formula.gif).\n\nFor example, if a = 50, b =
|
10
|
+
2000 and c = 40, then F(0) = 3240 and F(2000) = 2040. \n\rAlso, S(50, 2000, 40)
|
11
|
+
= 5204240.\n\nFind the last 9 digits of S(21<sup>7</sup>, 7<sup>21</sup>, 12<sup>7</sup>).\n\n"
|
data/data/problems/341.yml
CHANGED
@@ -9,8 +9,6 @@
|
|
9
9
|
| 11 | 12 | 13 | 14 | 15 | … |\n| G(<var>n</var>) | 1 | 2 | 2 | 3 | 3 | 4 | 4 |
|
10
10
|
4 | 5 | 5 | 5 | 6 | 6 | 6 | 6 | … |\n\nYou are given that G(10<sup>3</sup>) = 86,
|
11
11
|
G(10<sup>6</sup>) = 6137. \n\rYou are also given that ΣG(<var>n</var><sup>3</sup>)
|
12
|
-
= 153506976 for 1 ![≤](/
|
13
|
-
<var>n</var> ![
|
14
|
-
|
15
|
-
<var>n</var> ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)
|
16
|
-
10<sup>6</sup>.\n\n"
|
12
|
+
= 153506976 for 1 ![≤]({{ images_dir }}/symbol_le.gif) <var>n</var> ![<]({{ images_dir
|
13
|
+
}}/symbol_lt.gif) 10<sup>3</sup>.\n\nFind ΣG(<var>n</var><sup>3</sup>) for 1 ![≤]({{
|
14
|
+
images_dir }}/symbol_le.gif) <var>n</var> ![<]({{ images_dir }}/symbol_lt.gif) 10<sup>6</sup>.\n\n"
|
data/data/problems/342.yml
CHANGED
@@ -2,12 +2,11 @@
|
|
2
2
|
:id: 342
|
3
3
|
:name: The totient of a square is a cube
|
4
4
|
:url: http://projecteuler.net/problem=342
|
5
|
-
:content: "Consider the number 50. \n\r50<sup>2</sup> = 2500 = 2<sup>2</sup> ![×](
|
6
|
-
5<sup>4</sup>, so φ(2500) = 2 ![×](
|
7
|
-
4 ![×](/
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
the sum of all numbers n, 1 < n ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)
|
5
|
+
:content: "Consider the number 50. \n\r50<sup>2</sup> = 2500 = 2<sup>2</sup> ![×]({{
|
6
|
+
images_dir }}/symbol_times.gif) 5<sup>4</sup>, so φ(2500) = 2 ![×]({{ images_dir
|
7
|
+
}}/symbol_times.gif) 4 ![×]({{ images_dir }}/symbol_times.gif) 5<sup>3</sup> = 8
|
8
|
+
![×]({{ images_dir }}/symbol_times.gif) 5<sup>3</sup> = 2<sup>3</sup> ![×]({{ images_dir
|
9
|
+
}}/symbol_times.gif) 5<sup>3</sup>. <sup>1</sup> \n\rSo 2500 is a square and φ(2500)
|
10
|
+
is a cube.\n\nFind the sum of all numbers n, 1 < n ![<]({{ images_dir }}/symbol_lt.gif)
|
12
11
|
10<sup>10</sup> such that φ(n<sup>2</sup>) is a cube.\n\n<sup>1</sup> φ denotes
|
13
12
|
**Euler's totient function** .\n\n"
|
data/data/problems/343.yml
CHANGED
@@ -8,15 +8,11 @@
|
|
8
8
|
reduced to lowest terms for <var>i</var>>1. \n\rWhen a<sub><var>i</var></sub> reaches
|
9
9
|
some integer <var>n</var>, the sequence stops. (That is, when y<sub><var>i</var></sub>=1.)
|
10
10
|
\ \n\rDefine f(<var>k</var>) = <var>n</var>. \n\rFor example, for <var>k</var>
|
11
|
-
= 20:\n\n1/20 ![→](/
|
12
|
-
|
13
|
-
|
14
|
-
![→](/
|
15
|
-
|
16
|
-
![
|
17
|
-
f(
|
18
|
-
|
19
|
-
<var>k</var> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
|
20
|
-
100.\n\nFind Σf(<var>k</var><sup>3</sup>) for 1 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
|
21
|
-
<var>k</var> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
|
22
|
-
2 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)10<sup>6</sup>.\n\n"
|
11
|
+
= 20:\n\n1/20 ![→]({{ images_dir }}/symbol_maps.gif) 2/19 ![→]({{ images_dir }}/symbol_maps.gif)
|
12
|
+
3/18 = 1/6 ![→]({{ images_dir }}/symbol_maps.gif) 2/5 ![→]({{ images_dir }}/symbol_maps.gif)
|
13
|
+
3/4 ![→]({{ images_dir }}/symbol_maps.gif) 4/3 ![→]({{ images_dir }}/symbol_maps.gif)
|
14
|
+
5/2 ![→]({{ images_dir }}/symbol_maps.gif) 6/1 = 6\n\nSo f(20) = 6.\n\nAlso f(1)
|
15
|
+
= 1, f(2) = 2, f(3) = 1 and Σf(<var>k</var><sup>3</sup>) = 118937 for 1 ![≤]({{
|
16
|
+
images_dir }}/symbol_le.gif) <var>k</var> ![≤]({{ images_dir }}/symbol_le.gif) 100.\n\nFind
|
17
|
+
Σf(<var>k</var><sup>3</sup>) for 1 ![≤]({{ images_dir }}/symbol_le.gif) <var>k</var>
|
18
|
+
![≤]({{ images_dir }}/symbol_le.gif) 2 ![×]({{ images_dir }}/symbol_times.gif)10<sup>6</sup>.\n\n"
|
data/data/problems/344.yml
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
or over another coin.\n\nAlternatively, the player can choose to make the _special_
|
12
12
|
move of pocketing the leftmost coin rather than making a regular move. If no regular
|
13
13
|
moves are possible, the player is forced to pocket the leftmost coin.\n\nThe winner
|
14
|
-
is the player who pockets the silver dollar.\n\n ![](/
|
14
|
+
is the player who pockets the silver dollar.\n\n ![]({{ images_dir }}/p_344_silverdollar.gif)
|
15
15
|
\ \n\nA _winning configuration_ is an arrangement of coins on the strip where the
|
16
16
|
first player can force a win no matter what the second player does.\n\nLet W(<var>n</var>,<var>c</var>)
|
17
17
|
be the number of winning configurations for a strip of <var>n</var> squares, <var>c</var>
|
data/data/problems/347.yml
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
:id: 347
|
3
3
|
:name: Largest integer divisible by two primes
|
4
4
|
:url: http://projecteuler.net/problem=347
|
5
|
-
:content: "The largest integer ![≤](/
|
6
|
-
|
7
|
-
two _distinct_ primes p and q let M(p,q,N) be the largest positive integer ![≤](
|
8
|
-
only divisible\rby both p and q and M(p,q,N)=0 if
|
9
|
-
exist.\n\nE.g. M(2,3,100)=96. \n \rM(3,5,100)=75
|
10
|
-
by 2 ,3 and 5. \n\rAlso M(2,73,100)=0 because
|
11
|
-
![≤](/
|
12
|
-
is divisible by both 2 and 73.\n\nLet S(N) be the sum of all distinct M(p,q,N).\rS(100)=2262.\n\nFind
|
5
|
+
:content: "The largest integer ![≤]({{ images_dir }}/symbol_le.gif) 100 that is only
|
6
|
+
divisible by both the primes 2 and 3 is 96, as 96=32\\*3=2<sup>5</sup>\\*3.\rFor
|
7
|
+
two _distinct_ primes p and q let M(p,q,N) be the largest positive integer ![≤]({{
|
8
|
+
images_dir }}/symbol_le.gif)N only divisible\rby both p and q and M(p,q,N)=0 if
|
9
|
+
such a positive integer does not exist.\n\nE.g. M(2,3,100)=96. \n \rM(3,5,100)=75
|
10
|
+
and not 90 because 90 is divisible by 2 ,3 and 5. \n\rAlso M(2,73,100)=0 because
|
11
|
+
there does not exist a positive integer ![≤]({{ images_dir }}/symbol_le.gif) 100
|
12
|
+
that is divisible by both 2 and 73.\n\nLet S(N) be the sum of all distinct M(p,q,N).\rS(100)=2262.\n\nFind
|
13
13
|
S(10 000 000).\n\n"
|
data/data/problems/350.yml
CHANGED
@@ -9,8 +9,8 @@
|
|
9
9
|
**least common multiple** , or lcm, of a list is the smallest natural number divisible
|
10
10
|
by each entry of the list. \nExamples: lcm(2,6,4) = 12, lcm(10,6,15,6) = 30 and
|
11
11
|
lcm(11) = 11.\n\nLet f(<var>G</var>, <var>L</var>, <var>N</var>) be the number of
|
12
|
-
lists of size <var>N</var> with gcd ![≥](/
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
10<sup>
|
12
|
+
lists of size <var>N</var> with gcd ![≥]({{ images_dir }}/symbol_ge.gif) <var>G</var>
|
13
|
+
and lcm ![≤]({{ images_dir }}/symbol_le.gif) <var>L</var>. For example:\n\nf(10,
|
14
|
+
100, 1) = 91. \n\rf(10, 100, 2) = 327. \n\rf(10, 100, 3) = 1135. \n\rf(10, 100,
|
15
|
+
1000) mod 101<sup>4</sup> = 3286053.\n\nFind f(10<sup>6</sup>, 10<sup>12</sup>,
|
16
|
+
10<sup>18</sup>) mod 101<sup>4</sup>.\n\n"
|
data/data/problems/351.yml
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
:url: http://projecteuler.net/problem=351
|
5
5
|
:content: "A _hexagonal orchard_ of order <var>n</var> is a triangular lattice made
|
6
6
|
up of points within a regular hexagon with side <var>n</var>. The following is an
|
7
|
-
example of a hexagonal orchard of order 5:\n\n ![](/
|
7
|
+
example of a hexagonal orchard of order 5:\n\n ![]({{ images_dir }}/p_351_hexorchard.png)
|
8
8
|
\ \n\nHighlighted in green are the points which are hidden from the center by a
|
9
9
|
point closer to it. It can be seen that for a hexagonal orchard of order 5, 30 points
|
10
10
|
are hidden from the center.\n\nLet H(<var>n</var>) be the number of points hidden
|
data/data/problems/352.yml
CHANGED
@@ -16,30 +16,29 @@
|
|
16
16
|
(on the pooled samples) for each group will be:\n\n- Negative (and no more tests
|
17
17
|
needed) with probability 0.98<sup>5</sup> = 0.9039207968.\n- Positive (5 additional
|
18
18
|
tests needed) with probability 1 - 0.9039207968 = 0.0960792032.\n\nThus, the expected
|
19
|
-
number of tests for each group is 1 + 0.0960792032 ![×](/
|
19
|
+
number of tests for each group is 1 + 0.0960792032 ![×]({{ images_dir }}/symbol_times.gif)
|
20
20
|
5 = 1.480396016. \n\rConsequently, all 5 groups can be screened using an average
|
21
|
-
of only 1.480396016 ![×](/
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
six decimal places.\n\n"
|
21
|
+
of only 1.480396016 ![×]({{ images_dir }}/symbol_times.gif) 5 = **7.40198008** tests,
|
22
|
+
which represents a huge saving of more than 70% !\n\nAlthough the scheme we have
|
23
|
+
just described seems to be very efficient, it can still be improved considerably
|
24
|
+
(always assuming that the test is sufficiently sensitive and that there are no adverse
|
25
|
+
effects caused by mixing different samples). E.g.:\n\n- We may start by running
|
26
|
+
a test on a mixture of all the 25 samples. It can be verified that in about 60.35%
|
27
|
+
of the cases this test will be negative, thus no more tests will be needed. Further
|
28
|
+
testing will only be required for the remaining 39.65% of the cases.\n- If we know
|
29
|
+
that at least one animal in a group of 5 is infected and the first 4 individual
|
30
|
+
tests come out negative, there is no need to run a test on the fifth animal (we
|
31
|
+
know that it must be infected).\n- We can try a different number of groups / different
|
32
|
+
number of animals in each group, adjusting those numbers at each level so that the
|
33
|
+
total expected number of tests will be minimised.\n\nTo simplify the very wide range
|
34
|
+
of possibilities, there is one restriction we place when devising the most cost-efficient
|
35
|
+
testing scheme: whenever we start with a mixed sample, all the sheep contributing
|
36
|
+
to that sample must be fully screened (i.e. a verdict of infected / virus-free must
|
37
|
+
be reached for all of them) before we start examining any other animals.\n\n\rFor
|
38
|
+
the current example, it turns out that the most cost-efficient testing scheme (we'll
|
39
|
+
call it the _optimal strategy_) requires an average of just **4.155452** tests!\r\r\r\n\nUsing
|
40
|
+
the optimal strategy, let T(<var>s</var>,<var>p</var>) represent the average number
|
41
|
+
of tests needed to screen a flock of <var>s</var> sheep for a virus having probability
|
42
|
+
<var>p</var> to be present in any individual. \n\rThus, rounded to six decimal
|
43
|
+
places, T(25, 0.02) = 4.155452 and T(25, 0.10) = 12.702124.\n\nFind ΣT(10000, p)
|
44
|
+
for p=0.01, 0.02, 0.03, ... 0.50. \n\rGive your answer rounded to six decimal places.\n\n"
|
data/data/problems/353.yml
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
|
16
16
|
You are given that M(7)=0.1784943998 rounded to 10 digits behind the decimal point.
|
17
17
|
|
18
|
-
Find ![∑](/
|
18
|
+
Find ![∑]({{ images_dir }}/symbol_sum.gif)M(2<sup>n</sup>-1) for 1 ![≤]({{ images_dir }}/symbol_le.gif)n ![≤]({{ images_dir }}/symbol_le.gif)15.
|
19
19
|
|
20
20
|
Give your answer rounded to 10 digits behind the decimal point in the form a.bcdefghijk.
|
21
21
|
|
data/data/problems/354.yml
CHANGED
@@ -3,12 +3,12 @@
|
|
3
3
|
:name: Distances in a bee's honeycomb
|
4
4
|
:url: http://projecteuler.net/problem=354
|
5
5
|
:content: "Consider a honey bee's honeycomb where each cell is a perfect regular hexagon
|
6
|
-
with side length 1.\n\n ![](/
|
7
|
-
|
6
|
+
with side length 1.\n\n ![]({{ images_dir }}/p_354_bee_honeycomb.png)\n\nOne particular
|
7
|
+
cell is occupied by the queen bee. \n\rFor a positive real number <var>L</var>,
|
8
8
|
let B(<var>L</var>) count the cells with distance <var>L</var> from the queen bee
|
9
9
|
cell (all distances are measured from centre to centre); you may assume that the
|
10
10
|
honeycomb is large enough to accommodate for any distance we wish to consider. \n\rFor
|
11
|
-
example, B( ![√](/
|
12
|
-
=
|
13
|
-
|
14
|
-
|
11
|
+
example, B( ![√]({{ images_dir }}/symbol_radic.gif)3) = 6, B( ![√]({{ images_dir
|
12
|
+
}}/symbol_radic.gif)21) = 12 and B(111 111 111) = 54.\n\nFind the number of <var>L</var>
|
13
|
+
![≤]({{ images_dir }}/symbol_le.gif) 5·10<sup>11</sup> such that B(<var>L</var>)
|
14
|
+
= 450.\n\n"
|
data/data/problems/356.yml
CHANGED
@@ -5,6 +5,5 @@
|
|
5
5
|
:content: "Let <var>a</var><sub><var>n</var></sub> be the largest real root of a polynomial
|
6
6
|
<var>g</var>(x) = x<sup>3</sup> - 2<sup><var>n</var></sup>·x<sup>2</sup> + <var>n</var>.
|
7
7
|
\ \n\rFor example, <var>a</var><sub>2</sub> = 3.86619826...\n\nFind the last eight
|
8
|
-
digits of ![](/
|
9
|
-
|
10
|
-
the floor function.\n\n"
|
8
|
+
digits of ![]({{ images_dir }}/p_356_cubicpoly1.gif).\n\n<u><i>Note</i></u>: ![]({{
|
9
|
+
images_dir }}/p_356_cubicpoly2.gif) represents the floor function.\n\n"
|
data/data/problems/358.yml
CHANGED
@@ -5,18 +5,17 @@
|
|
5
5
|
:content: "A **cyclic number** with <var>n</var> digits has a very interesting property:
|
6
6
|
\ \n\rWhen it is multiplied by 1, 2, 3, 4, ... <var>n</var>, all the products have
|
7
7
|
exactly the same digits, in the same order, but rotated in a circular fashion!\n\nThe
|
8
|
-
smallest cyclic number is the 6-digit number 142857 : \n\r142857 ![×](
|
9
|
-
1 = 142857 \n\r142857 ![×](/
|
10
|
-
2 = 285714 \n\r142857 ![×](/
|
11
|
-
|
12
|
-
|
13
|
-
5 = 714285 \n\r142857 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
|
8
|
+
smallest cyclic number is the 6-digit number 142857 : \n\r142857 ![×]({{ images_dir
|
9
|
+
}}/symbol_times.gif) 1 = 142857 \n\r142857 ![×]({{ images_dir }}/symbol_times.gif)
|
10
|
+
2 = 285714 \n\r142857 ![×]({{ images_dir }}/symbol_times.gif) 3 = 428571 \n\r142857
|
11
|
+
![×]({{ images_dir }}/symbol_times.gif) 4 = 571428 \n\r142857 ![×]({{ images_dir
|
12
|
+
}}/symbol_times.gif) 5 = 714285 \n\r142857 ![×]({{ images_dir }}/symbol_times.gif)
|
14
13
|
6 = 857142\n\nThe next cyclic number is 0588235294117647 with 16 digits : \n\r0588235294117647
|
15
|
-
![×](/
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
14
|
+
![×]({{ images_dir }}/symbol_times.gif) 1 = 0588235294117647 \n\r0588235294117647
|
15
|
+
![×]({{ images_dir }}/symbol_times.gif) 2 = 1176470588235294 \n\r0588235294117647
|
16
|
+
![×]({{ images_dir }}/symbol_times.gif) 3 = 1764705882352941 \n\r... \n\r0588235294117647
|
17
|
+
![×]({{ images_dir }}/symbol_times.gif) 16 = 9411764705882352\n\nNote that for cyclic
|
18
|
+
numbers, leading zeros are important.\n\nThere is only one cyclic number for which,
|
19
|
+
the eleven leftmost digits are 00000000137 and the five rightmost digits are 56789
|
20
|
+
(i.e., it has the form 00000000137...56789 with an unknown number of digits in the
|
21
|
+
middle). Find the sum of all its digits.\n\n"
|
data/data/problems/359.yml
CHANGED
@@ -19,5 +19,5 @@
|
|
19
19
|
and 0 if no person occupies the room. Here are a few examples:\r \nP(1, 1) = 1\r
|
20
20
|
\ \nP(1, 2) = 3\r \nP(2, 1) = 2\r \nP(10, 20) = 440\r \nP(25, 75) = 4863\r \nP(99,
|
21
21
|
100) = 19454\n\nFind the sum of all P(<var>f</var>, <var>r</var>) for all positive
|
22
|
-
<var>f</var> and <var>r</var> such that <var>f</var> ![×](/
|
22
|
+
<var>f</var> and <var>r</var> such that <var>f</var> ![×]({{ images_dir }}/symbol_times.gif)
|
23
23
|
<var>r</var> = 71328803586048 and give the last 8 digits as your answer.\n\n"
|
data/data/problems/361.yml
CHANGED
@@ -16,4 +16,5 @@
|
|
16
16
|
are given as follows:\n\n| <var>n</var> | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
|
17
17
|
| 10 | 11 | 12 | … |\n| A<sub><var>n</var></sub> | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 9
|
18
18
|
| 10 | 11 | 12 | 13 | 18 | … |\n\nWe can also verify that A<sub>100</sub> = 3251
|
19
|
-
and A<sub>1000</sub> = 80852364498.\n\nFind the last 9 digits of ![](
|
19
|
+
and A<sub>1000</sub> = 80852364498.\n\nFind the last 9 digits of ![]({{ images_dir
|
20
|
+
}}/p_361_Thue-Morse1.gif).\n\n"
|
data/data/problems/362.yml
CHANGED
@@ -3,18 +3,16 @@
|
|
3
3
|
:name: Squarefree factors
|
4
4
|
:url: http://projecteuler.net/problem=362
|
5
5
|
:content: "Consider the number 54. \n\r54 can be factored in 7 distinct ways into
|
6
|
-
one or more factors larger than 1: \n\r54, 2 ![×](/
|
7
|
-
3 ![×](/
|
8
|
-
![×](/
|
9
|
-
![×](/
|
10
|
-
![×](/
|
11
|
-
![×](/
|
12
|
-
![×](/
|
13
|
-
|
14
|
-
![×](/
|
15
|
-
![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)3 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)3
|
16
|
-
![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)3.\n\nLet's
|
6
|
+
one or more factors larger than 1: \n\r54, 2 ![×]({{ images_dir }}/symbol_times.gif)27,
|
7
|
+
3 ![×]({{ images_dir }}/symbol_times.gif)18, 6 ![×]({{ images_dir }}/symbol_times.gif)9,
|
8
|
+
3 ![×]({{ images_dir }}/symbol_times.gif)3 ![×]({{ images_dir }}/symbol_times.gif)6,
|
9
|
+
2 ![×]({{ images_dir }}/symbol_times.gif)3 ![×]({{ images_dir }}/symbol_times.gif)9
|
10
|
+
and 2 ![×]({{ images_dir }}/symbol_times.gif)3 ![×]({{ images_dir }}/symbol_times.gif)3
|
11
|
+
![×]({{ images_dir }}/symbol_times.gif)3. \n\rIf we require that the factors are
|
12
|
+
all squarefree only two ways remain: 3 ![×]({{ images_dir }}/symbol_times.gif)3
|
13
|
+
![×]({{ images_dir }}/symbol_times.gif)6 and 2 ![×]({{ images_dir }}/symbol_times.gif)3
|
14
|
+
![×]({{ images_dir }}/symbol_times.gif)3 ![×]({{ images_dir }}/symbol_times.gif)3.\n\nLet's
|
17
15
|
call Fsf(<var>n</var>) the number of ways <var>n</var> can be factored into one
|
18
16
|
or more squarefree factors larger than 1, so\rFsf(54)=2.\n\nLet S(<var>n</var>)
|
19
|
-
be ![∑](/
|
20
|
-
|
17
|
+
be ![∑]({{ images_dir }}/symbol_sum.gif)Fsf(<var>k</var>) for <var>k</var>=2 to
|
18
|
+
<var>n</var>.\n\nS(100)=193.\n\nFind S(10 000 000 000).\n\n"
|
data/data/problems/363.yml
CHANGED
@@ -24,9 +24,9 @@
|
|
24
24
|
P<sub>0</sub>P<sub>1</sub> in P<sub>0</sub> and P<sub>2</sub>P<sub>3</sub> in P<sub>3</sub>.\n\nA
|
25
25
|
cubic Bézier curve with P<sub>0</sub>=(1,0), P<sub>1</sub>=(1,<var>v</var>), P<sub>2</sub>=(<var>v</var>,1)
|
26
26
|
and P<sub>3</sub>=(0,1) is used to approximate a quarter circle. \n\rThe value
|
27
|
-
<var>v</var> ![>](/
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
27
|
+
<var>v</var> ![>]({{ images_dir }}/symbol_gt.gif)0 is chosen such that the area
|
28
|
+
enclosed by the lines OP<sub>0</sub>, OP<sub>3</sub> and the curve is equal to <sup>π</sup>/<sub>4</sub>
|
29
|
+
(the area of the quarter circle).\n\nBy how many percent does the length of the
|
30
|
+
curve differ from the length of the quarter circle? \n\rThat is, if L is the length
|
31
|
+
of the curve, calculate 100\\*<sup>(L-π/2)</sup>/<sub>(π/2)</sub>. \n\rGive your
|
32
|
+
answer rounded to 10 digits behind the decimal point.\n\n"
|
data/data/problems/364.yml
CHANGED
@@ -8,6 +8,6 @@
|
|
8
8
|
such seat and there is any seat for which only one adjacent seat is occupied take
|
9
9
|
such a seat.\n3. Otherwise take one of the remaining available seats. \n\rLet T(<var>N</var>)
|
10
10
|
be the number of possibilities that <var>N</var> seats are occupied by <var>N</var>
|
11
|
-
people with the given rules. \n The following figure shows T(4)=8.\r\r\r\n ![](
|
12
|
-
can verify that T(10) = 61632 and T(1 000)
|
13
|
-
000 000) mod 100 000 007.\n\n"
|
11
|
+
people with the given rules. \n The following figure shows T(4)=8.\r\r\r\n ![]({{
|
12
|
+
images_dir }}/p_364_comf_dist.gif)\n\nWe can verify that T(10) = 61632 and T(1 000)
|
13
|
+
mod 100 000 007 = 47255094.\n\nFind T(1 000 000) mod 100 000 007.\n\n"
|
data/data/problems/365.yml
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
:name: A huge binomial coefficient
|
4
4
|
:url: http://projecteuler.net/problem=365
|
5
5
|
:content: |+
|
6
|
-
The binomial coeffient C(10<sup>18</sup>,10<sup>9</sup>) is a number with more than 9 billion (9 ![×](/
|
6
|
+
The binomial coeffient C(10<sup>18</sup>,10<sup>9</sup>) is a number with more than 9 billion (9 ![×]({{ images_dir }}/symbol_times.gif)10<sup>9</sup>) digits.
|
7
7
|
|
8
8
|
Let M(n,k,m) denote the binomial coefficient C(n,k) modulo m.
|
9
9
|
|
10
|
-
Calculate ![∑](/
|
10
|
+
Calculate ![∑]({{ images_dir }}/symbol_sum.gif)M(10<sup>18</sup>,10<sup>9</sup>,p\*q\*r) for 1000 ![<]({{ images_dir }}/symbol_lt.gif)p ![<]({{ images_dir }}/symbol_lt.gif)q ![<]({{ images_dir }}/symbol_lt.gif)r ![<]({{ images_dir }}/symbol_lt.gif)5000 and p,q,r prime.
|
11
11
|
|
data/data/problems/366.yml
CHANGED
@@ -16,8 +16,7 @@
|
|
16
16
|
than one possible move for the first player. \n\rE.g. when n=17 the first player
|
17
17
|
can remove one or four stones.\n\nLet M(n) be the maximum number of stones the first
|
18
18
|
player can take from a winning position _at his first turn_ and M(n)=0 for any other
|
19
|
-
position.\n\n![∑](/
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
your answer modulo 10<sup>8</sup>.\n\n"
|
19
|
+
position.\n\n![∑]({{ images_dir }}/symbol_sum.gif)M(n) for n ![≤]({{ images_dir
|
20
|
+
}}/symbol_le.gif)100 is 728.\n\nFind ![∑]({{ images_dir }}/symbol_sum.gif)M(n) for
|
21
|
+
n ![≤]({{ images_dir }}/symbol_le.gif)10<sup>18</sup>.\rGive your answer modulo
|
22
|
+
10<sup>8</sup>.\n\n"
|
data/data/problems/369.yml
CHANGED
@@ -7,5 +7,5 @@
|
|
7
7
|
|
8
8
|
Let f(<var>n</var>) be the number of ways to choose <var>n</var> cards with a 4 card subset that is a Badugi. For example, there are 2598960 ways to choose five cards from a standard 52 card deck, of which 514800 contain a 4 card subset that is a Badugi, so f(5) = 514800.
|
9
9
|
|
10
|
-
Find ![∑](/
|
10
|
+
Find ![∑]({{ images_dir }}/symbol_sum.gif)f(<var>n</var>) for 4 ![≤]({{ images_dir }}/symbol_le.gif) <var>n</var> ![≤]({{ images_dir }}/symbol_le.gif) 13.
|
11
11
|
|
data/data/problems/370.yml
CHANGED
@@ -3,11 +3,11 @@
|
|
3
3
|
:name: Geometric triangles
|
4
4
|
:url: http://projecteuler.net/problem=370
|
5
5
|
:content: |+
|
6
|
-
Let us define a _geometric triangle_ as an integer sided triangle with sides <var>a</var> ![≤](/
|
6
|
+
Let us define a _geometric triangle_ as an integer sided triangle with sides <var>a</var> ![≤]({{ images_dir }}/symbol_le.gif) <var>b</var> ![≤]({{ images_dir }}/symbol_le.gif) <var>c</var> so that its sides form a **geometric progression** , i.e. <var>b<sup>2</sup></var> = <var>a</var> · <var>c</var> .
|
7
7
|
|
8
8
|
An example of such a geometric triangle is the triangle with sides <var>a</var> = 144, <var>b</var> = 156 and <var>c</var> = 169.
|
9
9
|
|
10
|
-
There are 861805 geometric triangles with perimeter ![≤](/
|
10
|
+
There are 861805 geometric triangles with perimeter ![≤]({{ images_dir }}/symbol_le.gif) 10<sup>6</sup> .
|
11
11
|
|
12
|
-
How many geometric triangles exist with perimeter ![≤](/
|
12
|
+
How many geometric triangles exist with perimeter ![≤]({{ images_dir }}/symbol_le.gif) 2.5·10<sup>13</sup> ?
|
13
13
|
|
data/data/problems/372.yml
CHANGED
@@ -3,11 +3,9 @@
|
|
3
3
|
:name: Pencils of rays
|
4
4
|
:url: http://projecteuler.net/problem=372
|
5
5
|
:content: "Let R(<var>M</var>, <var>N</var>) be the number of lattice points (<var>x</var>,
|
6
|
-
<var>y</var>) which satisfy <var>M</var> ![<](/
|
7
|
-
![≤](/
|
8
|
-
<var>
|
9
|
-
![
|
10
|
-
and
|
11
|
-
|
12
|
-
R(2·10<sup>6</sup>, 10<sup>9</sup>).\n\n<u><i>Note</i></u>: ![](/home/will/src/euler-manager/config/../data/images/p_372_pencilray2.gif)
|
13
|
-
represents the floor function.\n\n"
|
6
|
+
<var>y</var>) which satisfy <var>M</var> ![<]({{ images_dir }}/symbol_lt.gif)<var>x</var>
|
7
|
+
![≤]({{ images_dir }}/symbol_le.gif)<var>N</var>, <var>M</var> ![<]({{ images_dir
|
8
|
+
}}/symbol_lt.gif)<var>y</var> ![≤]({{ images_dir }}/symbol_le.gif)<var>N</var> and
|
9
|
+
![]({{ images_dir }}/p_372_pencilray1.jpg) is odd. \n\rWe can verify that R(0,
|
10
|
+
100) = 3019 and R(100, 10000) = 29750422. \n\rFind R(2·10<sup>6</sup>, 10<sup>9</sup>).\n\n<u><i>Note</i></u>:
|
11
|
+
![]({{ images_dir }}/p_372_pencilray2.gif) represents the floor function.\n\n"
|
data/data/problems/374.yml
CHANGED
@@ -12,10 +12,8 @@
|
|
12
12
|
<var>n</var> with that product.\n\nSo f(5)=6 and m(5)=2.\n\nFor <var>n</var>=10
|
13
13
|
the partition with the largest product is 10=2+3+5, which gives f(10)=30 and m(10)=3.\r
|
14
14
|
\ \nAnd their product, f(10)·m(10) = 30·3 = 90\n\nIt can be verified that\r \n
|
15
|
-
![∑](/
|
16
|
-
|
17
|
-
![
|
18
|
-
![
|
19
|
-
|
20
|
-
![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) 10<sup>14</sup>.\r
|
21
|
-
\ \nGive your answer modulo 982451653, the 50 millionth prime.\n\n"
|
15
|
+
![∑]({{ images_dir }}/symbol_sum.gif)f(<var>n</var>)·m(<var>n</var>) for 1 ![≤]({{
|
16
|
+
images_dir }}/symbol_le.gif) <var>n</var> ![≤]({{ images_dir }}/symbol_le.gif) 100
|
17
|
+
= 1683550844462.\n\nFind ![∑]({{ images_dir }}/symbol_sum.gif)f(<var>n</var>)·m(<var>n</var>)
|
18
|
+
for 1 ![≤]({{ images_dir }}/symbol_le.gif) <var>n</var> ![≤]({{ images_dir }}/symbol_le.gif)
|
19
|
+
10<sup>14</sup>.\r \nGive your answer modulo 982451653, the 50 millionth prime.\n\n"
|