euler-manager 0.0.6 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/255.yml
CHANGED
@@ -6,44 +6,43 @@
|
|
6
6
|
as the square root of <var>n</var> rounded to the nearest integer.\n\nThe following
|
7
7
|
procedure (essentially Heron's method adapted to integer arithmetic) finds the rounded-square-root
|
8
8
|
of <var>n</var>:\n\nLet <var>d</var> be the number of digits of the number <var>n</var>.
|
9
|
-
\ \n\rIf <var>d</var> is odd, set <var>x</var><sub>0</sub> = 2 10<sup>(<var>d</var>-1)⁄2</sup>. \n\rIf <var>d</var> is even,
|
11
|
+
set <var>x</var><sub>0</sub> = 7 10<sup>(<var>d</var>-2)⁄2</sup>.
|
12
|
+
\ \n\rRepeat:\n\n\n\n<!--\r\n<table align='center'>\r\n<tr><td><var>x</var><sub><var>k</var>+1</sub>
|
13
|
+
=</td>\r\n<td style='font-size:220%'>⌊</td>\r\n<td style='text-align:center;'><var>x</var><sub><var>k</var></sub>
|
14
|
+
+ <img src='images/symbol_lceil.gif' width='6' height='16' alt='⌈' border='0'
|
15
|
+
style='vertical-align:middle;' /><var>n</var>⁄<var>x</var><sub><var>k</var></sub><img
|
15
16
|
src='images/symbol_rceil.gif' width='6' height='16' alt='⌉' border='0' style='vertical-align:middle;'
|
16
17
|
/><br />\r\n<img src='images/blackdot.gif' width='75' height='1' alt='' /><br />\r\n2</td><td><td
|
17
18
|
style='font-size:220%'>⌋</td></tr>\r\n</table> -->\n\nuntil <var>x</var><sub><var>k</var>+1</sub>
|
18
19
|
= <var>x</var><sub><var>k</var></sub>.\n\nAs an example, let us find the rounded-square-root
|
19
20
|
of <var>n</var> = 4321. \n<var>n</var> has 4 digits, so <var>x</var><sub>0</sub>
|
20
|
-
= 7 10<sup>(4-2)⁄2</sup> = 70. \n <!--<var>x</var><sub>1</sub> = <img src='images/symbol_lfloor.gif'
|
23
|
+
width='6' height='16' alt='⌊' border='0' style='vertical-align:middle;' />(70
|
24
|
+
+ <img src='images/symbol_lceil.gif' width='6' height='16' alt='⌈' border='0'
|
25
|
+
style='vertical-align:middle;' />4321⁄70<img src='images/symbol_rceil.gif'
|
26
|
+
width='6' height='16' alt='⌉' border='0' style='vertical-align:middle;' />)⁄2<img
|
27
|
+
src='images/symbol_rfloor.gif' width='6' height='16' alt='⌋' border='0' style='vertical-align:middle;'
|
28
|
+
/> = 66.<br />\r\n<var>x</var><sub>2</sub> = <img src='images/symbol_lfloor.gif'
|
29
|
+
width='6' height='16' alt='⌊' border='0' style='vertical-align:middle;' />(66
|
30
|
+
+ <img src='images/symbol_lceil.gif' width='6' height='16' alt='⌈' border='0'
|
31
|
+
style='vertical-align:middle;' />4321⁄66<img src='images/symbol_rceil.gif'
|
32
|
+
width='6' height='16' alt='⌉' border='0' style='vertical-align:middle;' />)⁄2<img
|
33
|
+
src='images/symbol_rfloor.gif' width='6' height='16' alt='⌋' border='0' style='vertical-align:middle;'
|
34
|
+
/> = 66.--> \n\rSince <var>x</var><sub>2</sub> = <var>x</var><sub>1</sub>, we stop
|
35
|
+
here. \n\rSo, after just two iterations, we have found that the rounded-square-root
|
36
|
+
of 4321 is 66 (the actual square root is 65.7343137…).\n\nThe number of iterations
|
37
|
+
required when using this method is surprisingly low. \n\rFor example, we can find
|
38
|
+
the rounded-square-root of a 5-digit integer (10,000 
|
39
|
+
<var>n</var>  99,999) with an average of 3.2102888889
|
40
|
+
iterations (the average value was rounded to 10 decimal places).\n\nUsing the procedure
|
41
|
+
described above, what is the average number of iterations required to find the rounded-square-root
|
42
|
+
of a 14-digit number (10<sup>13</sup>  <var>n</var>
|
43
|
+
 10<sup>14</sup>)? \n\rGive your answer rounded
|
44
|
+
to 10 decimal places.\n\nNote: The symbols <var>x</var>
|
45
|
+
 and <var>x</var>
|
46
|
+
 represent the <dfn title=\"the largest integer
|
47
|
+
not greater than x\">floor function</dfn> and <dfn title=\"the smallest integer
|
48
|
+
not less than x\">ceiling function</dfn> respectively.\n\n"
|
data/data/problems/256.yml
CHANGED
@@ -4,32 +4,28 @@
|
|
4
4
|
:url: http://projecteuler.net/problem=256
|
5
5
|
:content: "Tatami are rectangular mats, used to completely cover the floor of a room,
|
6
6
|
without overlap.\n\nAssuming that the only type of available tatami has dimensions
|
7
|
-
1 
|
7
|
+
1 2, there are obviously some limitations
|
8
|
+
for the shape and size of the rooms that can be covered.\n\nFor this problem, we
|
9
|
+
consider only rectangular rooms with integer dimensions <var>a</var>, <var>b</var>
|
10
|
+
and even size <var>s</var> = <var>a</var>·<var>b</var>. \n\rWe use the term 'size'
|
11
|
+
to denote the floor surface area of the room, and — without loss of generality —
|
12
|
+
we add the condition <var>a</var>  <var>b</var>.\n\nThere
|
13
|
+
is one rule to follow when laying out tatami: there must be no points where corners
|
14
|
+
of four different mats meet. \n\rFor example, consider the two arrangements below
|
15
|
+
for a 4 4 room:\n\n 
|
17
16
|
\ \n\nThe arrangement on the left is acceptable, whereas the one on the right is
|
18
17
|
not: a red \" **X** \" in the middle, marks the point where four tatami meet.\n\nBecause
|
19
18
|
of this rule, certain even-sized rooms cannot be covered with tatami: we call them
|
20
19
|
tatami-free rooms. \n\rFurther, we define <var>T</var>(<var>s</var>) as the number
|
21
20
|
of tatami-free rooms of size <var>s</var>.\n\nThe smallest tatami-free room has
|
22
|
-
size <var>s</var> = 70 and dimensions 7 10.
|
23
22
|
\ \n\rAll the other rooms of size <var>s</var> = 70 can be covered with tatami;
|
24
|
-
they are: 1 55,
|
31
|
-
30 44 and
|
32
|
-
33 40.
|
23
|
+
they are: 1 70, 2 35
|
24
|
+
and 5 14. \n\rHence, <var>T</var>(70) =
|
25
|
+
1.\n\nSimilarly, we can verify that <var>T</var>(1320) = 5 because there are exactly
|
26
|
+
5 tatami-free rooms of size <var>s</var> = 1320: \n\r20 66,
|
27
|
+
22 60, 24 55,
|
28
|
+
30 44 and 33 40.
|
33
29
|
\ \n\rIn fact, <var>s</var> = 1320 is the smallest room-size <var>s</var> for which
|
34
30
|
<var>T</var>(<var>s</var>) = 5.\n\nFind the smallest room-size <var>s</var> for
|
35
31
|
which <var>T</var>(<var>s</var>) = 200.\n\n"
|
data/data/problems/257.yml
CHANGED
@@ -2,13 +2,13 @@
|
|
2
2
|
:id: 257
|
3
3
|
:name: Angular Bisectors
|
4
4
|
:url: http://projecteuler.net/problem=257
|
5
|
-
:content: "Given is an integer sided triangle ABC with sides a  b  c. \r(AB = c, BC = a and
|
7
|
+
AC = b). \n\rThe angular bisectors of the triangle intersect the sides at points
|
8
|
+
E, F and G (see picture below).\n\n  \n\nThe
|
9
|
+
segments EF, EG and FG partition the triangle ABC into four smaller triangles: AEG,
|
10
|
+
BFE, CGF and EFG. \n\rIt can be proven that for each of these four triangles the
|
11
|
+
ratio area(ABC)/area(subtriangle) is rational. \n\rHowever, there exist triangles
|
12
12
|
for which some or all of these ratios are integral.\n\nHow many triangles ABC with
|
13
|
-
perimeter 100,000,000 exist so that the ratio
|
14
|
+
area(ABC)/area(AEG) is integral?\n\n"
|
data/data/problems/258.yml
CHANGED
@@ -3,9 +3,8 @@
|
|
3
3
|
:name: A lagged Fibonacci sequence
|
4
4
|
:url: http://projecteuler.net/problem=258
|
5
5
|
:content: "A sequence is defined as:\n\n- <var>g</var><sub><var>k</var></sub> = 1,
|
6
|
-
for 0  <var>k</var> 
|
7
|
+
1999\n- <var>g</var><sub><var>k</var></sub> = <var>g</var><sub><var>k</var>-2000</sub>
|
8
|
+
+ <var>g</var><sub><var>k</var>-1999</sub>, for <var>k</var>  2000.\r\n\nFind <var>g</var><sub><var>k</var></sub> mod 20092010
|
10
|
+
for <var>k</var> = 10<sup>18</sup>.\n\n"
|
data/data/problems/26.yml
CHANGED
@@ -17,5 +17,5 @@
|
|
17
17
|
|
18
18
|
Where 0.1(6) means 0.166666..., and has a 1-digit recurring cycle. It can be seen that <sup>1</sup>/<sub>7</sub> has a 6-digit recurring cycle.
|
19
19
|
|
20
|
-
Find the value of _d_  1000 for which <sup>1</sup>/<sub><i>d</i></sub> contains the longest recurring cycle in its decimal fraction part.
|
21
21
|
|
data/data/problems/260.yml
CHANGED
@@ -15,12 +15,10 @@
|
|
15
15
|
what the first player does. \n \rFor example, (0,1,2) and (1,3,3) are losing configurations:
|
16
16
|
any legal move leaves a winning configuration for the second player.\n\nConsider
|
17
17
|
all losing configurations (x<sub>i</sub>,y<sub>i</sub>,z<sub>i</sub>) where x<sub>i</sub>
|
18
|
-

|
25
|
-
z<sub>i</sub> 
|
18
|
+
 y<sub>i</sub> 
|
19
|
+
z<sub>i</sub>  100. \n\rWe can verify that
|
20
|
+
Σ(x<sub>i</sub>+y<sub>i</sub>+z<sub>i</sub>) = 173895 for these.\n\nFind Σ(x<sub>i</sub>+y<sub>i</sub>+z<sub>i</sub>)
|
21
|
+
where (x<sub>i</sub>,y<sub>i</sub>,z<sub>i</sub>) ranges over the losing configurations
|
22
|
+
\ \n\rwith x<sub>i</sub>  y<sub>i</sub>  z<sub>i</sub> 
|
26
24
|
1000.\n\n"
|
data/data/problems/261.yml
CHANGED
@@ -3,15 +3,14 @@
|
|
3
3
|
:name: Pivotal Square Sums
|
4
4
|
:url: http://projecteuler.net/problem=261
|
5
5
|
:content: "Let us call a positive integer <var>k</var> a <var>square-pivot</var>,
|
6
|
-
if there is a pair of integers <var>m</var> <sup>2</sup> + ... + (<var>n</var>+<var>m</var>)<sup>2</sup>.\n\nSome
|
6
|
+
if there is a pair of integers <var>m</var> 
|
7
|
+
0 and <var>n</var>  <var>k</var>, such that
|
8
|
+
the sum of the (<var>m</var>+1) consecutive squares up to <var>k</var> equals the
|
9
|
+
sum of the <var>m</var> consecutive squares from (<var>n</var>+1) on:\n\n\r(<var>k</var>-<var>m</var>)<sup>2</sup>
|
10
|
+
+ ... + <var>k</var><sup>2</sup> = (<var>n</var>+1)<sup>2</sup> + ... + (<var>n</var>+<var>m</var>)<sup>2</sup>.\n\nSome
|
12
11
|
small square-pivots are\n\n- **4** : 3<sup>2</sup> + **4** <sup>2</sup>\r = 5<sup>2</sup>\n-
|
13
12
|
**21** : 20<sup>2</sup> + **21** <sup>2</sup> = 29<sup>2</sup>\n- **24** : 21<sup>2</sup>
|
14
13
|
+ 22<sup>2</sup> + 23<sup>2</sup> + **24** <sup>2</sup> = 25<sup>2</sup> + 26<sup>2</sup>
|
15
14
|
+ 27<sup>2</sup>\n- **110** : 108<sup>2</sup> + 109<sup>2</sup> + **110** <sup>2</sup>
|
16
15
|
= 133<sup>2</sup> + 134<sup>2</sup>\n\nFind the sum of all **distinct** square-pivots
|
17
|
-
 10<sup>10</sup>.\n\n"
|
data/data/problems/262.yml
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
:url: http://projecteuler.net/problem=262
|
5
5
|
:content: "The following equation represents the _continuous_ topography of a mountainous
|
6
6
|
region, giving the <dfn title=\"height above sea level\">elevation</dfn> <var>h</var>
|
7
|
-
at any point (<var>x</var>,<var>y</var>):\n\n :\n\n 
|
8
8
|
\ \n\nA mosquito intends to fly from A(200,200) to B(1400,1400), without leaving
|
9
9
|
the area given by 0 ≤ <var>x</var>, <var>y</var> ≤ 1600.\n\nBecause of the intervening
|
10
10
|
mountains, it first rises straight up to a point A', having elevation <var>f</var>.
|
data/data/problems/264.yml
CHANGED
@@ -6,14 +6,13 @@
|
|
6
6
|
coordinates\">lattice points</dfn>.\n- <dfn title=\"Centre of the circumscribed
|
7
7
|
circle\">Circumcentre</dfn> at the origin O.\n- <dfn title=\"Point where the three
|
8
8
|
altitudes meet\">Orthocentre</dfn> at the point H(5, 0).\n\nThere are nine such
|
9
|
-
triangles having a perimeter  50. \n\rListed
|
10
|
+
and shown in ascending order of their perimeter, they are:\n\n| A(-4, 3), B(5, 0),
|
11
|
+
C(4, -3) \n\rA(4, 3), B(5, 0), C(-4, -3) \n\rA(-3, 4), B(5, 0), C(3, -4) \n \n
|
12
|
+
\ \n \n \n\rA(3, 4), B(5, 0), C(-3, -4) \n\rA(0, 5), B(5, 0), C(0, -5) \n\rA(1,
|
13
|
+
8), B(8, -1), C(-4, -7) \n \n \n \n \n\rA(8, 1), B(1, -8), C(-4, 7) \n\rA(2,
|
14
|
+
9), B(9, -2), C(-6, -7) \n\rA(9, 2), B(2, -9), C(-6, 7) \n |  |\n\nThe sum of their perimeters, rounded to four
|
16
|
+
decimal places, is 291.0089.\n\nFind all such triangles with a perimeter  10<sup>5</sup>. \n\rEnter as your answer the sum of
|
18
|
+
their perimeters rounded to four decimal places.\n\n"
|
data/data/problems/265.yml
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
:url: http://projecteuler.net/problem=265
|
5
5
|
:content: "2<sup>N</sup> binary digits can be placed in a circle so that all the N-digit
|
6
6
|
clockwise subsequences are distinct.\n\nFor N=3, two such circular arrangements
|
7
|
-
are possible, ignoring rotations:\n\n \n\nFor
|
8
8
|
the first arrangement, the 3-digit subsequences, in clockwise order, are: \n 000,
|
9
9
|
001, 010, 101, 011, 111, 110 and 100.\n\nEach circular arrangement can be encoded
|
10
10
|
as a number by concatenating the binary digits starting with the subsequence of
|
data/data/problems/27.yml
CHANGED
@@ -6,14 +6,13 @@
|
|
6
6
|
turns out that the formula will produce 40 primes for the consecutive values _n_
|
7
7
|
= 0 to 39. However, when _n_ = 40, 40<sup>2</sup> + 40 + 41 = 40(40 + 1) + 41 is
|
8
8
|
divisible by 41, and certainly when _n_ = 41, 41² + 41 + 41 is clearly divisible
|
9
|
-
by 41.\n\nThe incredible formula _n_²  79_n_
|
10
|
+
+ 1601 was discovered, which produces 80 primes for the consecutive values _n_ =
|
11
|
+
0 to 79. The product of the coefficients, 79
|
12
|
+
and 1601, is 126479.\n\nConsidering quadratics
|
13
|
+
of the form:\n\n> _n_² + _an_ + _b_, where |_a_| 
|
14
|
+
1000 and |_b_|  1000 \n> \n> \n> where |_n_|
|
15
|
+
is the modulus/absolute value of _n_ \n> e.g. |11| = 11 and | 4| = 4\n\nFind the product of the coefficients, _a_ and _b_,
|
17
|
+
for the quadratic expression that produces the maximum number of primes for consecutive
|
18
|
+
values of _n_, starting with _n_ = 0.\n\n"
|
data/data/problems/270.yml
CHANGED
@@ -3,15 +3,15 @@
|
|
3
3
|
:name: Cutting Squares
|
4
4
|
:url: http://projecteuler.net/problem=270
|
5
5
|
:content: |+
|
6
|
-
A square piece of paper with integer dimensions N N is placed with a corner at the origin and two of its sides along the <var>x</var>- and <var>y</var>-axes. Then, we cut it up respecting the following rules:
|
7
7
|
|
8
8
|
- We only make straight cuts between two points lying on different sides of the square, and having integer coordinates.
|
9
9
|
- Two cuts cannot cross, but several cuts can meet at the same border point.
|
10
10
|
- Proceed until no more legal cuts can be made.
|
11
11
|
|
12
|
-
Counting any reflections or rotations as distinct, we call C(N) the number of ways to cut an N  the number of ways to cut an N N square. For example, C(1) = 2 and C(2) = 30 (shown below).
|
13
13
|
|
14
|
-

|
15
15
|
|
16
16
|
What is C(30) mod 10<sup>8</sup> ?
|
17
17
|
|
data/data/problems/271.yml
CHANGED
@@ -3,9 +3,8 @@
|
|
3
3
|
:name: Modular Cubes, part 1
|
4
4
|
:url: http://projecteuler.net/problem=271
|
5
5
|
:content: "For a positive number <var>n</var>, define S(<var>n</var>) as the sum of
|
6
|
-
the integers <var>x,</var> for which 1 .\n\n"
|
6
|
+
the integers <var>x,</var> for which 1 <var>x</var>
|
7
|
+
<var>n</var> and \n <var>x</var><sup>3</sup>
|
8
|
+
1 mod <var>n</var>.\n\nWhen <var>n</var>=91,
|
9
|
+
there are 8 possible values for <var>x</var>, namely : 9, 16, 22, 29, 53, 74, 79,
|
10
|
+
81. \n\rThus, S(91)=9+16+22+29+53+74+79+81=363.\n\nFind S(13082761331670030).\n\n"
|
data/data/problems/272.yml
CHANGED
@@ -3,10 +3,9 @@
|
|
3
3
|
:name: Modular Cubes, part 2
|
4
4
|
:url: http://projecteuler.net/problem=272
|
5
5
|
:content: "For a positive number <var>n</var>, define C(<var>n</var>) as the number
|
6
|
-
of the integers <var>x,</var> for which 1 =242.\n\n"
|
6
|
+
of the integers <var>x,</var> for which 1 <var>x</var>
|
7
|
+
<var>n</var> and \n <var>x</var><sup>3</sup>
|
8
|
+
1 mod <var>n</var>.\n\nWhen <var>n</var>=91,
|
9
|
+
there are 8 possible values for <var>x</var>, namely : 9, 16, 22, 29, 53, 74, 79,
|
10
|
+
81. \n\rThus, C(91)=8.\n\nFind the sum of the positive numbers <var>n</var> 10<sup>11</sup> for which C(<var>n</var>)=242.\n\n"
|
data/data/problems/273.yml
CHANGED
@@ -3,15 +3,15 @@
|
|
3
3
|
:name: Sum of Squares
|
4
4
|
:url: http://projecteuler.net/problem=273
|
5
5
|
:content: |+
|
6
|
-
Consider equations of the form: <var>a</var><sup>2</sup> + <var>b</var><sup>2</sup> = <var>N</var>, 0  <var>a</var>  <var>b</var>, <var>a</var>, <var>b</var> and <var>N</var> integer.
|
7
7
|
|
8
8
|
For <var>N</var>=65 there are two solutions:
|
9
9
|
|
10
10
|
<var>a</var>=1, <var>b</var>=8 and <var>a</var>=4, <var>b</var>=7.
|
11
11
|
|
12
|
-
We call S(<var>N</var>) the sum of the values of <var>a</var> of all solutions of <var>a</var><sup>2</sup> + <var>b</var><sup>2</sup> = <var>N</var>, 0  the sum of the values of <var>a</var> of all solutions of <var>a</var><sup>2</sup> + <var>b</var><sup>2</sup> = <var>N</var>, 0  <var>a</var>  <var>b</var>, <var>a</var>, <var>b</var> and <var>N</var> integer.
|
13
13
|
|
14
14
|
Thus S(65) = 1 + 4 = 5.
|
15
15
|
|
16
|
-
Find S(<var>N</var>), for all squarefree <var>N</var> only divisible by primes of the form 4<var>k</var>+1 with 4<var>k</var>+1  150.
|
17
17
|
|
data/data/problems/274.yml
CHANGED
@@ -2,19 +2,19 @@
|
|
2
2
|
:id: 274
|
3
3
|
:name: Divisibility Multipliers
|
4
4
|
:url: http://projecteuler.net/problem=274
|
5
|
-
:content: "For each integer <var>p</var> 
|
9
|
-
the last digit of <var>n</var>) + (the last digit of <var>n</var>) \\*
|
10
|
-
is, if <var>m</var> is the divisibility multiplier for <var>p</var>,
|
11
|
-
is divisible by <var>p</var> if and only if <var>n</var>
|
12
|
-
<var>n</var> is much larger than <var>p</var>,
|
13
|
-
|
14
|
-
divisibility test for <var>p</var>.)\n\nFor
|
15
|
-
for 113 is 34.\n\n<var>f</var>(76275) = 7627
|
16
|
-
are both divisible by 113 \n<var>f</var>(12345)
|
17
|
-
and 1404 are both not divisible by 113\n\nThe sum
|
18
|
-
for the primes that are coprime to 10 and less than 1000 is 39517. What is the sum
|
5
|
+
:content: "For each integer <var>p</var>  1 coprime
|
6
|
+
to 10 there is a positive _divisibility multiplier_ <var>m</var>  <var>p</var> which preserves divisibility by <var>p</var> for
|
8
|
+
the following function on any positive integer, <var>n</var>:\n\n<var>f</var>(<var>n</var>)
|
9
|
+
= (all but the last digit of <var>n</var>) + (the last digit of <var>n</var>) \\*
|
10
|
+
<var>m</var>\n\nThat is, if <var>m</var> is the divisibility multiplier for <var>p</var>,
|
11
|
+
then <var>f</var>(<var>n</var>) is divisible by <var>p</var> if and only if <var>n</var>
|
12
|
+
is divisible by <var>p</var>.\n\n(When <var>n</var> is much larger than <var>p</var>,
|
13
|
+
<var>f</var>(<var>n</var>) will be less than <var>n</var> and repeated application
|
14
|
+
of <var>f</var> provides a multiplicative divisibility test for <var>p</var>.)\n\nFor
|
15
|
+
example, the divisibility multiplier for 113 is 34.\n\n<var>f</var>(76275) = 7627
|
16
|
+
+ 5 \\* 34 = 7797 : 76275 and 7797 are both divisible by 113 \n<var>f</var>(12345)
|
17
|
+
= 1234 + 5 \\* 34 = 1404 : 12345 and 1404 are both not divisible by 113\n\nThe sum
|
19
18
|
of the divisibility multipliers for the primes that are coprime to 10 and less than
|
20
|
-
|
19
|
+
1000 is 39517. What is the sum of the divisibility multipliers for the primes that
|
20
|
+
are coprime to 10 and less than 10<sup>7</sup>?\n\n"
|
data/data/problems/275.yml
CHANGED
@@ -12,6 +12,6 @@
|
|
12
12
|
to zero.\n\nWhen counting the sculptures, any arrangements which are simply reflections
|
13
13
|
about the <var>y</var>-axis, are <u>not</u> counted as distinct. For example, the
|
14
14
|
18 balanced sculptures of order 6 are shown below; note that each pair of mirror
|
15
|
-
images (about the <var>y</var>-axis) is counted as one sculpture:\n\n  is counted as one sculpture:\n\n \n\nThere are 964 balanced sculptures of order 10 and 360505
|
17
|
+
of order 15. \nHow many balanced sculptures are there of order 18?\n\n"
|
data/data/problems/276.yml
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
:id: 276
|
3
3
|
:name: Primitive Triangles
|
4
4
|
:url: http://projecteuler.net/problem=276
|
5
|
-
:content: "Consider the triangles with integer sides a, b and c with a  b  c. \n\rAn integer sided
|
7
|
+
triangle (a,b,c) is called primitive if <dfn title=\" gcd(a,b,c)=gcd(a,gcd(b,c))\">
|
8
8
|
gcd(a,b,c)</dfn>=1. \n\rHow many primitive integer sided triangles exist with
|
9
9
|
a perimeter not exceeding 10 000 000?\n\n"
|
data/data/problems/277.yml
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
corresponds to the steps \"DdDddUUdDD\".\n\nOf course, there are other sequences
|
16
16
|
that begin with that same sequence \"DdDddUUdDD....\". \n\rFor instance, if <var>a</var><sub>1</sub>=1004064,
|
17
17
|
then the sequence is DdDddUUdDDDdUDUUUdDdUUDDDUdDD. \n\rIn fact, 1004064 is the
|
18
|
-
smallest possible <var>a</var><sub>1</sub> 
|
19
19
|
10<sup>6</sup> that begins with the sequence DdDddUUdDD.\n\nWhat is the smallest
|
20
|
-
<var>a</var><sub>1</sub>  10<sup>15</sup> that
|
21
|
+
begins with the sequence \"UDDDUdddDDUDDddDdDddDDUDDdUUDd\"?\n\n"
|
data/data/problems/278.yml
CHANGED
@@ -2,23 +2,21 @@
|
|
2
2
|
:id: 278
|
3
3
|
:name: Linear Combinations of Semiprimes
|
4
4
|
:url: http://projecteuler.net/problem=278
|
5
|
-
:content: "Given the values of integers 1  <var>a</var><sub><var>n</var></sub>,
|
5
|
+
:content: "Given the values of integers 1  <var>a</var><sub>1</sub>
|
6
|
+
 <var>a</var><sub>2</sub> ...  <var>a</var><sub><var>n</var></sub>,
|
9
8
|
consider the linear combination \n <var>q</var><sub>1</sub><var>a</var><sub>1</sub>
|
10
9
|
+ <var>q</var><sub>2</sub><var>a</var><sub>2</sub> + ... + <var>q</var><sub><var>n</var></sub><var>a</var><sub><var>n</var></sub>
|
11
|
-
= <var>b</var>, using only integer values <var>q</var><sub><var>k</var></sub>  = 195.\n\nFind  0.\n\nNote that for a given set of <var>a</var><sub><var>k</var></sub>,
|
12
|
+
it may be that not all values of <var>b</var> are possible. \n\rFor instance, if
|
13
|
+
<var>a</var><sub>1</sub> = 5 and <var>a</var><sub>2</sub> = 7, there are no <var>q</var><sub>1</sub>
|
14
|
+
 0 and <var>q</var><sub>2</sub>  0 such that <var>b</var> could be \n \r1, 2, 3, 4, 6, 8, 9, 11,
|
16
|
+
13, 16, 18 or 23.\r \n\rIn fact, 23 is the largest impossible value of <var>b</var>
|
17
|
+
for <var>a</var><sub>1</sub> = 5 and <var>a</var><sub>2</sub> = 7. \n We therefore
|
18
|
+
call <var>f</var>(5, 7) = 23. \n Similarly, it can be shown that <var>f</var>(6,
|
19
|
+
10, 15)=29 and <var>f</var>(14, 22, 77) = 195.\n\nFind 
|
21
20
|
<var>f</var>(<var>p*q,p*r,q*r</var>), where <var>p</var>, <var>q</var> and <var>r</var>
|
22
|
-
are prime numbers and <var>p</var> < <var>q</var> 
|
22
|
+
<var>r</var>  5000.\n\n"
|
data/data/problems/281.yml
CHANGED
@@ -5,10 +5,10 @@
|
|
5
5
|
:content: "You are given a pizza (perfect circle) that has been cut into <var>m</var>·<var>n</var>
|
6
6
|
equal pieces and you want to have exactly one topping on each slice.\n\nLet <var>f</var>(<var>m</var>,<var>n</var>)
|
7
7
|
denote the number of ways you can have toppings on the pizza with <var>m</var> different
|
8
|
-
toppings (<var>m</var>  2), using each topping
|
9
|
+
on exactly <var>n</var> slices (<var>n</var>  1).
|
10
10
|
\ \nReflections are considered distinct, rotations are not.\n\nThus, for instance,
|
11
11
|
<var>f</var>(2,1) = 1, <var>f</var>(2,2) = <var>f</var>(3,1) = 2 and <var>f</var>(3,2) = 16.
|
12
|
-
\ \n<var>f</var>(3,2) is shown below:\n\n  is shown below:\n\n \n\nFind
|
13
13
|
the sum of all <var>f</var>(<var>m</var>,<var>n</var>) such that <var>f</var>(<var>m</var>,<var>n</var>)
|
14
|
-
 10<sup>15</sup>.\n\n"
|
data/data/problems/282.yml
CHANGED
@@ -5,9 +5,9 @@
|
|
5
5
|
:content: |+
|
6
6
|
For non-negative integers <var>m</var>, <var>n</var>, the Ackermann function <var>A</var>(<var>m</var>, <var>n</var>) is defined as follows:
|
7
7
|
|
8
|
-

|
9
9
|
|
10
10
|
For example <var>A</var>(1, 0) = 2, <var>A</var>(2, 2) = 7 and <var>A</var>(3, 4) = 125.
|
11
11
|
|
12
|
-
Find <var>A</var>(<var>n</var>, <var>n</var>) and give your answer mod 14<sup>8</sup>.
|
13
13
|
|
data/data/problems/284.yml
CHANGED
@@ -9,11 +9,10 @@
|
|
9
9
|
the 3-digit number c37 is also a steady square: c37<sup>2</sup> = aa0c37, and the
|
10
10
|
sum of its digits is c+3+7=18 in the same numbering system. The letters a, b, c
|
11
11
|
and d are used for the 10, 11, 12 and 13 digits respectively, in a manner similar
|
12
|
-
to the hexadecimal numbering system.\n\nFor 1 
|
13
|
+
n  9, the sum of the digits of all the n-digit
|
14
|
+
steady squares in the base 14 numbering system is 2d8 (582 decimal). Steady squares
|
15
|
+
with leading 0's are not allowed.\n\nFind the sum of the digits of all the n-digit
|
16
|
+
steady squares in the base 14 numbering system for \n\r1 
|
17
|
+
n  10000 (decimal) and give your answer in the
|
18
|
+
base 14 system using lower case letters where necessary.\n\n"
|