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/150.yml
CHANGED
@@ -5,14 +5,14 @@
|
|
5
5
|
:content: "In a triangular array of positive and negative integers, we wish to find
|
6
6
|
a sub-triangle such that the sum of the numbers it contains is the smallest possible.\n\nIn
|
7
7
|
the example below, it can be easily verified that the marked triangle satisfies
|
8
|
-
this condition having a sum of ![−](/
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
s<sub>1</sub> = 273519, s<sub>2</sub> = ![−](/
|
8
|
+
this condition having a sum of ![−]({{ images_dir }}/symbol_minus.gif)42.\n\n ![]({{
|
9
|
+
images_dir }}/p_150.gif)\n\nWe wish to make such a triangular array with one thousand
|
10
|
+
rows, so we generate 500500 pseudo-random numbers s<sub>k</sub> in the range ![±]({{
|
11
|
+
images_dir }}/symbol_plusmn.gif)2<sup>19</sup>, using a type of random number generator
|
12
|
+
(known as a Linear Congruential Generator) as follows:\n\nt := 0\r \n\rfor k =
|
13
|
+
1 up to k = 500500:\r \n\r t := (615949\\*t + 797807) modulo 2<sup>20</sup>
|
14
|
+
\ \n\r s<sub>k</sub> := t ![−]({{ images_dir }}/symbol_minus.gif)2<sup>19</sup>\n\nThus:
|
15
|
+
s<sub>1</sub> = 273519, s<sub>2</sub> = ![−]({{ images_dir }}/symbol_minus.gif)153582,
|
16
16
|
s<sub>3</sub> = 450905 etc\n\nOur triangular array is then formed using the pseudo-random
|
17
17
|
numbers thus:\n\n\rs<sub>1</sub> \n\rs<sub>2</sub> s<sub>3</sub> \n\rs<sub>4</sub>
|
18
18
|
s<sub>5</sub> s<sub>6</sub> \r \n\rs<sub>7</sub> s<sub>8</sub> s<sub>9</sub>
|
data/data/problems/151.yml
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
|
12
12
|
All the unused sheets are placed back in the envelope.
|
13
13
|
|
14
|
-
![](/
|
14
|
+
![]({{ images_dir }}/p_151.gif)
|
15
15
|
|
16
16
|
At the beginning of each subsequent batch, he takes from the envelope one sheet of paper at random. If it is of size A5, he uses it. If it is larger, he repeats the 'cut-in-half' procedure until he has what he needs and any remaining sheets are always placed back in the envelope.
|
17
17
|
|
data/data/problems/152.yml
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
For instance, the numbers {2,3,4,5,7,12,15,20,28,35} can be used:
|
9
9
|
|
10
|
-
![](/
|
10
|
+
![]({{ images_dir }}/p_152_sum.gif)
|
11
11
|
|
12
12
|
In fact, only using integers between 2 and 45 inclusive, there are exactly three ways to do it, the remaining two being: {2,3,4,6,7,9,10,20,28,35,36,45} and {2,3,4,6,7,9,12,15,28,30,35,36,45}.
|
13
13
|
|
data/data/problems/153.yml
CHANGED
@@ -9,34 +9,32 @@
|
|
9
9
|
<var>x</var>=3+2<var>i</var> and <var>x</var>=3-2<var>i</var>.\r \n<var>x</var>=3+2<var>i</var>
|
10
10
|
and <var>x</var>=3-2<var>i</var> are called each others' complex conjugate.\r \n\rNumbers
|
11
11
|
of the form <var>a</var>+<var>bi</var> are called complex numbers.\r \n\rIn general
|
12
|
-
<var>a</var>+<var>bi</var> and <var>a</var> ![−](/
|
12
|
+
<var>a</var>+<var>bi</var> and <var>a</var> ![−]({{ images_dir }}/symbol_minus.gif)<var>bi</var>
|
13
13
|
are each other's complex conjugate.\n\nA Gaussian Integer is a complex number <var>a</var>+<var>bi</var>
|
14
14
|
such that both <var>a</var> and <var>b</var> are integers.\r \n\rThe regular integers
|
15
15
|
are also Gaussian integers (with <var>b</var>=0).\r \n\rTo distinguish them from
|
16
|
-
Gaussian integers with <var>b</var> ![≠](/
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
Gaussian integers with <var>b</var> ![≠]({{ images_dir }}/symbol_ne.gif) 0 we call
|
17
|
+
such integers \"rational integers.\"\r \n\rA Gaussian integer is called a divisor
|
18
|
+
of a rational integer <var>n</var> if the result is also a Gaussian integer.\r \n\rIf
|
19
|
+
for example we divide 5 by 1+2<var>i</var> we can simplify ![]({{ images_dir }}/p_153_formule1.gif)
|
20
20
|
in the following manner:\r \n\rMultiply numerator and denominator by the complex
|
21
|
-
conjugate of 1+2<var>i</var>: 1 ![−](/
|
22
|
-
\ \n\rThe result is \r ![](/
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
21
|
+
conjugate of 1+2<var>i</var>: 1 ![−]({{ images_dir }}/symbol_minus.gif)2<var>i</var>.\r
|
22
|
+
\ \n\rThe result is \r ![]({{ images_dir }}/p_153_formule2.gif).\r \n\rSo 1+2<var>i</var>
|
23
|
+
is a divisor of 5.\r \n\rNote that 1+<var>i</var> is not a divisor of 5 because
|
24
|
+
![]({{ images_dir }}/p_153_formule5.gif).\r \n\rNote also that if the Gaussian
|
25
|
+
Integer (<var>a</var>+<var>bi</var>) is a divisor of a rational integer <var>n</var>,
|
26
|
+
then its complex conjugate (<var>a</var> ![−]({{ images_dir }}/symbol_minus.gif)<var>bi</var>)
|
27
27
|
is also a divisor of <var>n</var>.\n\nIn fact, 5 has six divisors such that the
|
28
|
-
real part is positive: {1, 1 + 2<var>i</var>, 1 ![−](/
|
29
|
-
2<var>i</var>, 2 + <var>i</var>, 2 ![−](/
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
1
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
![
|
39
|
-
|
40
|
-
|
41
|
-
for 1 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) <var>n</var>
|
42
|
-
![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) 10<sup>8</sup>?\n\n"
|
28
|
+
real part is positive: {1, 1 + 2<var>i</var>, 1 ![−]({{ images_dir }}/symbol_minus.gif)
|
29
|
+
2<var>i</var>, 2 + <var>i</var>, 2 ![−]({{ images_dir }}/symbol_minus.gif) <var>i</var>,
|
30
|
+
5}.\r \n\rThe following is a table of all of the divisors for the first five positive
|
31
|
+
rational integers:\n\n| <var>n</var> | Gaussian integer divisors \n\rwith positive
|
32
|
+
real part | Sum s(<var>n</var>) of \nthese\r\rdivisors |\n| 1 | 1 | 1 |\n| 2 |
|
33
|
+
1, 1+<var>i</var>, 1-<var>i</var>, 2 | 5 |\n| 3 | 1, 3 | 4 |\n| 4 | 1, 1+<var>i</var>,
|
34
|
+
1-<var>i</var>, 2, 2+2<var>i</var>, 2-2<var>i</var>,4 | 13 |\n| 5 | 1, 1+2<var>i</var>,
|
35
|
+
1-2<var>i</var>, 2+<var>i</var>, 2-<var>i</var>, 5 | 12 |\n\nFor divisors with positive
|
36
|
+
real parts, then, we have: ![]({{ images_dir }}/p_153_formule6.gif).\n\nFor 1 ![≤]({{
|
37
|
+
images_dir }}/symbol_le.gif) <var>n</var> ![≤]({{ images_dir }}/symbol_le.gif) 10<sup>5</sup>,
|
38
|
+
![∑]({{ images_dir }}/symbol_sum.gif) s(<var>n</var>)=17924657155.\n\nWhat is ![∑]({{
|
39
|
+
images_dir }}/symbol_sum.gif) s(<var>n</var>) for 1 ![≤]({{ images_dir }}/symbol_le.gif)
|
40
|
+
<var>n</var> ![≤]({{ images_dir }}/symbol_le.gif) 10<sup>8</sup>?\n\n"
|
data/data/problems/154.yml
CHANGED
@@ -3,12 +3,13 @@
|
|
3
3
|
:name: Exploring Pascal's pyramid
|
4
4
|
:url: http://projecteuler.net/problem=154
|
5
5
|
:content: "A triangular pyramid is constructed using spherical balls so that each
|
6
|
-
ball rests on exactly three balls of the next lower level.\n\n ![](
|
7
|
-
we calculate the number of paths leading from the
|
8
|
-
starts at the apex and progresses downwards to
|
9
|
-
below the current position.\n\nConsequently, the
|
10
|
-
position is the sum of the numbers immediately
|
11
|
-
there are up to three numbers above it).\n\nThe
|
12
|
-
the numbers at each level <var>n</var> are the
|
13
|
-
\r(<var>x + y + z</var>)<sup><var>n</var></sup>.\n\nHow
|
14
|
-
expansion of (<var>x + y + z</var>)<sup>200000</sup> are
|
6
|
+
ball rests on exactly three balls of the next lower level.\n\n ![]({{ images_dir
|
7
|
+
}}/p_154_pyramid.gif)\n\nThen, we calculate the number of paths leading from the
|
8
|
+
apex to each position:\n\nA path starts at the apex and progresses downwards to
|
9
|
+
any of the three spheres directly below the current position.\n\nConsequently, the
|
10
|
+
number of paths to reach a certain position is the sum of the numbers immediately
|
11
|
+
above it (depending on the position, there are up to three numbers above it).\n\nThe
|
12
|
+
result is _Pascal's pyramid_ and the numbers at each level <var>n</var> are the
|
13
|
+
coefficients of the trinomial expansion \r(<var>x + y + z</var>)<sup><var>n</var></sup>.\n\nHow
|
14
|
+
many coefficients in the expansion of (<var>x + y + z</var>)<sup>200000</sup> are
|
15
|
+
multiples of 10<sup>12</sup>?\n\n"
|
data/data/problems/155.yml
CHANGED
@@ -8,12 +8,12 @@
|
|
8
8
|
sub-units to form larger sub-units, and so on up to a final circuit.\n\nUsing this
|
9
9
|
simple procedure and up to <var>n</var> identical capacitors, we can make circuits
|
10
10
|
having a range of different total capacitances. For example, using up to <var>n</var>=3
|
11
|
-
capacitors of 60 ![](/
|
12
|
-
|
11
|
+
capacitors of 60 ![]({{ images_dir }}/p_155_capsmu.gif)F each, we can obtain the
|
12
|
+
following 7 distinct total capacitance values:\n\n ![]({{ images_dir }}/p_155_capacitors1.gif)\n\nIf
|
13
13
|
we denote by <var>D</var>(<var>n</var>) the number of distinct total capacitance
|
14
14
|
values we can obtain when using up to <var>n</var> equal-valued capacitors and the
|
15
15
|
simple procedure described above, we have: <var>D</var>(1)=1, <var>D</var>(2)=3,
|
16
16
|
<var>D</var>(3)=7 ...\n\nFind <var>D</var>(18).\n\n_Reminder :_ When connecting
|
17
17
|
capacitors C<sub>1</sub>, C<sub>2</sub> etc in parallel, the total capacitance is
|
18
18
|
C<sub>T</sub> = C<sub>1</sub> + C<sub>2</sub> +...,\r \n\rwhereas when connecting
|
19
|
-
them in series, the overall capacitance is given by:\r ![](/
|
19
|
+
them in series, the overall capacitance is given by:\r ![]({{ images_dir }}/p_155_capsform.gif)\n\n"
|
data/data/problems/156.yml
CHANGED
@@ -14,12 +14,11 @@
|
|
14
14
|
are <var>n</var>=0 and <var>n</var>=1. The next solution is <var>n</var>=199981.\n\nIn
|
15
15
|
the same manner the function <var>f</var>(<var>n,d</var>) gives the total number
|
16
16
|
of digits <var>d</var> that have been written down after the number <var>n</var>
|
17
|
-
has been written.\r \n\rIn fact, for every digit <var>d</var> ![≠](
|
18
|
-
0, 0 is the first solution of the equation <var>f</var>(<var>n,d</var>)=<var>n</var>.\n\nLet
|
17
|
+
has been written.\r \n\rIn fact, for every digit <var>d</var> ![≠]({{ images_dir
|
18
|
+
}}/symbol_ne.gif) 0, 0 is the first solution of the equation <var>f</var>(<var>n,d</var>)=<var>n</var>.\n\nLet
|
19
19
|
<var>s</var>(<var>d</var>) be the sum of all the solutions for which <var>f</var>(<var>n,d</var>)=<var>n</var>.\r
|
20
|
-
\ \n\rYou are given that <var>s</var>(1)=22786974071.\n\nFind ![∑](
|
21
|
-
<var>s</var>(<var>d</var>) for 1 ![≤](/
|
22
|
-
d ![≤](/
|
23
|
-
|
24
|
-
|
25
|
-
value of <var>d</var> for which <var>f</var>(<var>n,d</var>)=<var>n</var>.\n\n"
|
20
|
+
\ \n\rYou are given that <var>s</var>(1)=22786974071.\n\nFind ![∑]({{ images_dir
|
21
|
+
}}/symbol_sum.gif) <var>s</var>(<var>d</var>) for 1 ![≤]({{ images_dir }}/symbol_le.gif)
|
22
|
+
d ![≤]({{ images_dir }}/symbol_le.gif) 9.\n\nNote: if, for some <var>n</var>, <var>f</var>(<var>n,d</var>)=<var>n</var>\r
|
23
|
+
for more than one value of <var>d</var> this value of <var>n</var> is counted again
|
24
|
+
for every value of <var>d</var> for which <var>f</var>(<var>n,d</var>)=<var>n</var>.\n\n"
|
data/data/problems/157.yml
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
:url: http://projecteuler.net/problem=157
|
6
6
|
:content: "Consider the diophantine equation <sup>1</sup>/<sub><var>a</var></sub>+<sup>1</sup>/<sub><var>b</var></sub>=
|
7
7
|
<sup><var>p</var></sup>/<sub>10<sup><var>n</var></sup></sub> with <var>a, b, p,
|
8
|
-
n</var> positive integers and <var>a</var> ![≤](/
|
8
|
+
n</var> positive integers and <var>a</var> ![≤]({{ images_dir }}/symbol_le.gif)
|
9
9
|
<var>b</var>. \n\rFor <var>n</var>=1 this equation has 20 solutions that are listed
|
10
10
|
below:\n\n| <sup>1</sup>/<sub>1</sub>+<sup>1</sup>/<sub>1</sub>=<sup>20</sup>/<sub>10</sub>
|
11
11
|
| <sup>1</sup>/<sub>1</sub>+<sup>1</sup>/<sub>2</sub>=<sup>15</sup>/<sub>10</sub>
|
@@ -27,6 +27,5 @@
|
|
27
27
|
| <sup>1</sup>/<sub>14</sub>+<sup>1</sup>/<sub>35</sub>=<sup>1</sup>/<sub>10</sub>
|
28
28
|
| <sup>1</sup>/<sub>15</sub>+<sup>1</sup>/<sub>30</sub>=<sup>1</sup>/<sub>10</sub>
|
29
29
|
| <sup>1</sup>/<sub>20</sub>+<sup>1</sup>/<sub>20</sub>=<sup>1</sup>/<sub>10</sub>
|
30
|
-
|\n\nHow many solutions has this equation for 1 ![≤](/
|
31
|
-
<var>n</var> ![≤](/
|
32
|
-
9?\n\n"
|
30
|
+
|\n\nHow many solutions has this equation for 1 ![≤]({{ images_dir }}/symbol_le.gif)
|
31
|
+
<var>n</var> ![≤]({{ images_dir }}/symbol_le.gif) 9?\n\n"
|
data/data/problems/158.yml
CHANGED
@@ -11,8 +11,7 @@
|
|
11
11
|
'zyx' there are zero characters that come lexicographically after its neighbour
|
12
12
|
to the left. \n\rIn all there are 10400 strings of length 3 for which exactly one
|
13
13
|
character comes lexicographically after its neighbour to the left.\n\nWe now consider
|
14
|
-
strings of <var>n</var> ![≤](/
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
value of p(<var>n</var>)?\n\n"
|
14
|
+
strings of <var>n</var> ![≤]({{ images_dir }}/symbol_le.gif) 26 different characters
|
15
|
+
from the alphabet. \n \rFor every <var>n</var>, p(<var>n</var>) is the number of
|
16
|
+
strings of length <var>n</var> for which exactly one character comes lexicographically
|
17
|
+
after its neighbour to the left.\n\nWhat is the maximum value of p(<var>n</var>)?\n\n"
|
data/data/problems/159.yml
CHANGED
@@ -14,6 +14,6 @@
|
|
14
14
|
\n2x2x2x3\n | \n9\n |\n| \n2x3x4\n | \n9\n |\n| \n2x2x6\n | \n10\n |\n| \n4x6\n
|
15
15
|
| \n10\n |\n| \n3x8\n | \n11\n |\n| \n2x12\n | \n5\n |\n| \n24\n | \n6\n |\n\nThe
|
16
16
|
maximum Digital Root Sum of 24 is 11. \n\rThe function mdrs(<var>n</var>) gives
|
17
|
-
the maximum Digital Root Sum of <var>n</var>. So mdrs(24)=11. \n\rFind ![∑](
|
18
|
-
for 1 ![<](/
|
19
|
-
![<](/
|
17
|
+
the maximum Digital Root Sum of <var>n</var>. So mdrs(24)=11. \n\rFind ![∑]({{
|
18
|
+
images_dir }}/symbol_sum.gif)mdrs(<var>n</var>) for 1 ![<]({{ images_dir }}/symbol_lt.gif)
|
19
|
+
<var>n</var> ![<]({{ images_dir }}/symbol_lt.gif) 1,000,000.\n\n"
|
data/data/problems/161.yml
CHANGED
@@ -3,9 +3,10 @@
|
|
3
3
|
:name: Triominoes
|
4
4
|
:url: http://projecteuler.net/problem=161
|
5
5
|
:content: "A triomino is a shape consisting of three squares joined via the edges.\rThere
|
6
|
-
are two basic forms:\n\n![](/
|
7
|
-
|
6
|
+
are two basic forms:\n\n![]({{ images_dir }}/p_161_trio1.gif)\n\nIf all possible
|
7
|
+
orientations are taken into account there are six:\n\n![]({{ images_dir }}/p_161_trio3.gif)\n\nAny
|
8
8
|
n by m grid for which nxm is divisible by 3 can be tiled with triominoes. \n\rIf
|
9
9
|
we consider tilings that can be obtained by reflection or rotation from another
|
10
|
-
tiling as different there are 41 ways a 2 by 9 grid can be tiled with triominoes:\n\n![](
|
11
|
-
how many ways can a 9 by 12 grid be tiled in this
|
10
|
+
tiling as different there are 41 ways a 2 by 9 grid can be tiled with triominoes:\n\n![]({{
|
11
|
+
images_dir }}/p_161_k9.gif)\n\nIn how many ways can a 9 by 12 grid be tiled in this
|
12
|
+
way by triominoes?\n\n"
|
data/data/problems/163.yml
CHANGED
@@ -4,14 +4,14 @@
|
|
4
4
|
:url: http://projecteuler.net/problem=163
|
5
5
|
:content: "Consider an equilateral triangle in which straight lines are drawn from
|
6
6
|
each vertex to the middle of the opposite side, such as in the _size 1_ triangle
|
7
|
-
in the sketch below.\n\n ![](/
|
7
|
+
in the sketch below.\n\n ![]({{ images_dir }}/p_163.gif)\n\nSixteen triangles of
|
8
|
+
either different shape or size or orientation or location can now be observed in
|
9
|
+
that triangle. Using _size 1_ triangles as building blocks, larger triangles can
|
10
|
+
be formed, such as the _size 2_ triangle in the above sketch. One-hundred and four
|
8
11
|
triangles of either different shape or size or orientation or location can now be
|
9
|
-
observed in that triangle
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
_n<sup>2</sup> size 1_ triangle building blocks.\n\nIf we denote T(<var>n</var>)
|
16
|
-
as the number of triangles present in a triangle of _size <var>n</var>_, then\n\nT(1)
|
17
|
-
= 16 \n\rT(2) = 104\n\nFind T(36).\n\n"
|
12
|
+
observed in that _size 2_ triangle.\n\nIt can be observed that the _size 2_ triangle
|
13
|
+
contains 4 _size 1_ triangle building blocks. A _size 3_ triangle would contain
|
14
|
+
9 _size 1_ triangle building blocks and a _size n_ triangle would thus contain _n<sup>2</sup>
|
15
|
+
size 1_ triangle building blocks.\n\nIf we denote T(<var>n</var>) as the number
|
16
|
+
of triangles present in a triangle of _size <var>n</var>_, then\n\nT(1) = 16 \n\rT(2)
|
17
|
+
= 104\n\nFind T(36).\n\n"
|
data/data/problems/165.yml
CHANGED
@@ -20,7 +20,7 @@
|
|
20
20
|
have no common point. So among the three line segments, we find one true intersection
|
21
21
|
point.\n\nNow let us do the same for 5000 line segments. To this end, we generate
|
22
22
|
20000 numbers using the so-called \"Blum Blum Shub\" pseudo-random number generator.\n\ns<sub>0</sub>
|
23
|
-
= 290797 \n \n \n\rs<sub>n+1</sub> = s<sub>n</sub> ![×](/
|
23
|
+
= 290797 \n \n \n\rs<sub>n+1</sub> = s<sub>n</sub> ![×]({{ images_dir }}/symbol_times.gif)s<sub>n</sub>
|
24
24
|
(modulo 50515093) \n \n \n\rt<sub>n</sub> = s<sub>n</sub> (modulo 500)\n\nTo
|
25
25
|
create each line segment, we use four consecutive numbers t<sub>n</sub>. That is,
|
26
26
|
the first line segment is given by:\n\n(t<sub>1</sub>, t<sub>2</sub>) to (t<sub>3</sub>,
|
data/data/problems/166.yml
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
:id: 166
|
3
3
|
:name: Criss Cross
|
4
4
|
:url: http://projecteuler.net/problem=166
|
5
|
-
:content: "A 4x4 grid is filled with digits d, 0 ![≤](/
|
6
|
-
d ![≤](/
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
d ![≤](/
|
11
|
-
|
5
|
+
:content: "A 4x4 grid is filled with digits d, 0 ![≤]({{ images_dir }}/symbol_le.gif)
|
6
|
+
d ![≤]({{ images_dir }}/symbol_le.gif) 9.\n\nIt can be seen that in the grid\n\n6
|
7
|
+
3 3 0 \n\r5 0 4 3 \n\r0 7 1 4 \n\r1 2 4 5\n\nthe sum of each row and each column
|
8
|
+
has the value 12. Moreover the sum of each diagonal is also 12.\n\nIn how many ways
|
9
|
+
can you fill a 4x4 grid with the digits d, 0 ![≤]({{ images_dir }}/symbol_le.gif)
|
10
|
+
d ![≤]({{ images_dir }}/symbol_le.gif) 9 so that each row, each column, and both
|
11
|
+
diagonals have the same sum?\n\n"
|
data/data/problems/167.yml
CHANGED
@@ -9,7 +9,6 @@
|
|
9
9
|
example, the sequence U(1,2) begins with \n\r1, 2, 3 = 1 + 2, 4 = 1 + 3, 6 = 2
|
10
10
|
+ 4, 8 = 2 + 6, 11 = 3 + 8; \n\r5 does not belong to it because 5 = 1 + 4 = 2 +
|
11
11
|
3 has two representations as the sum of two previous members, likewise 7 = 1 + 6
|
12
|
-
= 3 + 4.\n\nFind ![∑](/
|
13
|
-
for 2 ![≤](/
|
14
|
-
|
15
|
-
<var>k</var> = 10<sup>11</sup>.\n\n"
|
12
|
+
= 3 + 4.\n\nFind ![∑]({{ images_dir }}/symbol_sum.gif)U(2,2<var>n</var>+1)<sub><var>k</var></sub>
|
13
|
+
for 2 ![≤]({{ images_dir }}/symbol_le.gif) <var>n</var> ![≤]({{ images_dir }}/symbol_le.gif)10,
|
14
|
+
where <var>k</var> = 10<sup>11</sup>.\n\n"
|
data/data/problems/168.yml
CHANGED
@@ -4,8 +4,8 @@
|
|
4
4
|
:url: http://projecteuler.net/problem=168
|
5
5
|
:content: "Consider the number 142857. We can right-rotate this number by moving the
|
6
6
|
last digit (7) to the front of it, giving us 714285. \n\rIt can be verified that
|
7
|
-
714285=5 ![×](/
|
8
|
-
|
9
|
-
|
10
|
-
<var>n</var> ![<](/
|
11
|
-
|
7
|
+
714285=5 ![×]({{ images_dir }}/symbol_times.gif)142857. \n\rThis demonstrates an
|
8
|
+
unusual property of 142857: it is a divisor of its right-rotation.\n\nFind the last
|
9
|
+
5 digits of the sum of all integers <var>n</var>, 10 ![<]({{ images_dir }}/symbol_lt.gif)
|
10
|
+
<var>n</var> ![<]({{ images_dir }}/symbol_lt.gif) 10<sup>100</sup>, that have this
|
11
|
+
property.\n\n"
|
data/data/problems/170.yml
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
:id: 170
|
3
3
|
:name: Find the largest 0 to 9 pandigital that can be formed by concatenating products
|
4
4
|
:url: http://projecteuler.net/problem=170
|
5
|
-
:content: "Take the number 6 and multiply it by each of 1273 and 9854:\n\n6 ![×](
|
6
|
-
1273 = 7638 \n\r6 ![×](/
|
5
|
+
:content: "Take the number 6 and multiply it by each of 1273 and 9854:\n\n6 ![×]({{
|
6
|
+
images_dir }}/symbol_times.gif) 1273 = 7638 \n\r6 ![×]({{ images_dir }}/symbol_times.gif)
|
7
7
|
9854 = 59124\n\nBy concatenating these products we get the 1 to 9 pandigital 763859124.
|
8
8
|
We will call 763859124 the \"concatenated product of 6 and (1273,9854)\". Notice
|
9
9
|
too, that the concatenation of the input numbers, 612739854, is also 1 to 9 pandigital.\n\nThe
|
data/data/problems/171.yml
CHANGED
@@ -6,6 +6,6 @@
|
|
6
6
|
the squares of the digits (in base 10) of <var>n</var>, e.g.\n\nf(3) = 3<sup>2</sup>
|
7
7
|
= 9, \n\rf(25) = 2<sup>2</sup> + 5<sup>2</sup> = 4 + 25 = 29, \n\rf(442) = 4<sup>2</sup>
|
8
8
|
+ 4<sup>2</sup> + 2<sup>2</sup> = 16 + 16 + 4 = 36\n\nFind the last nine digits
|
9
|
-
of the sum of all <var>n</var>, 0 ![<](/
|
10
|
-
|
11
|
-
|
9
|
+
of the sum of all <var>n</var>, 0 ![<]({{ images_dir }}/symbol_lt.gif) <var>n</var>
|
10
|
+
![<]({{ images_dir }}/symbol_lt.gif) 10<sup>20</sup>, such that f(<var>n</var>)
|
11
|
+
is a perfect square.\n\n"
|
data/data/problems/173.yml
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
:content: |+
|
7
7
|
We shall define a square lamina to be a square outline with a square "hole" so that the shape possesses vertical and horizontal symmetry. For example, using exactly thirty-two square tiles we can form two different square laminae:
|
8
8
|
|
9
|
-
![](/
|
9
|
+
![]({{ images_dir }}/p_173_square_laminas.gif)
|
10
10
|
|
11
11
|
With one-hundred tiles, and not necessarily using all of the tiles at one time, it is possible to form forty-one different square laminae.
|
12
12
|
|
data/data/problems/174.yml
CHANGED
@@ -8,11 +8,11 @@
|
|
8
8
|
|
9
9
|
Given eight tiles it is possible to form a lamina in only one way: 3x3 square with a 1x1 hole in the middle. However, using thirty-two tiles it is possible to form two distinct laminae.
|
10
10
|
|
11
|
-
![](/
|
11
|
+
![]({{ images_dir }}/p_173_square_laminas.gif)
|
12
12
|
|
13
13
|
If <var>t</var> represents the number of tiles used, we shall say that <var>t</var> = 8 is type L(1) and <var>t</var> = 32 is type L(2).
|
14
14
|
|
15
|
-
Let N(<var>n</var>) be the number of <var>t</var> ![≤](/
|
15
|
+
Let N(<var>n</var>) be the number of <var>t</var> ![≤]({{ images_dir }}/symbol_le.gif) 1000000 such that <var>t</var> is type L(<var>n</var>); for example, N(15) = 832.
|
16
16
|
|
17
|
-
What is ![∑](/
|
17
|
+
What is ![∑]({{ images_dir }}/symbol_sum.gif) N(<var>n</var>) for 1 ![≤]({{ images_dir }}/symbol_le.gif) <var>n</var> ![≤]({{ images_dir }}/symbol_le.gif) 10?
|
18
18
|
|
data/data/problems/175.yml
CHANGED
@@ -7,10 +7,10 @@
|
|
7
7
|
as a sum of powers of 2 where no power occurs more than twice. \n \n \n\r\rFor
|
8
8
|
example, f(10)=5 since there are five different ways to express 10: \n10 = 8+2
|
9
9
|
= 8+1+1 = 4+4+2 = 4+2+2+1+1 = 4+4+1+1 \n \n \n\r\rIt can be shown that for every
|
10
|
-
fraction <var>p/q</var> (<var>p</var> ![>](/
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
fraction <var>p/q</var> (<var>p</var> ![>]({{ images_dir }}/symbol_gt.gif)0, <var>q</var>
|
11
|
+
![>]({{ images_dir }}/symbol_gt.gif)0) there exists at least one integer <var>n</var>
|
12
|
+
such that \n f(<var>n</var>)/f(<var>n</var>-1)=<var>p/q</var>. \n \n \n\rFor
|
13
|
+
instance, the smallest <var>n</var> for which f(<var>n</var>)/f(<var>n</var>-1)=13/17
|
14
14
|
is 241. \n\rThe binary expansion of 241 is 11110001. \n\rReading this binary number
|
15
15
|
from the most significant bit to the least significant bit there are 4 one's, 3
|
16
16
|
zeroes and 1 one. We shall call the string 4,3,1 the Shortened Binary Expansion
|
data/data/problems/177.yml
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
:content: |+
|
6
6
|
Let ABCD be a convex quadrilateral, with diagonals AC and BD. At each vertex the diagonal makes an angle with each of the two sides, creating eight corner angles.
|
7
7
|
|
8
|
-
![](/
|
8
|
+
![]({{ images_dir }}/p_177_quad.gif)
|
9
9
|
|
10
10
|
For example, at vertex A, the two angles are CAD, CAB.
|
11
11
|
|
data/data/problems/179.yml
CHANGED
@@ -3,5 +3,5 @@
|
|
3
3
|
:name: Consecutive positive divisors
|
4
4
|
:url: http://projecteuler.net/problem=179
|
5
5
|
:content: |+
|
6
|
-
Find the number of integers 1 ![<](/
|
6
|
+
Find the number of integers 1 ![<]({{ images_dir }}/symbol_lt.gif) n ![<]({{ images_dir }}/symbol_lt.gif) 10<sup>7</sup>, for which <var>n</var> and <var>n</var> + 1 have the same number of positive divisors. For example, 14 has the positive divisors 1, 2, 7, 14 while 15 has 1, 3, 5, 15.
|
7
7
|
|
data/data/problems/180.yml
CHANGED
@@ -4,23 +4,22 @@
|
|
4
4
|
:url: http://projecteuler.net/problem=180
|
5
5
|
:content: "For any integer <var>n</var>, consider the three functions\n\n<var>f</var><sub>1,<var>n</var></sub>(<var>x</var>,<var>y</var>,<var>z</var>)
|
6
6
|
= <var>x</var><sup><var>n</var>+1</sup> + <var>y</var><sup><var>n</var>+1</sup>
|
7
|
-
![−](/
|
8
|
-
\ \n<var>f</var><sub>2,<var>n</var></sub>(<var>x</var>,<var>y</var>,<var>z</var>)
|
7
|
+
![−]({{ images_dir }}/symbol_minus.gif) <var>z</var><sup><var>n</var>+1</sup> \n<var>f</var><sub>2,<var>n</var></sub>(<var>x</var>,<var>y</var>,<var>z</var>)
|
9
8
|
= (<var>xy</var> + <var>yz</var> + <var>zx</var>)\\*(<var>x</var><sup><var>n</var>-1</sup>
|
10
|
-
+ <var>y</var><sup><var>n</var>-1</sup> ![−](/
|
9
|
+
+ <var>y</var><sup><var>n</var>-1</sup> ![−]({{ images_dir }}/symbol_minus.gif)
|
11
10
|
<var>z</var><sup><var>n</var>-1</sup>) \n<var>f</var><sub>3,<var>n</var></sub>(<var>x</var>,<var>y</var>,<var>z</var>)
|
12
11
|
= <var>xyz</var>\\*(<var>x</var><sup><var>n</var>-2</sup> + <var>y</var><sup><var>n</var>-2</sup>
|
13
|
-
![−](/
|
12
|
+
![−]({{ images_dir }}/symbol_minus.gif) <var>z</var><sup><var>n</var>-2</sup>)\n\nand
|
14
13
|
their combination\n\n<var>f</var><sub><var>n</var></sub>(<var>x</var>,<var>y</var>,<var>z</var>)
|
15
14
|
= <var>f</var><sub>1,<var>n</var></sub>(<var>x</var>,<var>y</var>,<var>z</var>)
|
16
15
|
+ <var>f</var><sub>2,<var>n</var></sub>(<var>x</var>,<var>y</var>,<var>z</var>)
|
17
|
-
![−](/
|
16
|
+
![−]({{ images_dir }}/symbol_minus.gif) <var>f</var><sub>3,<var>n</var></sub>(<var>x</var>,<var>y</var>,<var>z</var>)\n\nWe
|
18
17
|
call (<var>x</var>,<var>y</var>,<var>z</var>) a golden triple of order <var>k</var>
|
19
18
|
if <var>x</var>, <var>y</var>, and <var>z</var> are all rational numbers of the
|
20
|
-
form <var>a</var> / <var>b</var> with \n\r0 ![<](/
|
21
|
-
<var>a</var> ![<](/
|
22
|
-
<var>
|
23
|
-
|
19
|
+
form <var>a</var> / <var>b</var> with \n\r0 ![<]({{ images_dir }}/symbol_lt.gif)
|
20
|
+
<var>a</var> ![<]({{ images_dir }}/symbol_lt.gif) <var>b</var> ![≤]({{ images_dir
|
21
|
+
}}/symbol_le.gif) <var>k</var> and there is (at least) one integer <var>n</var>,
|
22
|
+
so that <var>f</var><sub><var>n</var></sub>(<var>x</var>,<var>y</var>,<var>z</var>)
|
24
23
|
= 0.\n\nLet <var>s</var>(<var>x</var>,<var>y</var>,<var>z</var>) = <var>x</var>
|
25
24
|
+ <var>y</var> + <var>z</var>. \n\rLet <var>t</var> = <var>u</var> / <var>v</var>
|
26
25
|
be the sum of all distinct <var>s</var>(<var>x</var>,<var>y</var>,<var>z</var>)
|
data/data/problems/182.yml
CHANGED
@@ -4,27 +4,25 @@
|
|
4
4
|
:url: http://projecteuler.net/problem=182
|
5
5
|
:content: "The RSA encryption is based on the following procedure:\n\nGenerate two
|
6
6
|
distinct primes <var>p</var> and <var>q</var>. \nCompute <var>n=pq</var> and φ=(<var>p</var>-1)(<var>q</var>-1).
|
7
|
-
\ \n\rFind an integer <var>e</var>, 1 ![<](/
|
8
|
-
![<](/
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
<var>
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
\ \n\
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
and gcd(<var>e</var>,φ)=1, so that the number of unconcealed messages for this value
|
30
|
-
of <var>e</var> is at a minimum.\n\n"
|
7
|
+
\ \n\rFind an integer <var>e</var>, 1 ![<]({{ images_dir }}/symbol_lt.gif)<var>e</var>
|
8
|
+
![<]({{ images_dir }}/symbol_lt.gif)φ, such that gcd(<var>e</var>,φ)=1.\n\nA message
|
9
|
+
in this system is a number in the interval [0,<var>n</var>-1]. \n\rA text to be
|
10
|
+
encrypted is then somehow converted to messages (numbers in the interval [0,<var>n</var>-1]).
|
11
|
+
\ \n\rTo encrypt the text, for each message, <var>m</var>, <var>c</var>=<var>m</var><sup><var>e</var></sup>
|
12
|
+
mod <var>n</var> is calculated.\n\nTo decrypt the text, the following procedure
|
13
|
+
is needed: calculate <var>d</var> such that <var>ed</var>=1 mod φ, then for each
|
14
|
+
encrypted message, <var>c</var>, calculate <var>m=c<sup>d</sup></var> mod <var>n</var>.\n\nThere
|
15
|
+
exist values of <var>e</var> and <var>m</var> such that <var>m<sup>e</sup></var>
|
16
|
+
mod <var>n=m</var>. \nWe call messages <var>m</var> for which <var>m<sup>e</sup></var>
|
17
|
+
mod <var>n=m</var> unconcealed messages.\n\nAn issue when choosing <var>e</var>
|
18
|
+
is that there should not be too many unconcealed messages. \nFor instance, let
|
19
|
+
<var>p</var>=19 and <var>q</var>=37. \n\rThen <var>n</var>=19\\*37=703 and φ=18\\*36=648.
|
20
|
+
\ \n\rIf we choose <var>e</var>=181, then, although gcd(181,648)=1 it turns out
|
21
|
+
that all possible messages \n<var>m</var> (0 ![≤]({{ images_dir }}/symbol_le.gif)<var>m</var>
|
22
|
+
![≤]({{ images_dir }}/symbol_le.gif)<var>n</var>-1) are unconcealed when calculating
|
23
|
+
<var>m<sup>e</sup></var> mod <var>n</var>. \n\rFor any valid choice of <var>e</var>
|
24
|
+
there exist some unconcealed messages. \n\rIt's important that the number of unconcealed
|
25
|
+
messages is at a minimum.\n\nChoose <var>p</var>=1009 and <var>q</var>=3643. \n\rFind
|
26
|
+
the sum of all values of <var>e</var>, 1 ![<]({{ images_dir }}/symbol_lt.gif)<var>e</var>
|
27
|
+
![<]({{ images_dir }}/symbol_lt.gif)φ(1009,3643) and gcd(<var>e</var>,φ)=1, so that
|
28
|
+
the number of unconcealed messages for this value of <var>e</var> is at a minimum.\n\n"
|
data/data/problems/183.yml
CHANGED
@@ -4,18 +4,17 @@
|
|
4
4
|
:url: http://projecteuler.net/problem=183
|
5
5
|
:content: "Let N be a positive integer and let N be split into <var>k</var> equal
|
6
6
|
parts, <var>r</var> = N/<var>k</var>, so that N = <var>r</var> + <var>r</var> +
|
7
|
-
... + <var>r</var>. \n\rLet P be the product of these parts, P = <var>r</var> ![×](
|
8
|
-
<var>r</var> ![×](/
|
9
|
-
... ![×](/
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
=
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
N ![≤](/
|
20
|
-
|
21
|
-
N ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) 10000.\n\n"
|
7
|
+
... + <var>r</var>. \n\rLet P be the product of these parts, P = <var>r</var> ![×]({{
|
8
|
+
images_dir }}/symbol_times.gif) <var>r</var> ![×]({{ images_dir }}/symbol_times.gif)
|
9
|
+
... ![×]({{ images_dir }}/symbol_times.gif) <var>r</var> = <var>r</var><sup><var>k</var></sup>.\n\nFor
|
10
|
+
example, if 11 is split into five equal parts, 11 = 2.2 + 2.2 + 2.2 + 2.2 + 2.2,
|
11
|
+
then P = 2.2<sup>5</sup> = 51.53632.\n\nLet M(N) = P<sub>max</sub> for a given value
|
12
|
+
of N.\n\nIt turns out that the maximum for N = 11 is found by splitting eleven into
|
13
|
+
four equal parts which leads to P<sub>max</sub> = (11/4)<sup>4</sup>; that is, M(11)
|
14
|
+
= 14641/256 = 57.19140625, which is a terminating decimal.\n\nHowever, for N = 8
|
15
|
+
the maximum is achieved by splitting it into three equal parts, so M(8) = 512/27,
|
16
|
+
which is a non-terminating decimal.\n\nLet D(N) = N if M(N) is a non-terminating
|
17
|
+
decimal and D(N) = -N if M(N) is a terminating decimal.\n\nFor example, ΣD(N) for
|
18
|
+
5 ![≤]({{ images_dir }}/symbol_le.gif) N ![≤]({{ images_dir }}/symbol_le.gif) 100
|
19
|
+
is 2438.\n\nFind ΣD(N) for 5 ![≤]({{ images_dir }}/symbol_le.gif) N ![≤]({{ images_dir
|
20
|
+
}}/symbol_le.gif) 10000.\n\n"
|
data/data/problems/184.yml
CHANGED
@@ -3,11 +3,11 @@
|
|
3
3
|
:name: Triangles containing the origin
|
4
4
|
:url: http://projecteuler.net/problem=184
|
5
5
|
:content: |+
|
6
|
-
Consider the set <var>I<sub>r</sub></var> of points (<var>x</var>,<var>y</var>) with integer co-ordinates in the interior of the circle with radius <var>r</var>, centered at the origin, i.e. <var>x</var><sup>2</sup> + <var>y</var><sup>2</sup> ![<](/
|
6
|
+
Consider the set <var>I<sub>r</sub></var> of points (<var>x</var>,<var>y</var>) with integer co-ordinates in the interior of the circle with radius <var>r</var>, centered at the origin, i.e. <var>x</var><sup>2</sup> + <var>y</var><sup>2</sup> ![<]({{ images_dir }}/symbol_lt.gif) <var>r</var><sup>2</sup>.
|
7
7
|
|
8
8
|
For a radius of 2, <var>I</var><sub>2</sub> contains the nine points (0,0), (1,0), (1,1), (0,1), (-1,1), (-1,0), (-1,-1), (0,-1) and (1,-1). There are eight triangles having all three vertices in <var>I</var><sub>2</sub> which contain the origin in the interior. Two of them are shown below, the others are obtained from these by rotation.
|
9
9
|
|
10
|
-
![](/
|
10
|
+
![]({{ images_dir }}/p_184.gif)
|
11
11
|
|
12
12
|
For a radius of 3, there are 360 triangles containing the origin in the interior and having all vertices in <var>I</var><sub>3</sub> and for <var>I</var><sub>5</sub> the number is 10600.
|
13
13
|
|