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.
Files changed (303) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -0
  3. data/data/images/sod_13.gif +4 -0
  4. data/data/problems/100.yml +1 -1
  5. data/data/problems/101.yml +16 -16
  6. data/data/problems/102.yml +2 -3
  7. data/data/problems/103.yml +16 -16
  8. data/data/problems/105.yml +2 -2
  9. data/data/problems/106.yml +2 -2
  10. data/data/problems/107.yml +15 -15
  11. data/data/problems/108.yml +13 -16
  12. data/data/problems/109.yml +16 -17
  13. data/data/problems/11.yml +22 -23
  14. data/data/problems/110.yml +9 -10
  15. data/data/problems/114.yml +30 -41
  16. data/data/problems/116.yml +19 -25
  17. data/data/problems/117.yml +24 -33
  18. data/data/problems/120.yml +3 -3
  19. data/data/problems/122.yml +18 -20
  20. data/data/problems/123.yml +2 -2
  21. data/data/problems/124.yml +18 -23
  22. data/data/problems/126.yml +10 -11
  23. data/data/problems/127.yml +7 -7
  24. data/data/problems/128.yml +1 -1
  25. data/data/problems/130.yml +6 -7
  26. data/data/problems/131.yml +1 -1
  27. data/data/problems/132.yml +1 -1
  28. data/data/problems/134.yml +2 -2
  29. data/data/problems/135.yml +2 -2
  30. data/data/problems/136.yml +2 -2
  31. data/data/problems/137.yml +4 -4
  32. data/data/problems/138.yml +4 -4
  33. data/data/problems/139.yml +1 -1
  34. data/data/problems/14.yml +12 -13
  35. data/data/problems/140.yml +3 -3
  36. data/data/problems/142.yml +1 -1
  37. data/data/problems/143.yml +2 -2
  38. data/data/problems/144.yml +3 -3
  39. data/data/problems/147.yml +1 -1
  40. data/data/problems/149.yml +11 -13
  41. data/data/problems/15.yml +3 -3
  42. data/data/problems/150.yml +8 -8
  43. data/data/problems/151.yml +1 -1
  44. data/data/problems/152.yml +1 -1
  45. data/data/problems/153.yml +24 -26
  46. data/data/problems/154.yml +10 -9
  47. data/data/problems/155.yml +3 -3
  48. data/data/problems/156.yml +7 -8
  49. data/data/problems/157.yml +3 -4
  50. data/data/problems/158.yml +4 -5
  51. data/data/problems/159.yml +3 -3
  52. data/data/problems/161.yml +5 -4
  53. data/data/problems/163.yml +10 -10
  54. data/data/problems/165.yml +1 -1
  55. data/data/problems/166.yml +7 -7
  56. data/data/problems/167.yml +3 -4
  57. data/data/problems/168.yml +5 -5
  58. data/data/problems/170.yml +2 -2
  59. data/data/problems/171.yml +3 -3
  60. data/data/problems/173.yml +1 -1
  61. data/data/problems/174.yml +3 -3
  62. data/data/problems/175.yml +4 -4
  63. data/data/problems/177.yml +1 -1
  64. data/data/problems/179.yml +1 -1
  65. data/data/problems/180.yml +8 -9
  66. data/data/problems/182.yml +22 -24
  67. data/data/problems/183.yml +14 -15
  68. data/data/problems/184.yml +2 -2
  69. data/data/problems/186.yml +10 -11
  70. data/data/problems/187.yml +6 -8
  71. data/data/problems/189.yml +10 -9
  72. data/data/problems/190.yml +1 -1
  73. data/data/problems/192.yml +11 -12
  74. data/data/problems/194.yml +8 -8
  75. data/data/problems/195.yml +2 -2
  76. data/data/problems/197.yml +5 -6
  77. data/data/problems/198.yml +11 -12
  78. data/data/problems/199.yml +7 -7
  79. data/data/problems/20.yml +8 -10
  80. data/data/problems/202.yml +1 -1
  81. data/data/problems/207.yml +4 -4
  82. data/data/problems/208.yml +4 -5
  83. data/data/problems/21.yml +5 -6
  84. data/data/problems/210.yml +4 -5
  85. data/data/problems/211.yml +1 -1
  86. data/data/problems/212.yml +22 -26
  87. data/data/problems/213.yml +5 -6
  88. data/data/problems/214.yml +8 -9
  89. data/data/problems/215.yml +4 -4
  90. data/data/problems/216.yml +5 -5
  91. data/data/problems/217.yml +8 -10
  92. data/data/problems/218.yml +1 -1
  93. data/data/problems/22.yml +1 -1
  94. data/data/problems/220.yml +15 -15
  95. data/data/problems/221.yml +4 -5
  96. data/data/problems/223.yml +5 -6
  97. data/data/problems/224.yml +5 -6
  98. data/data/problems/226.yml +8 -8
  99. data/data/problems/228.yml +4 -5
  100. data/data/problems/229.yml +16 -16
  101. data/data/problems/230.yml +4 -4
  102. data/data/problems/231.yml +4 -5
  103. data/data/problems/233.yml +1 -1
  104. data/data/problems/234.yml +9 -10
  105. data/data/problems/236.yml +4 -4
  106. data/data/problems/237.yml +3 -3
  107. data/data/problems/238.yml +3 -4
  108. data/data/problems/241.yml +4 -4
  109. data/data/problems/242.yml +2 -2
  110. data/data/problems/243.yml +12 -12
  111. data/data/problems/244.yml +10 -11
  112. data/data/problems/245.yml +14 -15
  113. data/data/problems/246.yml +10 -9
  114. data/data/problems/247.yml +12 -13
  115. data/data/problems/251.yml +3 -3
  116. data/data/problems/252.yml +6 -7
  117. data/data/problems/254.yml +2 -2
  118. data/data/problems/255.yml +35 -36
  119. data/data/problems/256.yml +16 -20
  120. data/data/problems/257.yml +9 -9
  121. data/data/problems/258.yml +5 -6
  122. data/data/problems/26.yml +1 -1
  123. data/data/problems/260.yml +6 -8
  124. data/data/problems/261.yml +6 -7
  125. data/data/problems/262.yml +1 -1
  126. data/data/problems/264.yml +10 -11
  127. data/data/problems/265.yml +1 -1
  128. data/data/problems/27.yml +10 -11
  129. data/data/problems/270.yml +3 -3
  130. data/data/problems/271.yml +5 -6
  131. data/data/problems/272.yml +6 -7
  132. data/data/problems/273.yml +3 -3
  133. data/data/problems/274.yml +15 -15
  134. data/data/problems/275.yml +3 -3
  135. data/data/problems/276.yml +3 -3
  136. data/data/problems/277.yml +3 -3
  137. data/data/problems/278.yml +15 -17
  138. data/data/problems/281.yml +4 -4
  139. data/data/problems/282.yml +2 -2
  140. data/data/problems/284.yml +7 -8
  141. data/data/problems/287.yml +18 -17
  142. data/data/problems/288.yml +1 -1
  143. data/data/problems/289.yml +1 -1
  144. data/data/problems/29.yml +12 -13
  145. data/data/problems/290.yml +1 -1
  146. data/data/problems/291.yml +3 -3
  147. data/data/problems/292.yml +1 -1
  148. data/data/problems/293.yml +7 -7
  149. data/data/problems/295.yml +8 -8
  150. data/data/problems/296.yml +4 -5
  151. data/data/problems/297.yml +4 -5
  152. data/data/problems/299.yml +11 -12
  153. data/data/problems/300.yml +10 -9
  154. data/data/problems/301.yml +2 -2
  155. data/data/problems/303.yml +3 -3
  156. data/data/problems/304.yml +6 -7
  157. data/data/problems/305.yml +3 -2
  158. data/data/problems/306.yml +8 -11
  159. data/data/problems/307.yml +2 -3
  160. data/data/problems/309.yml +8 -8
  161. data/data/problems/31.yml +1 -1
  162. data/data/problems/310.yml +6 -7
  163. data/data/problems/311.yml +11 -11
  164. data/data/problems/312.yml +5 -5
  165. data/data/problems/313.yml +4 -4
  166. data/data/problems/314.yml +4 -5
  167. data/data/problems/315.yml +26 -27
  168. data/data/problems/316.yml +2 -4
  169. data/data/problems/318.yml +27 -34
  170. data/data/problems/319.yml +11 -12
  171. data/data/problems/32.yml +1 -1
  172. data/data/problems/320.yml +1 -1
  173. data/data/problems/321.yml +3 -3
  174. data/data/problems/322.yml +4 -4
  175. data/data/problems/323.yml +7 -8
  176. data/data/problems/324.yml +8 -9
  177. data/data/problems/325.yml +1 -1
  178. data/data/problems/326.yml +2 -2
  179. data/data/problems/327.yml +27 -29
  180. data/data/problems/328.yml +2 -2
  181. data/data/problems/330.yml +13 -14
  182. data/data/problems/331.yml +12 -12
  183. data/data/problems/332.yml +10 -9
  184. data/data/problems/333.yml +15 -16
  185. data/data/problems/334.yml +14 -14
  186. data/data/problems/335.yml +2 -2
  187. data/data/problems/336.yml +5 -4
  188. data/data/problems/337.yml +7 -7
  189. data/data/problems/338.yml +21 -24
  190. data/data/problems/340.yml +6 -7
  191. data/data/problems/341.yml +3 -5
  192. data/data/problems/342.yml +6 -7
  193. data/data/problems/343.yml +8 -12
  194. data/data/problems/344.yml +1 -1
  195. data/data/problems/347.yml +8 -8
  196. data/data/problems/350.yml +5 -5
  197. data/data/problems/351.yml +1 -1
  198. data/data/problems/352.yml +25 -26
  199. data/data/problems/353.yml +1 -1
  200. data/data/problems/354.yml +6 -6
  201. data/data/problems/356.yml +2 -3
  202. data/data/problems/358.yml +13 -14
  203. data/data/problems/359.yml +1 -1
  204. data/data/problems/361.yml +2 -1
  205. data/data/problems/362.yml +11 -13
  206. data/data/problems/363.yml +6 -6
  207. data/data/problems/364.yml +3 -3
  208. data/data/problems/365.yml +2 -2
  209. data/data/problems/366.yml +4 -5
  210. data/data/problems/369.yml +1 -1
  211. data/data/problems/370.yml +3 -3
  212. data/data/problems/372.yml +6 -8
  213. data/data/problems/374.yml +5 -7
  214. data/data/problems/375.yml +5 -6
  215. data/data/problems/377.yml +2 -2
  216. data/data/problems/378.yml +2 -2
  217. data/data/problems/379.yml +7 -8
  218. data/data/problems/38.yml +9 -9
  219. data/data/problems/380.yml +12 -15
  220. data/data/problems/381.yml +8 -11
  221. data/data/problems/382.yml +6 -6
  222. data/data/problems/383.yml +4 -4
  223. data/data/problems/384.yml +7 -8
  224. data/data/problems/385.yml +8 -8
  225. data/data/problems/386.yml +2 -2
  226. data/data/problems/388.yml +5 -6
  227. data/data/problems/39.yml +1 -1
  228. data/data/problems/390.yml +4 -6
  229. data/data/problems/391.yml +11 -12
  230. data/data/problems/392.yml +1 -1
  231. data/data/problems/393.yml +2 -2
  232. data/data/problems/394.yml +6 -7
  233. data/data/problems/395.yml +5 -5
  234. data/data/problems/396.yml +15 -17
  235. data/data/problems/397.yml +5 -8
  236. data/data/problems/4.yml +1 -1
  237. data/data/problems/40.yml +1 -1
  238. data/data/problems/400.yml +5 -6
  239. data/data/problems/401.yml +2 -2
  240. data/data/problems/402.yml +7 -8
  241. data/data/problems/403.yml +9 -10
  242. data/data/problems/404.yml +5 -6
  243. data/data/problems/405.yml +7 -7
  244. data/data/problems/406.yml +8 -10
  245. data/data/problems/407.yml +9 -9
  246. data/data/problems/410.yml +5 -6
  247. data/data/problems/411.yml +11 -12
  248. data/data/problems/412.yml +9 -9
  249. data/data/problems/414.yml +13 -15
  250. data/data/problems/415.yml +2 -2
  251. data/data/problems/417.yml +4 -5
  252. data/data/problems/418.yml +7 -8
  253. data/data/problems/419.yml +8 -8
  254. data/data/problems/420.yml +5 -5
  255. data/data/problems/421.yml +11 -12
  256. data/data/problems/422.yml +9 -9
  257. data/data/problems/423.yml +5 -7
  258. data/data/problems/424.yml +8 -9
  259. data/data/problems/425.yml +2 -3
  260. data/data/problems/426.yml +3 -3
  261. data/data/problems/427.yml +8 -8
  262. data/data/problems/428.yml +16 -19
  263. data/data/problems/430.yml +4 -5
  264. data/data/problems/44.yml +3 -3
  265. data/data/problems/45.yml +2 -2
  266. data/data/problems/46.yml +8 -8
  267. data/data/problems/47.yml +6 -10
  268. data/data/problems/53.yml +8 -9
  269. data/data/problems/56.yml +1 -1
  270. data/data/problems/57.yml +5 -5
  271. data/data/problems/58.yml +1 -1
  272. data/data/problems/6.yml +1 -1
  273. data/data/problems/61.yml +4 -4
  274. data/data/problems/64.yml +39 -46
  275. data/data/problems/65.yml +13 -14
  276. data/data/problems/66.yml +10 -10
  277. data/data/problems/68.yml +4 -5
  278. data/data/problems/69.yml +2 -2
  279. data/data/problems/70.yml +3 -4
  280. data/data/problems/71.yml +3 -3
  281. data/data/problems/72.yml +3 -3
  282. data/data/problems/73.yml +3 -3
  283. data/data/problems/74.yml +15 -22
  284. data/data/problems/75.yml +1 -1
  285. data/data/problems/8.yml +14 -14
  286. data/data/problems/81.yml +7 -7
  287. data/data/problems/82.yml +4 -4
  288. data/data/problems/83.yml +4 -4
  289. data/data/problems/85.yml +1 -1
  290. data/data/problems/86.yml +8 -8
  291. data/data/problems/88.yml +22 -27
  292. data/data/problems/9.yml +6 -6
  293. data/data/problems/90.yml +13 -13
  294. data/data/problems/91.yml +8 -8
  295. data/data/problems/92.yml +7 -9
  296. data/data/problems/93.yml +9 -10
  297. data/data/problems/95.yml +1 -1
  298. data/data/problems/96.yml +17 -17
  299. data/data/problems/97.yml +2 -2
  300. data/data/problems/99.yml +2 -2
  301. data/lib/euler/problem.rb +6 -1
  302. data/lib/euler/version.rb +1 -1
  303. metadata +2 -2
@@ -2,30 +2,29 @@
2
2
  :id: 315
3
3
  :name: Digital root clocks
4
4
  :url: http://projecteuler.net/problem=315
5
- :content: " ![](/home/will/src/euler-manager/config/../data/images/p_315_clocks.gif)\n\nSam
6
- and Max are asked to transform two digital clocks into two \"digital root\" clocks.
7
- \ \n\rA digital root clock is a digital clock that calculates digital roots step
8
- by step.\n\nWhen a clock is fed a number, it will show it and then it will start
9
- the calculation, showing all the intermediate values until it gets to the result.
10
- \ \n\rFor example, if the clock is fed the number 137, it will show: \" **137**
11
- \" ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) \" **11**
12
- \" ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) \" **2**
13
- \" and then it will go black, waiting for the next number.\n\nEvery digital number
14
- consists of some light segments: three horizontal (top, middle, bottom) and four
15
- vertical (top-left, top-right, bottom-left, bottom-right). \n\rNumber \" **1**
16
- \" is made of vertical top-right and bottom-right, number \" **4** \" is made by
17
- middle horizontal and vertical top-left, top-right and bottom-right. Number \" **8**
18
- \" lights them all.\n\nThe clocks consume energy only when segments are turned on/off.
19
- \ \n\rTo turn on a \" **2** \" will cost 5 transitions, while a \" **7** \" will
20
- cost only 4 transitions.\n\nSam and Max built two different clocks.\n\nSam's clock
21
- is fed e.g. number 137: the clock shows \" **137** \", then the panel is turned
22
- off, then the next number (\" **11** \") is turned on, then the panel is turned
23
- off again and finally the last number (\" **2** \") is turned on and, after some
24
- time, off. \n\rFor the example, with number 137, Sam's clock requires:\n\n| \"
25
- **137** \" | : | (2 + 5 + 4) ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
26
- 2 = 22 transitions (\" **137** \" on/off). |\n| \" **11** \" | : | (2 + 2) ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
27
- 2 = 8 transitions (\" **11** \" on/off). |\n| \" **2** \" | : | (5) ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
28
- 2 = 10 transitions (\" **2** \" on/off). |\n\n\rFor a grand total of 40 transitions.\r\r\n\nMax's
5
+ :content: " ![]({{ images_dir }}/p_315_clocks.gif)\n\nSam and Max are asked to transform
6
+ two digital clocks into two \"digital root\" clocks. \n\rA digital root clock is
7
+ a digital clock that calculates digital roots step by step.\n\nWhen a clock is fed
8
+ a number, it will show it and then it will start the calculation, showing all the
9
+ intermediate values until it gets to the result. \n\rFor example, if the clock
10
+ is fed the number 137, it will show: \" **137** \" ![→]({{ images_dir }}/symbol_maps.gif)
11
+ \" **11** \" ![→]({{ images_dir }}/symbol_maps.gif) \" **2** \" and then it will
12
+ go black, waiting for the next number.\n\nEvery digital number consists of some
13
+ light segments: three horizontal (top, middle, bottom) and four vertical (top-left,
14
+ top-right, bottom-left, bottom-right). \n\rNumber \" **1** \" is made of vertical
15
+ top-right and bottom-right, number \" **4** \" is made by middle horizontal and
16
+ vertical top-left, top-right and bottom-right. Number \" **8** \" lights them all.\n\nThe
17
+ clocks consume energy only when segments are turned on/off. \n\rTo turn on a \"
18
+ **2** \" will cost 5 transitions, while a \" **7** \" will cost only 4 transitions.\n\nSam
19
+ and Max built two different clocks.\n\nSam's clock is fed e.g. number 137: the clock
20
+ shows \" **137** \", then the panel is turned off, then the next number (\" **11**
21
+ \") is turned on, then the panel is turned off again and finally the last number
22
+ (\" **2** \") is turned on and, after some time, off. \n\rFor the example, with
23
+ number 137, Sam's clock requires:\n\n| \" **137** \" | : | (2 + 5 + 4) ![×]({{ images_dir
24
+ }}/symbol_times.gif) 2 = 22 transitions (\" **137** \" on/off). |\n| \" **11** \"
25
+ | : | (2 + 2) ![×]({{ images_dir }}/symbol_times.gif) 2 = 8 transitions (\" **11**
26
+ \" on/off). |\n| \" **2** \" | : | (5) ![×]({{ images_dir }}/symbol_times.gif) 2
27
+ = 10 transitions (\" **2** \" on/off). |\n\n\rFor a grand total of 40 transitions.\r\r\n\nMax's
29
28
  clock works differently. Instead of turning off the whole panel, it is smart enough
30
29
  to turn off only those segments that won't be needed for the next number. \n\rFor
31
30
  number 137, Max's clock requires:\n\n| \" **137** \" \n \n \n | : \n \n \n
@@ -38,6 +37,6 @@
38
37
  (to turn on the remaining segments in order to get a \" **2** \") \n\r5 transitions
39
38
  (to turn off number \" **2** \"). |\n\n\rFor a grand total of 30 transitions.\r\r\n\nOf
40
39
  course, Max's clock consumes less power than Sam's one. \n\rThe two clocks are
41
- fed all the prime numbers between A = 10<sup>7</sup> and B = 2 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)10<sup>7</sup>.
42
- \ \n\rFind the difference between the total number of transitions needed by Sam's
43
- clock and that needed by Max's one.\n\n"
40
+ fed all the prime numbers between A = 10<sup>7</sup> and B = 2 ![×]({{ images_dir
41
+ }}/symbol_times.gif)10<sup>7</sup>. \n\rFind the difference between the total
42
+ number of transitions needed by Sam's clock and that needed by Max's one.\n\n"
@@ -19,7 +19,5 @@
19
19
  <var>n</var> = 535, then \n\rfor <var>p</var> = 31415926 **535** 897...., we get
20
20
  <var>k</var> = 9 \n\rfor <var>p</var> = 35528714365004956000049084876408468 **535**
21
21
  4..., we get <var>k</var> = 36 \n\retc and we find that <var>g</var>(535) = 1008.\n\nGiven
22
- that ![](/home/will/src/euler-manager/config/../data/images/p_316_decexp1.gif),
23
- find ![](/home/will/src/euler-manager/config/../data/images/p_316_decexp2.gif)\n\n<u><i>Note</i></u>:
24
- ![](/home/will/src/euler-manager/config/../data/images/p_316_decexp3.gif) represents
25
- the floor function.\r\n"
22
+ that ![]({{ images_dir }}/p_316_decexp1.gif), find ![]({{ images_dir }}/p_316_decexp2.gif)\n\n<u><i>Note</i></u>:
23
+ ![]({{ images_dir }}/p_316_decexp3.gif) represents the floor function.\r\n"
@@ -2,38 +2,31 @@
2
2
  :id: 318
3
3
  :name: 2011 nines
4
4
  :url: http://projecteuler.net/problem=318
5
- :content: "Consider the real number ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)2+
6
- ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)3. \n\rWhen
7
- we calculate the even powers of ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)2+
8
- ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)3\rwe get:
9
- \ \n\r( ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)2+
10
- ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)3)<sup>2</sup>
11
- = 9.898979485566356... \n\r( ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)2+
12
- ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)3)<sup>4</sup>
13
- = 97.98979485566356... \n\r( ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)2+
14
- ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)3)<sup>6</sup>
15
- = 969.998969071069263... \n\r( ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)2+
16
- ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)3)<sup>8</sup>
17
- = 9601.99989585502907... \n\r( ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)2+
18
- ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)3)<sup>10</sup>
19
- = 95049.999989479221... \n\r( ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)2+
20
- ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)3)<sup>12</sup>
21
- = 940897.9999989371855... \n\r( ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)2+
22
- ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)3)<sup>14</sup>
23
- = 9313929.99999989263... \n\r( ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)2+
24
- ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)3)<sup>16</sup>
25
- = 92198401.99999998915...\n\nIt looks like that the number of consecutive nines
26
- at the beginning of the fractional part of these powers is non-decreasing. \n\rIn
27
- fact it can be proven that the fractional part of ( ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)2+
28
- ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)3)<sup>2n</sup>
29
- approaches 1 for large n.\n\nConsider all real numbers of the form ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)p+
30
- ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)q with
31
- p and q positive integers and p ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)q,
32
- such that the fractional part \rof ( ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)p+
33
- ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)q)<sup>2n</sup>
5
+ :content: "Consider the real number ![√]({{ images_dir }}/symbol_radic.gif)2+ ![√]({{
6
+ images_dir }}/symbol_radic.gif)3. \n\rWhen we calculate the even powers of ![√]({{
7
+ images_dir }}/symbol_radic.gif)2+ ![√]({{ images_dir }}/symbol_radic.gif)3\rwe get:
8
+ \ \n\r( ![√]({{ images_dir }}/symbol_radic.gif)2+ ![√]({{ images_dir }}/symbol_radic.gif)3)<sup>2</sup>
9
+ = 9.898979485566356... \n\r( ![√]({{ images_dir }}/symbol_radic.gif)2+ ![√]({{
10
+ images_dir }}/symbol_radic.gif)3)<sup>4</sup> = 97.98979485566356... \n\r( ![√]({{
11
+ images_dir }}/symbol_radic.gif)2+ ![√]({{ images_dir }}/symbol_radic.gif)3)<sup>6</sup>
12
+ = 969.998969071069263... \n\r( ![√]({{ images_dir }}/symbol_radic.gif)2+ ![√]({{
13
+ images_dir }}/symbol_radic.gif)3)<sup>8</sup> = 9601.99989585502907... \n\r( ![√]({{
14
+ images_dir }}/symbol_radic.gif)2+ ![√]({{ images_dir }}/symbol_radic.gif)3)<sup>10</sup>
15
+ = 95049.999989479221... \n\r( ![√]({{ images_dir }}/symbol_radic.gif)2+ ![√]({{
16
+ images_dir }}/symbol_radic.gif)3)<sup>12</sup> = 940897.9999989371855... \n\r(
17
+ ![√]({{ images_dir }}/symbol_radic.gif)2+ ![√]({{ images_dir }}/symbol_radic.gif)3)<sup>14</sup>
18
+ = 9313929.99999989263... \n\r( ![√]({{ images_dir }}/symbol_radic.gif)2+ ![√]({{
19
+ images_dir }}/symbol_radic.gif)3)<sup>16</sup> = 92198401.99999998915...\n\nIt looks
20
+ like that the number of consecutive nines at the beginning of the fractional part
21
+ of these powers is non-decreasing. \n\rIn fact it can be proven that the fractional
22
+ part of ( ![√]({{ images_dir }}/symbol_radic.gif)2+ ![√]({{ images_dir }}/symbol_radic.gif)3)<sup>2n</sup>
23
+ approaches 1 for large n.\n\nConsider all real numbers of the form ![√]({{ images_dir
24
+ }}/symbol_radic.gif)p+ ![√]({{ images_dir }}/symbol_radic.gif)q with p and q positive
25
+ integers and p ![<]({{ images_dir }}/symbol_lt.gif)q, such that the fractional part
26
+ \rof ( ![√]({{ images_dir }}/symbol_radic.gif)p+ ![√]({{ images_dir }}/symbol_radic.gif)q)<sup>2n</sup>
34
27
  approaches 1 for large n.\n\nLet C(p,q,n) be the number of consecutive nines at
35
- the beginning of the fractional part of \n ( ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)p+
36
- ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)q)<sup>2n</sup>.\n\nLet
37
- N(p,q) be the minimal value of n such that C(p,q,n) ![≥](/home/will/src/euler-manager/config/../data/images/symbol_ge.gif)
38
- 2011.\n\nFind ![∑](/home/will/src/euler-manager/config/../data/images/symbol_sum.gif)N(p,q)
39
- for p+q ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) 2011.\n\n"
28
+ the beginning of the fractional part of \n ( ![√]({{ images_dir }}/symbol_radic.gif)p+
29
+ ![√]({{ images_dir }}/symbol_radic.gif)q)<sup>2n</sup>.\n\nLet N(p,q) be the minimal
30
+ value of n such that C(p,q,n) ![≥]({{ images_dir }}/symbol_ge.gif) 2011.\n\nFind
31
+ ![∑]({{ images_dir }}/symbol_sum.gif)N(p,q) for p+q ![≤]({{ images_dir }}/symbol_le.gif)
32
+ 2011.\n\n"
@@ -4,16 +4,15 @@
4
4
  :url: http://projecteuler.net/problem=319
5
5
  :content: "Let <var>x</var><sub>1</sub>, <var>x</var><sub>2</sub>,..., <var>x<sub>n</sub></var>
6
6
  be a sequence of length <var>n</var> such that:\n\n- <var>x</var><sub>1</sub> =
7
- 2\n- for all 1 ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)
8
- <var>i</var> ![](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
9
- <var>n</var> : <var>x</var><sub><var>i</var>-<i>1</i></sub> ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)
10
- <var>x<sub>i</sub></var>\n- for all <var>i</var> and <var>j</var> with 1 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
11
- <var>i</var>, <var>j</var> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
12
- <var>n</var> : (<var>x<sub>i</sub></var>)<var><sup> j</sup></var> ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)
13
- (<var>x<sub>j</sub></var> + 1)<var><sup>i</sup></var>\n\nThere are only five such
14
- sequences of length 2, namely:\r{2,4}, {2,5}, {2,6}, {2,7} and {2,8}. \n\rThere
15
- are 293 such sequences of length 5; three examples are given below: \n\r{2,5,11,25,55},
16
- {2,6,14,36,88}, {2,8,22,64,181}.\n\nLet <var>t</var>(<var>n</var>) denote the number
17
- of such sequences of length <var>n</var>. \n\rYou are given that <var>t</var>(10)
18
- = 86195 and <var>t</var>(20) = 5227991891.\n\nFind <var>t</var>(10<sup>10</sup>)
7
+ 2\n- for all 1 ![<]({{ images_dir }}/symbol_lt.gif) <var>i</var> ![≤]({{ images_dir
8
+ }}/symbol_le.gif) <var>n</var> : <var>x</var><sub><var>i</var>-<i>1</i></sub> ![<]({{
9
+ images_dir }}/symbol_lt.gif) <var>x<sub>i</sub></var>\n- for all <var>i</var> and
10
+ <var>j</var> with 1 ![≤]({{ images_dir }}/symbol_le.gif) <var>i</var>, <var>j</var>
11
+ ![≤]({{ images_dir }}/symbol_le.gif) <var>n</var> : (<var>x<sub>i</sub></var>)<var><sup>
12
+ j</sup></var> ![<]({{ images_dir }}/symbol_lt.gif) (<var>x<sub>j</sub></var> + 1)<var><sup>i</sup></var>\n\nThere
13
+ are only five such sequences of length 2, namely:\r{2,4}, {2,5}, {2,6}, {2,7} and
14
+ {2,8}. \n\rThere are 293 such sequences of length 5; three examples are given below:
15
+ \ \n\r{2,5,11,25,55}, {2,6,14,36,88}, {2,8,22,64,181}.\n\nLet <var>t</var>(<var>n</var>)
16
+ denote the number of such sequences of length <var>n</var>. \n\rYou are given that
17
+ <var>t</var>(10) = 86195 and <var>t</var>(20) = 5227991891.\n\nFind <var>t</var>(10<sup>10</sup>)
19
18
  and give your answer modulo 10<sup>9</sup>.\n\n"
data/data/problems/32.yml CHANGED
@@ -5,7 +5,7 @@
5
5
  :content: |+
6
6
  We shall say that an <var>n</var>-digit number is pandigital if it makes use of all the digits 1 to <var>n</var> exactly once; for example, the 5-digit number, 15234, is 1 through 5 pandigital.
7
7
 
8
- The product 7254 is unusual, as the identity, 39 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif) 186 = 7254, containing multiplicand, multiplier, and product is 1 through 9 pandigital.
8
+ The product 7254 is unusual, as the identity, 39 ![×]({{ images_dir }}/symbol_times.gif) 186 = 7254, containing multiplicand, multiplier, and product is 1 through 9 pandigital.
9
9
 
10
10
  Find the sum of all products whose multiplicand/multiplier/product identity can be written as a 1 through 9 pandigital.
11
11
 
@@ -5,7 +5,7 @@
5
5
  :content: |+
6
6
  Let N(<var>i</var>) be the smallest integer <var>n</var> such that <var>n</var>! is divisible by (<var>i</var>!)<sup>1234567890</sup>
7
7
 
8
- Let S(<var>u</var>)= ![∑](/home/will/src/euler-manager/config/../data/images/symbol_sum.gif)N(<var>i</var>) for 10 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) <var>i</var> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) <var>u</var>.
8
+ Let S(<var>u</var>)= ![∑]({{ images_dir }}/symbol_sum.gif)N(<var>i</var>) for 10 ![≤]({{ images_dir }}/symbol_le.gif) <var>i</var> ![≤]({{ images_dir }}/symbol_le.gif) <var>u</var>.
9
9
 
10
10
  S(1000)=614538266565663.
11
11
 
@@ -5,9 +5,9 @@
5
5
  :content: "A horizontal row comprising of 2<var>n</var> + 1 squares has <var>n</var>
6
6
  red counters placed at one end and <var>n</var> blue counters at the other end,
7
7
  being separated by a single empty square in the centre. For example, when <var>n</var>
8
- = 3.\n\n ![](/home/will/src/euler-manager/config/../data/images/p_321_swapping_counters_1.gif)\n\nA
9
- counter can move from one square to the next (slide) or can jump over another counter
10
- (hop) as long as the square next to that counter is unoccupied.\n\n ![](/home/will/src/euler-manager/config/../data/images/p_321_swapping_counters_2.gif)\n\nLet
8
+ = 3.\n\n ![]({{ images_dir }}/p_321_swapping_counters_1.gif)\n\nA counter can move
9
+ from one square to the next (slide) or can jump over another counter (hop) as long
10
+ as the square next to that counter is unoccupied.\n\n ![]({{ images_dir }}/p_321_swapping_counters_2.gif)\n\nLet
11
11
  M(<var>n</var>) represent the minimum number of moves/actions to completely reverse
12
12
  the positions of the coloured counters; that is, move all the red counters to the
13
13
  right and all the blue counters to the left.\n\nIt can be verified M(3) = 15, which
@@ -4,7 +4,7 @@
4
4
  :url: http://projecteuler.net/problem=322
5
5
  :content: "Let T(<var>m</var>, <var>n</var>) be the number of the binomial coefficients
6
6
  <sup><var>i</var></sup>C<sub><var>n</var></sub> that are divisible by 10 for <var>n</var>
7
- ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) <var>i</var>
8
- ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif) <var>m</var>(<var>i</var>,
9
- <var>m</var> and <var>n</var> are positive integers). \n\rYou are given that T(10<sup>9</sup>,
10
- 10<sup>7</sup>-10) = 989697000.\n\nFind T(10<sup>18</sup>, 10<sup>12</sup>-10).\n\n"
7
+ ![≤]({{ images_dir }}/symbol_le.gif) <var>i</var> ![<]({{ images_dir }}/symbol_lt.gif)
8
+ <var>m</var>(<var>i</var>, <var>m</var> and <var>n</var> are positive integers).
9
+ \ \n\rYou are given that T(10<sup>9</sup>, 10<sup>7</sup>-10) = 989697000.\n\nFind
10
+ T(10<sup>18</sup>, 10<sup>12</sup>-10).\n\n"
@@ -3,14 +3,13 @@
3
3
  :name: Bitwise-OR operations on random integers
4
4
  :url: http://projecteuler.net/problem=323
5
5
  :content: "Let <var>y</var><sub>0</sub>, <var>y</var><sub>1</sub>, <var>y</var><sub>2</sub>,...
6
- be a sequence of random unsigned 32 bit integers \n\r(i.e. 0 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
7
- <var>y<sub>i</sub></var> ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)
6
+ be a sequence of random unsigned 32 bit integers \n\r(i.e. 0 ![≤]({{ images_dir
7
+ }}/symbol_le.gif) <var>y<sub>i</sub></var> ![<]({{ images_dir }}/symbol_lt.gif)
8
8
  2<sup>32</sup>, every value equally likely).\n\nFor the sequence <var>x<sub>i</sub></var>
9
9
  the following recursion is given:\n\n- <var>x</var><sub>0</sub> = 0 and\n- <var>x<sub>i</sub></var>
10
10
  = <var>x</var><sub><var>i</var>-<i>1</i></sub> **|** <var>y</var><sub><var>i</var>-<i>1</i></sub>,
11
- for <var>i</var> ![>](/home/will/src/euler-manager/config/../data/images/symbol_gt.gif)
12
- 0. ( **|** is the bitwise-OR operator)\n\nIt can be seen that eventually there will
13
- be an index N such that <var>x<sub>i</sub></var> = 2<sup>32</sup> -1 (a bit-pattern
14
- of all ones) for all <var>i</var> ![≥](/home/will/src/euler-manager/config/../data/images/symbol_ge.gif)
15
- N.\n\nFind the expected value of N. \n\rGive your answer rounded to 10 digits
16
- after the decimal point.\n\n"
11
+ for <var>i</var> ![>]({{ images_dir }}/symbol_gt.gif) 0. ( **|** is the bitwise-OR
12
+ operator)\n\nIt can be seen that eventually there will be an index N such that <var>x<sub>i</sub></var>
13
+ = 2<sup>32</sup> -1 (a bit-pattern of all ones) for all <var>i</var> ![≥]({{ images_dir
14
+ }}/symbol_ge.gif) N.\n\nFind the expected value of N. \n\rGive your answer rounded
15
+ to 10 digits after the decimal point.\n\n"
@@ -3,12 +3,11 @@
3
3
  :name: Building a tower
4
4
  :url: http://projecteuler.net/problem=324
5
5
  :content: "Let <var>f</var>(<var>n</var>) represent the number of ways one can fill
6
- a 3 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)3 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)<var>n</var>
7
- tower with blocks of 2 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)1
8
- ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)1. \nYou're
9
- allowed to rotate the blocks in any way you like; however, rotations, reflections
10
- etc of the tower itself are counted as distinct.\n\nFor example (with <var>q</var>
11
- = 100000007) : \n<var>f</var>(2) = 229, \n<var>f</var>(4) = 117805, \n<var>f</var>(10)
12
- mod <var>q</var> = 96149360, \n<var>f</var>(10<sup>3</sup>) mod <var>q</var> =
13
- 24806056, \n<var>f</var>(10<sup>6</sup>) mod <var>q</var> = 30808124.\n\nFind <var>f</var>(10<sup>10000</sup>)
14
- mod 100000007.\n\n"
6
+ a 3 ![×]({{ images_dir }}/symbol_times.gif)3 ![×]({{ images_dir }}/symbol_times.gif)<var>n</var>
7
+ tower with blocks of 2 ![×]({{ images_dir }}/symbol_times.gif)1 ![×]({{ images_dir
8
+ }}/symbol_times.gif)1. \nYou're allowed to rotate the blocks in any way you like;
9
+ however, rotations, reflections etc of the tower itself are counted as distinct.\n\nFor
10
+ example (with <var>q</var> = 100000007) : \n<var>f</var>(2) = 229, \n<var>f</var>(4)
11
+ = 117805, \n<var>f</var>(10) mod <var>q</var> = 96149360, \n<var>f</var>(10<sup>3</sup>)
12
+ mod <var>q</var> = 24806056, \n<var>f</var>(10<sup>6</sup>) mod <var>q</var> =
13
+ 30808124.\n\nFind <var>f</var>(10<sup>10000</sup>) mod 100000007.\n\n"
@@ -13,7 +13,7 @@
13
13
 
14
14
  A _losing configuration_ is one where the second player can force a win, no matter what the first player does. For example, (2,3) and (3,4) are losing configurations: any legal move leaves a winning configuration for the second player.
15
15
 
16
- Define S(<var>N</var>) as the sum of (<var>x</var><sub><var>i</var></sub>+<var>y</var><sub><var>i</var></sub>) for all losing configurations (<var>x</var><sub><var>i</var></sub>,<var>y</var><sub><var>i</var></sub>), 0 ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif) <var>x</var><sub><var>i</var></sub> ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif) <var>y</var><sub><var>i</var></sub> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) <var>N</var>. We can verify that S(10) = 211 and S(10<sup>4</sup>) = 230312207313.
16
+ Define S(<var>N</var>) as the sum of (<var>x</var><sub><var>i</var></sub>+<var>y</var><sub><var>i</var></sub>) for all losing configurations (<var>x</var><sub><var>i</var></sub>,<var>y</var><sub><var>i</var></sub>), 0 ![<]({{ images_dir }}/symbol_lt.gif) <var>x</var><sub><var>i</var></sub> ![<]({{ images_dir }}/symbol_lt.gif) <var>y</var><sub><var>i</var></sub> ![≤]({{ images_dir }}/symbol_le.gif) <var>N</var>. We can verify that S(10) = 211 and S(10<sup>4</sup>) = 230312207313.
17
17
 
18
18
  Find S(10<sup>16</sup>) mod 7<sup>10</sup>.
19
19
 
@@ -3,13 +3,13 @@
3
3
  :name: Modulo Summations
4
4
  :url: http://projecteuler.net/problem=326
5
5
  :content: |+
6
- Let <var>a<sub>n</sub></var> be a sequence recursively defined by: ![](/home/will/src/euler-manager/config/../data/images/p_326_formula1.gif).
6
+ Let <var>a<sub>n</sub></var> be a sequence recursively defined by: ![]({{ images_dir }}/p_326_formula1.gif).
7
7
 
8
8
  So the first 10 elements of <var>a<sub>n</sub></var> are: 1,1,0,3,0,3,5,4,1,9.
9
9
 
10
10
  Let <var>f</var>(<var>N,M</var>) represent the number of pairs (<var>p,q</var>) such that:
11
11
 
12
- ![](/home/will/src/euler-manager/config/../data/images/p_326_formula2.gif)
12
+ ![]({{ images_dir }}/p_326_formula2.gif)
13
13
 
14
14
  It can be seen that <var>f</var>(10,10)=4 with the pairs (3,3), (5,5), (7,9) and (9,10).
15
15
 
@@ -3,33 +3,31 @@
3
3
  :name: Rooms of Doom
4
4
  :url: http://projecteuler.net/problem=327
5
5
  :content: "A series of three rooms are connected to each other by automatic doors.\n\n
6
- ![](/home/will/src/euler-manager/config/../data/images/p_327_rooms_of_doom.gif)\n\nEach
7
- door is operated by a security card. Once you enter a room the door automatically
8
- closes and that security card cannot be used again. A machine at the start will
9
- dispense an unlimited number of cards, but each room (including the starting room)
10
- contains scanners and if they detect that you are holding more than three security
11
- cards or if they detect an unattended security card on the floor, then all the doors
12
- will become permanently locked. However, each room contains a box where you may
13
- safely store any number of security cards for use at a later stage.\n\nIf you simply
14
- tried to travel through the rooms one at a time then as you entered room 3 you would
15
- have used all three cards and would be trapped in that room forever!\n\nHowever,
16
- if you make use of the storage boxes, then escape is possible. For example, you
17
- could enter room 1 using your first card, place one card in the storage box, and
18
- use your third card to exit the room back to the start. Then after collecting three
19
- more cards from the dispensing machine you could use one to enter room 1 and collect
20
- the card you placed in the box a moment ago. You now have three cards again and
21
- will be able to travel through the remaining three doors. This method allows you
22
- to travel through all three rooms using six security cards in total.\n\nIt is possible
23
- to travel through six rooms using a total of 123 security cards while carrying a
24
- maximum of 3 cards.\n\nLet <var>C</var> be the maximum number of cards which can
25
- be carried at any time.\n\nLet <var>R</var> be the number of rooms to travel through.\n\nLet
26
- M(<var>C</var>,<var>R</var>) be the minimum number of cards required from the dispensing
27
- machine to travel through <var>R</var> rooms carrying up to a maximum of <var>C</var>
28
- cards at any time.\n\nFor example, M(3,6)=123 and M(4,6)=23. \nAnd, ΣM(<var>C</var>,6)=146
29
- for 3 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) <var>C</var>
30
- ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) 4.\n\nYou
31
- are given that ΣM(<var>C</var>,10)=10382 for 3 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
32
- <var>C</var> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
33
- 10.\n\nFind ΣM(<var>C</var>,30) for 3 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
34
- <var>C</var> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
6
+ ![]({{ images_dir }}/p_327_rooms_of_doom.gif)\n\nEach door is operated by a security
7
+ card. Once you enter a room the door automatically closes and that security card
8
+ cannot be used again. A machine at the start will dispense an unlimited number of
9
+ cards, but each room (including the starting room) contains scanners and if they
10
+ detect that you are holding more than three security cards or if they detect an
11
+ unattended security card on the floor, then all the doors will become permanently
12
+ locked. However, each room contains a box where you may safely store any number
13
+ of security cards for use at a later stage.\n\nIf you simply tried to travel through
14
+ the rooms one at a time then as you entered room 3 you would have used all three
15
+ cards and would be trapped in that room forever!\n\nHowever, if you make use of
16
+ the storage boxes, then escape is possible. For example, you could enter room 1
17
+ using your first card, place one card in the storage box, and use your third card
18
+ to exit the room back to the start. Then after collecting three more cards from
19
+ the dispensing machine you could use one to enter room 1 and collect the card you
20
+ placed in the box a moment ago. You now have three cards again and will be able
21
+ to travel through the remaining three doors. This method allows you to travel through
22
+ all three rooms using six security cards in total.\n\nIt is possible to travel through
23
+ six rooms using a total of 123 security cards while carrying a maximum of 3 cards.\n\nLet
24
+ <var>C</var> be the maximum number of cards which can be carried at any time.\n\nLet
25
+ <var>R</var> be the number of rooms to travel through.\n\nLet M(<var>C</var>,<var>R</var>)
26
+ be the minimum number of cards required from the dispensing machine to travel through
27
+ <var>R</var> rooms carrying up to a maximum of <var>C</var> cards at any time.\n\nFor
28
+ example, M(3,6)=123 and M(4,6)=23. \nAnd, ΣM(<var>C</var>,6)=146 for 3 ![≤]({{
29
+ images_dir }}/symbol_le.gif) <var>C</var> ![≤]({{ images_dir }}/symbol_le.gif) 4.\n\nYou
30
+ are given that ΣM(<var>C</var>,10)=10382 for 3 ![≤]({{ images_dir }}/symbol_le.gif)
31
+ <var>C</var> ![≤]({{ images_dir }}/symbol_le.gif) 10.\n\nFind ΣM(<var>C</var>,30)
32
+ for 3 ![≤]({{ images_dir }}/symbol_le.gif) <var>C</var> ![≤]({{ images_dir }}/symbol_le.gif)
35
33
  40.\n\n"
@@ -29,5 +29,5 @@
29
29
  just described an optimal strategy for <var>n</var>=8.\n\nLet C(<var>n</var>) be
30
30
  the worst-case cost achieved by an optimal strategy for <var>n</var>, as described
31
31
  above. \n\rThus C(1) = 0, C(2) = 1, C(3) = 2 and C(8) = 12. \n\rSimilarly, C(100)
32
- = 400 and ![](/home/will/src/euler-manager/config/../data/images/p_328_sum1.gif)C(<var>n</var>)
33
- = 17575.\n\nFind ![](/home/will/src/euler-manager/config/../data/images/p_328_sum2.gif)C(<var>n</var>).\n\n"
32
+ = 400 and ![]({{ images_dir }}/p_328_sum1.gif)C(<var>n</var>) = 17575.\n\nFind ![]({{
33
+ images_dir }}/p_328_sum2.gif)C(<var>n</var>).\n\n"
@@ -3,19 +3,18 @@
3
3
  :name: Euler's Number
4
4
  :url: http://projecteuler.net/problem=330
5
5
  :content: "\rAn infinite sequence of real numbers <var>a</var>(<var>n</var>) is defined
6
- for all integers <var>n</var> as follows:\r\n ![](/home/will/src/euler-manager/config/../data/images/p_330_formula.gif)\n\nFor
6
+ for all integers <var>n</var> as follows:\r\n ![]({{ images_dir }}/p_330_formula.gif)\n\nFor
7
7
  example,\n\n| <var>a</var>(0) = | \n\n| 1 |\n| 1! |\n\n | + | \n\n| 1 |\n| 2! |\n\n
8
- | + | \n\n| 1 |\n| 3! |\n\n | + ... = e ![−](/home/will/src/euler-manager/config/../data/images/symbol_minus.gif)
9
- 1 |\n\n| <var>a</var>(1) = | \n\n| e ![−](/home/will/src/euler-manager/config/../data/images/symbol_minus.gif)
10
- 1 |\n| 1! |\n\n | + | \n\n| 1 |\n| 2! |\n\n | + | \n\n| 1 |\n| 3! |\n\n | + ...
11
- = 2e ![−](/home/will/src/euler-manager/config/../data/images/symbol_minus.gif) 3
12
- |\n\n| <var>a</var>(2) = | \n\n| 2e ![−](/home/will/src/euler-manager/config/../data/images/symbol_minus.gif)
13
- 3 |\n| 1! |\n\n | + | \n\n| e ![−](/home/will/src/euler-manager/config/../data/images/symbol_minus.gif)
8
+ | + | \n\n| 1 |\n| 3! |\n\n | + ... = e ![−]({{ images_dir }}/symbol_minus.gif)
9
+ 1 |\n\n| <var>a</var>(1) = | \n\n| e ![−]({{ images_dir }}/symbol_minus.gif) 1 |\n|
10
+ 1! |\n\n | + | \n\n| 1 |\n| 2! |\n\n | + | \n\n| 1 |\n| 3! |\n\n | + ... = 2e ![−]({{
11
+ images_dir }}/symbol_minus.gif) 3 |\n\n| <var>a</var>(2) = | \n\n| 2e ![−]({{ images_dir
12
+ }}/symbol_minus.gif) 3 |\n| 1! |\n\n | + | \n\n| e ![−]({{ images_dir }}/symbol_minus.gif)
14
13
  1 |\n| 2! |\n\n | + | \n\n| 1 |\n| 3! |\n\n | + ... = | \n\n| 7 |\n| 2 |\n\n | e
15
- ![−](/home/will/src/euler-manager/config/../data/images/symbol_minus.gif) 6 |\n\n\rwith
16
- e = 2.7182818... being Euler's constant.\r\r\n\n| It can be shown that <var>a</var>(<var>n</var>)
17
- is of the form \r | \n\n| A(<var>n</var>) e + B(<var>n</var>) |\n| <var>n</var>!
18
- |\n\n | for integers A(<var>n</var>) and B(<var>n</var>). \r |\n\n| For example
19
- <var>a</var>(10) = \r | \n\n| 328161643 e ![−](/home/will/src/euler-manager/config/../data/images/symbol_minus.gif)
20
- 652694486 |\n| 10! |\n\n | . |\n\nFind A(10<sup>9</sup>) + B(10<sup>9</sup>) and
21
- give your answer mod 77 777 777.\n\n"
14
+ ![−]({{ images_dir }}/symbol_minus.gif) 6 |\n\n\rwith e = 2.7182818... being Euler's
15
+ constant.\r\r\n\n| It can be shown that <var>a</var>(<var>n</var>) is of the form
16
+ \r | \n\n| A(<var>n</var>) e + B(<var>n</var>) |\n| <var>n</var>! |\n\n | for integers
17
+ A(<var>n</var>) and B(<var>n</var>). \r |\n\n| For example <var>a</var>(10) = \r
18
+ | \n\n| 328161643 e ![−]({{ images_dir }}/symbol_minus.gif) 652694486 |\n| 10! |\n\n
19
+ | . |\n\nFind A(10<sup>9</sup>) + B(10<sup>9</sup>) and give your answer mod 77
20
+ 777 777.\n\n"
@@ -2,21 +2,21 @@
2
2
  :id: 331
3
3
  :name: Cross flips
4
4
  :url: http://projecteuler.net/problem=331
5
- :content: "<var>N</var> ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)<var>N</var>
6
- disks are placed on a square game board. Each disk has a black side and white side.\n\nAt
5
+ :content: "<var>N</var> ![×]({{ images_dir }}/symbol_times.gif)<var>N</var> disks
6
+ are placed on a square game board. Each disk has a black side and white side.\n\nAt
7
7
  each turn, you may choose a disk and flip all the disks in the same row and the
8
- same column as this disk: thus 2 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)<var>N</var>-1
8
+ same column as this disk: thus 2 ![×]({{ images_dir }}/symbol_times.gif)<var>N</var>-1
9
9
  disks are flipped. The game ends when all disks show their white side. The following
10
- example shows a game on a 5 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)5
11
- board.\n\n ![](/home/will/src/euler-manager/config/../data/images/p_331_crossflips3.gif)\n\nIt
12
- can be proven that 3 is the minimal number of turns to finish this game.\n\nThe
13
- bottom left disk on the <var>N</var> ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)<var>N</var>
14
- board has coordinates (0,0); \n\rthe bottom right disk has coordinates (<var>N</var>-1,0)
15
- and the top left disk has coordinates (0,<var>N</var>-1).\n\nLet C<sub><var>N</var></sub>
16
- be the following configuration of a board with <var>N</var> ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)<var>N</var>
17
- disks: \n\rA disk at (<var>x</var>,<var>y</var>) satisfying ![](/home/will/src/euler-manager/config/../data/images/p_331_crossflips1.gif),
10
+ example shows a game on a 5 ![×]({{ images_dir }}/symbol_times.gif)5 board.\n\n
11
+ ![]({{ images_dir }}/p_331_crossflips3.gif)\n\nIt can be proven that 3 is the minimal
12
+ number of turns to finish this game.\n\nThe bottom left disk on the <var>N</var>
13
+ ![×]({{ images_dir }}/symbol_times.gif)<var>N</var> board has coordinates (0,0);
14
+ \ \n\rthe bottom right disk has coordinates (<var>N</var>-1,0) and the top left
15
+ disk has coordinates (0,<var>N</var>-1).\n\nLet C<sub><var>N</var></sub> be the
16
+ following configuration of a board with <var>N</var> ![×]({{ images_dir }}/symbol_times.gif)<var>N</var>
17
+ disks: \n\rA disk at (<var>x</var>,<var>y</var>) satisfying ![]({{ images_dir }}/p_331_crossflips1.gif),
18
18
  shows its black side; otherwise, it shows its white side. C<sub>5</sub> is shown
19
19
  above.\n\nLet T(<var>N</var>) be the minimal number of turns to finish a game starting
20
20
  from configuration C<sub><var>N</var></sub> or 0 if configuration C<sub><var>N</var></sub>
21
21
  is unsolvable. \n\rWe have shown that T(5)=3. You are also given that T(10)=29
22
- and T(1 000)=395253.\n\nFind ![](/home/will/src/euler-manager/config/../data/images/p_331_crossflips2.gif).\n\n"
22
+ and T(1 000)=395253.\n\nFind ![]({{ images_dir }}/p_331_crossflips2.gif).\n\n"
@@ -3,12 +3,13 @@
3
3
  :name: Spherical triangles
4
4
  :url: http://projecteuler.net/problem=332
5
5
  :content: "A **spherical triangle** is a figure formed on the surface of a sphere
6
- by three **great circular arcs** intersecting pairwise in three vertices.\n\n ![](/home/will/src/euler-manager/config/../data/images/p_332_spherical.jpg)\n\nLet
7
- C(<var>r</var>) be the sphere with the centre (0,0,0) and radius <var>r</var>. \n\rLet
8
- Z(<var>r</var>) be the set of points on the surface of C(<var>r</var>) with integer
9
- coordinates. \n\rLet T(<var>r</var>) be the set of spherical triangles with vertices
10
- in Z(<var>r</var>).\rDegenerate spherical triangles, formed by three points on the
11
- same great arc, are <u>not</u> included in T(<var>r</var>). \n\rLet A(<var>r</var>)
12
- be the area of the smallest spherical triangle in T(<var>r</var>).\n\nFor example
13
- A(14) is 3.294040 rounded to six decimal places.\n\nFind ![](/home/will/src/euler-manager/config/../data/images/p_332_sum.gif)
14
- A(<var>r</var>). Give your answer rounded to six decimal places.\n\n"
6
+ by three **great circular arcs** intersecting pairwise in three vertices.\n\n ![]({{
7
+ images_dir }}/p_332_spherical.jpg)\n\nLet C(<var>r</var>) be the sphere with the
8
+ centre (0,0,0) and radius <var>r</var>. \n\rLet Z(<var>r</var>) be the set of points
9
+ on the surface of C(<var>r</var>) with integer coordinates. \n\rLet T(<var>r</var>)
10
+ be the set of spherical triangles with vertices in Z(<var>r</var>).\rDegenerate
11
+ spherical triangles, formed by three points on the same great arc, are <u>not</u>
12
+ included in T(<var>r</var>). \n\rLet A(<var>r</var>) be the area of the smallest
13
+ spherical triangle in T(<var>r</var>).\n\nFor example A(14) is 3.294040 rounded
14
+ to six decimal places.\n\nFind ![]({{ images_dir }}/p_332_sum.gif) A(<var>r</var>).
15
+ Give your answer rounded to six decimal places.\n\n"
@@ -4,19 +4,18 @@
4
4
  :url: http://projecteuler.net/problem=333
5
5
  :content: "All positive integers can be partitioned in such a way that each and every
6
6
  term of the partition can be expressed as 2<sup>i</sup>x3<sup>j</sup>, where i,j
7
- ![≥](/home/will/src/euler-manager/config/../data/images/symbol_ge.gif) 0.\n\nLet's
8
- consider only those such partitions where none of the terms can divide any of the
9
- other terms.\r \nFor example, the partition of 17 = 2 + 6 + 9 = (2<sup>1</sup>x3<sup>0</sup>
10
- + 2<sup>1</sup>x3<sup>1</sup> + 2<sup>0</sup>x3<sup>2</sup>) would not be valid
11
- since 2 can divide 6. Neither would the partition 17 = 16 + 1 = (2<sup>4</sup>x3<sup>0</sup>
12
- + 2<sup>0</sup>x3<sup>0</sup>) since 1 can divide 16. The only valid partition of
13
- 17 would be 8 + 9 = (2<sup>3</sup>x3<sup>0</sup> + 2<sup>0</sup>x3<sup>2</sup>).\n\nMany
14
- integers have more than one valid partition, the first being 11 having the following
15
- two partitions.\r \n11 = 2 + 9 = (2<sup>1</sup>x3<sup>0</sup> + 2<sup>0</sup>x3<sup>2</sup>)\r
16
- \ \n11 = 8 + 3 = (2<sup>3</sup>x3<sup>0</sup> + 2<sup>0</sup>x3<sup>1</sup>)\n\nLet's
17
- define P(<var>n</var>) as the number of valid partitions of <var>n</var>. For example,
18
- P(11) = 2.\n\nLet's consider only the prime integers <var>q</var> which would have
19
- a single valid partition such as P(17).\n\nThe sum of the primes <var>q</var> ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)100
20
- such that P(<var>q</var>)=1 equals 233.\n\nFind the sum of the primes <var>q</var>
21
- ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)1000000 such
22
- that P(<var>q</var>)=1.\n\n"
7
+ ![≥]({{ images_dir }}/symbol_ge.gif) 0.\n\nLet's consider only those such partitions
8
+ where none of the terms can divide any of the other terms.\r \nFor example, the
9
+ partition of 17 = 2 + 6 + 9 = (2<sup>1</sup>x3<sup>0</sup> + 2<sup>1</sup>x3<sup>1</sup>
10
+ + 2<sup>0</sup>x3<sup>2</sup>) would not be valid since 2 can divide 6. Neither
11
+ would the partition 17 = 16 + 1 = (2<sup>4</sup>x3<sup>0</sup> + 2<sup>0</sup>x3<sup>0</sup>)
12
+ since 1 can divide 16. The only valid partition of 17 would be 8 + 9 = (2<sup>3</sup>x3<sup>0</sup>
13
+ + 2<sup>0</sup>x3<sup>2</sup>).\n\nMany integers have more than one valid partition,
14
+ the first being 11 having the following two partitions.\r \n11 = 2 + 9 = (2<sup>1</sup>x3<sup>0</sup>
15
+ + 2<sup>0</sup>x3<sup>2</sup>)\r \n11 = 8 + 3 = (2<sup>3</sup>x3<sup>0</sup> +
16
+ 2<sup>0</sup>x3<sup>1</sup>)\n\nLet's define P(<var>n</var>) as the number of valid
17
+ partitions of <var>n</var>. For example, P(11) = 2.\n\nLet's consider only the prime
18
+ integers <var>q</var> which would have a single valid partition such as P(17).\n\nThe
19
+ sum of the primes <var>q</var> ![<]({{ images_dir }}/symbol_lt.gif)100 such that
20
+ P(<var>q</var>)=1 equals 233.\n\nFind the sum of the primes <var>q</var> ![<]({{
21
+ images_dir }}/symbol_lt.gif)1000000 such that P(<var>q</var>)=1.\n\n"
@@ -8,20 +8,20 @@
8
8
  any bowl, and putting one in each of the two adjacent bowls. \n The game ends when
9
9
  each bowl contains either one or no beans.\n\nFor example, consider two adjacent
10
10
  bowls containing 2 and 3 beans respectively, all other bowls being empty. The following
11
- eight moves will finish the game:\n\n ![](/home/will/src/euler-manager/config/../data/images/p_334_beans.gif)\n\nYou
11
+ eight moves will finish the game:\n\n ![]({{ images_dir }}/p_334_beans.gif)\n\nYou
12
12
  are given the following sequences:\n\n| <var>t</var><sub><i>0</i></sub> = 123456.\r
13
- |\n\n| <var>t</var><sub><i>i</i></sub> = \r | ![](/home/will/src/euler-manager/config/../data/images/p_334_cases.gif)
13
+ |\n\n| <var>t</var><sub><i>i</i></sub> = \r | ![]({{ images_dir }}/p_334_cases.gif)
14
14
  | \n\n| | \n\n| <var>t</var><sub><i>i-1</i></sub> |\n| 2 |\n\n | \r ,\r | | \r if
15
- <var>t</var><sub><i>i-1</i></sub> is even\r |\n| ![](/home/will/src/euler-manager/config/../data/images/p_334_lfloor.gif)
16
- | \n\n| <var>t</var><sub><i>i-1</i></sub> |\n| 2 |\n\n | ![](/home/will/src/euler-manager/config/../data/images/p_334_rfloor.gif)
15
+ <var>t</var><sub><i>i-1</i></sub> is even\r |\n| ![]({{ images_dir }}/p_334_lfloor.gif)
16
+ | \n\n| <var>t</var><sub><i>i-1</i></sub> |\n| 2 |\n\n | ![]({{ images_dir }}/p_334_rfloor.gif)
17
17
  | \r 926252, \r | \r if <var>t</var><sub><i>i-1</i></sub> is odd\r |\n\n | |\n|
18
- | | \r where ![⌊](/home/will/src/euler-manager/config/../data/images/symbol_lfloor.gif)<var>x</var>
19
- ![⌋](/home/will/src/euler-manager/config/../data/images/symbol_rfloor.gif) is the
20
- floor function\r |\n| | | \r and ![](/home/will/src/euler-manager/config/../data/images/p_334_oplus.gif)
21
- is the bitwise XOR operator.\r |\n\n| <var>b</var><sub><i>i</i></sub> = ( <var>t</var><sub><i>i</i></sub>
22
- mod 2<sup>11</sup>) + 1.\r |\n\nThe first two terms of the last sequence are <var>b</var><sub><i>1</i></sub>
23
- = 289 and <var>b</var><sub><i>2</i></sub> = 145. \n\rIf we start with <var>b</var><sub><i>1</i></sub>
24
- and <var>b</var><sub><i>2</i></sub> beans in two adjacent bowls, 3419100 moves would
25
- be required to finish the game.\n\nConsider now 1500 adjacent bowls containing <var>b</var><sub><i>1</i></sub>,
26
- <var>b</var><sub><i>2</i></sub>,..., <var>b</var><sub><i>1500</i></sub> beans respectively,
27
- all other bowls being empty. Find how many moves it takes before the game ends.\n\n"
18
+ | | \r where ![⌊]({{ images_dir }}/symbol_lfloor.gif)<var>x</var> ![⌋]({{ images_dir
19
+ }}/symbol_rfloor.gif) is the floor function\r |\n| | | \r and ![]({{ images_dir
20
+ }}/p_334_oplus.gif) is the bitwise XOR operator.\r |\n\n| <var>b</var><sub><i>i</i></sub>
21
+ = ( <var>t</var><sub><i>i</i></sub> mod 2<sup>11</sup>) + 1.\r |\n\nThe first two
22
+ terms of the last sequence are <var>b</var><sub><i>1</i></sub> = 289 and <var>b</var><sub><i>2</i></sub>
23
+ = 145. \n\rIf we start with <var>b</var><sub><i>1</i></sub> and <var>b</var><sub><i>2</i></sub>
24
+ beans in two adjacent bowls, 3419100 moves would be required to finish the game.\n\nConsider
25
+ now 1500 adjacent bowls containing <var>b</var><sub><i>1</i></sub>, <var>b</var><sub><i>2</i></sub>,...,
26
+ <var>b</var><sub><i>1500</i></sub> beans respectively, all other bowls being empty.
27
+ Find how many moves it takes before the game ends.\n\n"