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.
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
data/data/problems/88.yml CHANGED
@@ -5,30 +5,25 @@
5
5
  :content: "A natural number, N, that can be written as the sum and product of a given
6
6
  set of at least two natural numbers, {_a_<sub>1</sub>, _a_<sub>2</sub>, ... , _a_<sub><i>k</i></sub>}
7
7
  is called a product-sum number: N = _a_<sub>1</sub> + _a_<sub>2</sub> + ... + _a_<sub><i>k</i></sub>
8
- = _a_<sub>1</sub> ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
9
- _a_<sub>2</sub> ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
10
- ... ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif) _a_<sub><i>k</i></sub>.\n\nFor
11
- example, 6 = 1 + 2 + 3 = 1 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
12
- 2 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif) 3.\n\nFor
13
- a given set of size, _k_, we shall call the smallest N with this property a minimal
14
- product-sum number. The minimal product-sum numbers for sets of size, _k_ = 2, 3,
15
- 4, 5, and 6 are as follows.\n\n_k_=2: 4 = 2 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
16
- 2 = 2 + 2 \n_k_=3: 6 = 1 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
17
- 2 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif) 3 =
18
- 1 + 2 + 3 \n_k_=4: 8 = 1 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
19
- 1 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif) 2 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
20
- 4 = 1 + 1 + 2 + 4 \n_k_=5: 8 = 1 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
21
- 1 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif) 2 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
22
- 2 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif) 2 =
23
- 1 + 1 + 2 + 2 + 2 \n_k_=6: 12 = 1 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
24
- 1 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif) 1 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
25
- 1 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif) 2 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
26
- 6 = 1 + 1 + 1 + 1 + 2 + 6\n\nHence for 2 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)_k_
27
- ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)6, the sum
28
- of all the minimal product-sum numbers is 4+6+8+12 = 30; note that 8 is only counted
29
- once in the sum.\n\nIn fact, as the complete set of minimal product-sum numbers
30
- for 2 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)_k_
31
- ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)12 is {4,
32
- 6, 8, 12, 15, 16}, the sum is 61.\n\nWhat is the sum of all the minimal product-sum
33
- numbers for 2 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)_k_
34
- ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)12000?\n\n"
8
+ = _a_<sub>1</sub> ![×]({{ images_dir }}/symbol_times.gif) _a_<sub>2</sub> ![×]({{
9
+ images_dir }}/symbol_times.gif) ... ![×]({{ images_dir }}/symbol_times.gif) _a_<sub><i>k</i></sub>.\n\nFor
10
+ example, 6 = 1 + 2 + 3 = 1 ![×]({{ images_dir }}/symbol_times.gif) 2 ![×]({{ images_dir
11
+ }}/symbol_times.gif) 3.\n\nFor a given set of size, _k_, we shall call the smallest
12
+ N with this property a minimal product-sum number. The minimal product-sum numbers
13
+ for sets of size, _k_ = 2, 3, 4, 5, and 6 are as follows.\n\n_k_=2: 4 = 2 ![×]({{
14
+ images_dir }}/symbol_times.gif) 2 = 2 + 2 \n_k_=3: 6 = 1 ![×]({{ images_dir }}/symbol_times.gif)
15
+ 2 ![×]({{ images_dir }}/symbol_times.gif) 3 = 1 + 2 + 3 \n_k_=4: 8 = 1 ![×]({{
16
+ images_dir }}/symbol_times.gif) 1 ![×]({{ images_dir }}/symbol_times.gif) 2 ![×]({{
17
+ images_dir }}/symbol_times.gif) 4 = 1 + 1 + 2 + 4 \n_k_=5: 8 = 1 ![×]({{ images_dir
18
+ }}/symbol_times.gif) 1 ![×]({{ images_dir }}/symbol_times.gif) 2 ![×]({{ images_dir
19
+ }}/symbol_times.gif) 2 ![×]({{ images_dir }}/symbol_times.gif) 2 = 1 + 1 + 2 + 2
20
+ + 2 \n_k_=6: 12 = 1 ![×]({{ images_dir }}/symbol_times.gif) 1 ![×]({{ images_dir
21
+ }}/symbol_times.gif) 1 ![×]({{ images_dir }}/symbol_times.gif) 1 ![×]({{ images_dir
22
+ }}/symbol_times.gif) 2 ![×]({{ images_dir }}/symbol_times.gif) 6 = 1 + 1 + 1 + 1
23
+ + 2 + 6\n\nHence for 2 ![]({{ images_dir }}/symbol_le.gif)_k_ ![≤]({{ images_dir
24
+ }}/symbol_le.gif)6, the sum of all the minimal product-sum numbers is 4+6+8+12 =
25
+ 30; note that 8 is only counted once in the sum.\n\nIn fact, as the complete set
26
+ of minimal product-sum numbers for 2 ![≤]({{ images_dir }}/symbol_le.gif)_k_ ![≤]({{
27
+ images_dir }}/symbol_le.gif)12 is {4, 6, 8, 12, 15, 16}, the sum is 61.\n\nWhat
28
+ is the sum of all the minimal product-sum numbers for 2 ![≤]({{ images_dir }}/symbol_le.gif)_k_
29
+ ![≤]({{ images_dir }}/symbol_le.gif)12000?\n\n"
data/data/problems/9.yml CHANGED
@@ -2,9 +2,9 @@
2
2
  :id: 9
3
3
  :name: Special Pythagorean triplet
4
4
  :url: http://projecteuler.net/problem=9
5
- :content: "A Pythagorean triplet is a set of three natural numbers, <var>a</var> ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)
6
- <var>b</var> ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)
7
- <var>c</var>, for which,\n\n <var>a</var><sup>2</sup> + <var>b</var><sup>2</sup>
8
- = <var>c</var><sup>2</sup>\n\nFor example, 3<sup>2</sup> + 4<sup>2</sup> = 9 + 16
9
- = 25 = 5<sup>2</sup>.\n\nThere exists exactly one Pythagorean triplet for which
10
- <var>a</var> + <var>b</var> + <var>c</var> = 1000. \nFind the product <var>abc</var>.\n\n"
5
+ :content: "A Pythagorean triplet is a set of three natural numbers, <var>a</var> ![<]({{
6
+ images_dir }}/symbol_lt.gif) <var>b</var> ![<]({{ images_dir }}/symbol_lt.gif) <var>c</var>,
7
+ for which,\n\n <var>a</var><sup>2</sup> + <var>b</var><sup>2</sup> = <var>c</var><sup>2</sup>\n\nFor
8
+ example, 3<sup>2</sup> + 4<sup>2</sup> = 9 + 16 = 25 = 5<sup>2</sup>.\n\nThere exists
9
+ exactly one Pythagorean triplet for which <var>a</var> + <var>b</var> + <var>c</var>
10
+ = 1000. \nFind the product <var>abc</var>.\n\n"
data/data/problems/90.yml CHANGED
@@ -5,17 +5,17 @@
5
5
  :content: "Each of the six faces on a cube has a different digit (0 to 9) written
6
6
  on it; the same is done to a second cube. By placing the two cubes side-by-side
7
7
  in different positions we can form a variety of 2-digit numbers.\n\nFor example,
8
- the square number 64 could be formed:\n\n ![](/home/will/src/euler-manager/config/../data/images/p_090.gif)
9
- \ \n\nIn fact, by carefully choosing the digits on both cubes it is possible to
10
- display all of the square numbers below one-hundred: 01, 04, 09, 16, 25, 36, 49,
11
- 64, and 81.\n\nFor example, one way this can be achieved is by placing {0, 5, 6,
12
- 7, 8, 9} on one cube and {1, 2, 3, 4, 8, 9} on the other cube.\n\nHowever, for this
13
- problem we shall allow the 6 or 9 to be turned upside-down so that an arrangement
14
- like {0, 5, 6, 7, 8, 9} and {1, 2, 3, 4, 6, 7} allows for all nine square numbers
15
- to be displayed; otherwise it would be impossible to obtain 09.\n\nIn determining
16
- a distinct arrangement we are interested in the digits on each cube, not the order.\n\n{1,
17
- 2, 3, 4, 5, 6} is equivalent to {3, 6, 4, 1, 2, 5} \n\r{1, 2, 3, 4, 5, 6} is distinct
18
- from {1, 2, 3, 4, 5, 9}\n\nBut because we are allowing 6 and 9 to be reversed, the
19
- two distinct sets in the last example both represent the extended set {1, 2, 3,
20
- 4, 5, 6, 9} for the purpose of forming 2-digit numbers.\n\nHow many distinct arrangements
8
+ the square number 64 could be formed:\n\n ![]({{ images_dir }}/p_090.gif) \n\nIn
9
+ fact, by carefully choosing the digits on both cubes it is possible to display all
10
+ of the square numbers below one-hundred: 01, 04, 09, 16, 25, 36, 49, 64, and 81.\n\nFor
11
+ example, one way this can be achieved is by placing {0, 5, 6, 7, 8, 9} on one cube
12
+ and {1, 2, 3, 4, 8, 9} on the other cube.\n\nHowever, for this problem we shall
13
+ allow the 6 or 9 to be turned upside-down so that an arrangement like {0, 5, 6,
14
+ 7, 8, 9} and {1, 2, 3, 4, 6, 7} allows for all nine square numbers to be displayed;
15
+ otherwise it would be impossible to obtain 09.\n\nIn determining a distinct arrangement
16
+ we are interested in the digits on each cube, not the order.\n\n{1, 2, 3, 4, 5,
17
+ 6} is equivalent to {3, 6, 4, 1, 2, 5} \n\r{1, 2, 3, 4, 5, 6} is distinct from
18
+ {1, 2, 3, 4, 5, 9}\n\nBut because we are allowing 6 and 9 to be reversed, the two
19
+ distinct sets in the last example both represent the extended set {1, 2, 3, 4, 5,
20
+ 6, 9} for the purpose of forming 2-digit numbers.\n\nHow many distinct arrangements
21
21
  of the two cubes allow for all of the square numbers to be displayed?\n\n"
data/data/problems/91.yml CHANGED
@@ -4,11 +4,11 @@
4
4
  :url: http://projecteuler.net/problem=91
5
5
  :content: "The points P (_x_<sub>1</sub>, _y_<sub>1</sub>) and Q (_x_<sub>2</sub>,
6
6
  _y_<sub>2</sub>) are plotted at integer co-ordinates and are joined to the origin,
7
- O(0,0), to form ΔOPQ.\n\n ![](/home/will/src/euler-manager/config/../data/images/p_091_1.gif)
8
- \ \n\nThere are exactly fourteen triangles containing a right angle that can be
9
- formed when each co-ordinate lies between 0 and 2 inclusive; that is, \n0 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
10
- _x_<sub>1</sub>, _y_<sub>1</sub>, _x_<sub>2</sub>, _y_<sub>2</sub> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
11
- 2.\n\n ![](/home/will/src/euler-manager/config/../data/images/p_091_2.gif) \n\nGiven
12
- that 0 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) _x_<sub>1</sub>,
13
- _y_<sub>1</sub>, _x_<sub>2</sub>, _y_<sub>2</sub> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
14
- 50, how many right triangles can be formed?\n\n"
7
+ O(0,0), to form ΔOPQ.\n\n ![]({{ images_dir }}/p_091_1.gif) \n\nThere are exactly
8
+ fourteen triangles containing a right angle that can be formed when each co-ordinate
9
+ lies between 0 and 2 inclusive; that is, \n0 ![≤]({{ images_dir }}/symbol_le.gif)
10
+ _x_<sub>1</sub>, _y_<sub>1</sub>, _x_<sub>2</sub>, _y_<sub>2</sub> ![≤]({{ images_dir
11
+ }}/symbol_le.gif) 2.\n\n ![]({{ images_dir }}/p_091_2.gif) \n\nGiven that 0 ![≤]({{
12
+ images_dir }}/symbol_le.gif) _x_<sub>1</sub>, _y_<sub>1</sub>, _x_<sub>2</sub>,
13
+ _y_<sub>2</sub> ![≤]({{ images_dir }}/symbol_le.gif) 50, how many right triangles
14
+ can be formed?\n\n"
data/data/problems/92.yml CHANGED
@@ -4,15 +4,13 @@
4
4
  :url: http://projecteuler.net/problem=92
5
5
  :content: "A number chain is created by continuously adding the square of the digits
6
6
  in a number to form a new number until it has been seen before.\n\nFor example,\n\n44
7
- ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) 32 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif)
8
- 13 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) 10 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif)
9
- **1** ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) **1**
10
- \ \n85 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif)
11
- **89** ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif)
12
- 145 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) 42
13
- ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) 20 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif)
14
- 4 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) 16 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif)
15
- 37 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) 58 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif)
7
+ ![→]({{ images_dir }}/symbol_maps.gif) 32 ![→]({{ images_dir }}/symbol_maps.gif)
8
+ 13 ![→]({{ images_dir }}/symbol_maps.gif) 10 ![→]({{ images_dir }}/symbol_maps.gif)
9
+ **1** ![→]({{ images_dir }}/symbol_maps.gif) **1** \n85 ![→]({{ images_dir }}/symbol_maps.gif)
10
+ **89** ![→]({{ images_dir }}/symbol_maps.gif) 145 ![→]({{ images_dir }}/symbol_maps.gif)
11
+ 42 ![→]({{ images_dir }}/symbol_maps.gif) 20 ![→]({{ images_dir }}/symbol_maps.gif)
12
+ 4 ![→]({{ images_dir }}/symbol_maps.gif) 16 ![→]({{ images_dir }}/symbol_maps.gif)
13
+ 37 ![→]({{ images_dir }}/symbol_maps.gif) 58 ![→]({{ images_dir }}/symbol_maps.gif)
16
14
  **89**\n\nTherefore any chain that arrives at 1 or 89 will become stuck in an endless
17
15
  loop. What is most amazing is that EVERY starting number will eventually arrive
18
16
  at 1 or 89.\n\nHow many starting numbers below ten million will arrive at 89?\n\n"
data/data/problems/93.yml CHANGED
@@ -3,15 +3,14 @@
3
3
  :name: Arithmetic expressions
4
4
  :url: http://projecteuler.net/problem=93
5
5
  :content: "By using each of the digits from the set, {1, 2, 3, 4}, exactly once, and
6
- making use of the four arithmetic operations (+, ![−](/home/will/src/euler-manager/config/../data/images/symbol_minus.gif),
6
+ making use of the four arithmetic operations (+, ![−]({{ images_dir }}/symbol_minus.gif),
7
7
  \\*, /) and brackets/parentheses, it is possible to form different positive integer
8
8
  targets.\n\nFor example,\n\n8 = (4 \\* (1 + 3)) / 2 \n14 = 4 \\* (3 + 1 / 2) \n19
9
- = 4 \\* (2 + 3) ![−](/home/will/src/euler-manager/config/../data/images/symbol_minus.gif)
10
- 1 \n36 = 3 \\* 4 \\* (2 + 1)\n\nNote that concatenations of the digits, like 12
11
- + 34, are not allowed.\n\nUsing the set, {1, 2, 3, 4}, it is possible to obtain
12
- thirty-one different target numbers of which 36 is the maximum, and each of the
13
- numbers 1 to 28 can be obtained before encountering the first non-expressible number.\n\nFind
14
- the set of four distinct digits, _a_ ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)
15
- _b_ &lt _c_ ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)
16
- _d_, for which the longest set of consecutive positive integers, 1 to _n_, can be
17
- obtained, giving your answer as a string: _abcd_.\n\n"
9
+ = 4 \\* (2 + 3) ![−]({{ images_dir }}/symbol_minus.gif) 1 \n36 = 3 \\* 4 \\* (2
10
+ + 1)\n\nNote that concatenations of the digits, like 12 + 34, are not allowed.\n\nUsing
11
+ the set, {1, 2, 3, 4}, it is possible to obtain thirty-one different target numbers
12
+ of which 36 is the maximum, and each of the numbers 1 to 28 can be obtained before
13
+ encountering the first non-expressible number.\n\nFind the set of four distinct
14
+ digits, _a_ ![<]({{ images_dir }}/symbol_lt.gif) _b_ &lt _c_ ![<]({{ images_dir
15
+ }}/symbol_lt.gif) _d_, for which the longest set of consecutive positive integers,
16
+ 1 to _n_, can be obtained, giving your answer as a string: _abcd_.\n\n"
data/data/problems/95.yml CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  Perhaps less well known are longer chains. For example, starting with 12496, we form a chain of five numbers:
11
11
 
12
- 12496 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) 14288 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) 15472 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) 14536 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) 14264 ( ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) 12496 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) ...)
12
+ 12496 ![→]({{ images_dir }}/symbol_maps.gif) 14288 ![→]({{ images_dir }}/symbol_maps.gif) 15472 ![→]({{ images_dir }}/symbol_maps.gif) 14536 ![→]({{ images_dir }}/symbol_maps.gif) 14264 ( ![→]({{ images_dir }}/symbol_maps.gif) 12496 ![→]({{ images_dir }}/symbol_maps.gif) ...)
13
13
 
14
14
  Since this chain returns to its starting point, it is called an amicable chain.
15
15
 
data/data/problems/96.yml CHANGED
@@ -11,20 +11,20 @@
11
11
  its solution grid.\n\n| \n\n| 0 0 3 \n9 0 0 \n0 0 1 | 0 2 0 \n3 0 5 \n8 0 6
12
12
  | 6 0 0 \n0 0 1 \n4 0 0 |\n| 0 0 8 \n7 0 0 \n0 0 6 | 1 0 2 \n0 0 0 \n7 0 8
13
13
  | 9 0 0 \n0 0 8 \n2 0 0 |\n| 0 0 2 \n8 0 0 \n0 0 5 | 6 0 9 \n2 0 3 \n0 1 0
14
- | 5 0 0 \n0 0 9 \n3 0 0 |\n\n | ![](/home/will/src/euler-manager/config/../data/images/spacer.gif)
15
- \ \n | \n\n| 4 8 3 \n9 6 7 \n2 5 1 | 9 2 1 \n3 4 5 \n8 7 6 | 6 5 7 \n8 2 1
16
- \ \n4 9 3 |\n| 5 4 8 \n7 2 9 \n1 3 6 | 1 3 2 \n5 6 4 \n7 9 8 | 9 7 6 \n1 3
17
- 8 \n2 4 5 |\n| 3 7 2 \n8 1 4 \n6 9 5 | 6 8 9 \n2 5 3 \n4 1 7 | 5 1 4 \n7 6
18
- 9 \n3 8 2 |\n\n |\n\nA well constructed Su Doku puzzle has a unique solution and
19
- can be solved by logic, although it may be necessary to employ \"guess and test\"
20
- methods in order to eliminate options (there is much contested opinion over this).
21
- The complexity of the search determines the difficulty of the puzzle; the example
22
- above is considered _easy_ because it can be solved by straight forward direct deduction.\n\nThe
23
- 6K text file, [sudoku.txt](project/sudoku.txt) (right click and 'Save Link/Target
24
- As...'), contains fifty different Su Doku puzzles ranging in difficulty, but all
25
- with unique solutions (the first puzzle in the file is the example above).\n\nBy
26
- solving all fifty puzzles find the sum of the 3-digit numbers found in the top left
27
- corner of each solution grid; for example, 483 is the 3-digit number found in the
28
- top left corner of the solution grid above.\n\n<!--<p class='info'>Note: If you're
29
- convinced that &quot;guess and test&quot; methods need not be employed please tell
30
- how you would solve #6 and #46. (c;</p>-->\n"
14
+ | 5 0 0 \n0 0 9 \n3 0 0 |\n\n | ![]({{ images_dir }}/spacer.gif) \n | \n\n| 4
15
+ 8 3 \n9 6 7 \n2 5 1 | 9 2 1 \n3 4 5 \n8 7 6 | 6 5 7 \n8 2 1 \n4 9 3 |\n| 5
16
+ 4 8 \n7 2 9 \n1 3 6 | 1 3 2 \n5 6 4 \n7 9 8 | 9 7 6 \n1 3 8 \n2 4 5 |\n| 3
17
+ 7 2 \n8 1 4 \n6 9 5 | 6 8 9 \n2 5 3 \n4 1 7 | 5 1 4 \n7 6 9 \n3 8 2 |\n\n
18
+ |\n\nA well constructed Su Doku puzzle has a unique solution and can be solved by
19
+ logic, although it may be necessary to employ \"guess and test\" methods in order
20
+ to eliminate options (there is much contested opinion over this). The complexity
21
+ of the search determines the difficulty of the puzzle; the example above is considered
22
+ _easy_ because it can be solved by straight forward direct deduction.\n\nThe 6K
23
+ text file, [sudoku.txt](project/sudoku.txt) (right click and 'Save Link/Target As...'),
24
+ contains fifty different Su Doku puzzles ranging in difficulty, but all with unique
25
+ solutions (the first puzzle in the file is the example above).\n\nBy solving all
26
+ fifty puzzles find the sum of the 3-digit numbers found in the top left corner of
27
+ each solution grid; for example, 483 is the 3-digit number found in the top left
28
+ corner of the solution grid above.\n\n<!--<p class='info'>Note: If you're convinced
29
+ that &quot;guess and test&quot; methods need not be employed please tell how you
30
+ would solve #6 and #46. (c;</p>-->\n"
data/data/problems/97.yml CHANGED
@@ -3,9 +3,9 @@
3
3
  :name: Large non-Mersenne prime
4
4
  :url: http://projecteuler.net/problem=97
5
5
  :content: |+
6
- The first known prime found to exceed one million digits was discovered in 1999, and is a Mersenne prime of the form 2<sup>6972593</sup> ![−](/home/will/src/euler-manager/config/../data/images/symbol_minus.gif)1; it contains exactly 2,098,960 digits. Subsequently other Mersenne primes, of the form 2<sup><i>p</i></sup> ![−](/home/will/src/euler-manager/config/../data/images/symbol_minus.gif)1, have been found which contain more digits.
6
+ The first known prime found to exceed one million digits was discovered in 1999, and is a Mersenne prime of the form 2<sup>6972593</sup> ![−]({{ images_dir }}/symbol_minus.gif)1; it contains exactly 2,098,960 digits. Subsequently other Mersenne primes, of the form 2<sup><i>p</i></sup> ![−]({{ images_dir }}/symbol_minus.gif)1, have been found which contain more digits.
7
7
 
8
- However, in 2004 there was found a massive non-Mersenne prime which contains 2,357,207 digits: 28433 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)2<sup>7830457</sup>+1.
8
+ However, in 2004 there was found a massive non-Mersenne prime which contains 2,357,207 digits: 28433 ![×]({{ images_dir }}/symbol_times.gif)2<sup>7830457</sup>+1.
9
9
 
10
10
  Find the last ten digits of this prime number.
11
11
 
data/data/problems/99.yml CHANGED
@@ -3,9 +3,9 @@
3
3
  :name: Largest exponential
4
4
  :url: http://projecteuler.net/problem=99
5
5
  :content: |+
6
- Comparing two numbers written in index form like 2<sup>11</sup> and 3<sup>7</sup> is not difficult, as any calculator would confirm that 2<sup>11</sup> = 2048 ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif) 3<sup>7</sup> = 2187.
6
+ Comparing two numbers written in index form like 2<sup>11</sup> and 3<sup>7</sup> is not difficult, as any calculator would confirm that 2<sup>11</sup> = 2048 ![<]({{ images_dir }}/symbol_lt.gif) 3<sup>7</sup> = 2187.
7
7
 
8
- However, confirming that 632382<sup>518061</sup> ![>](/home/will/src/euler-manager/config/../data/images/symbol_gt.gif) 519432<sup>525806</sup> would be much more difficult, as both numbers contain over three million digits.
8
+ However, confirming that 632382<sup>518061</sup> ![>]({{ images_dir }}/symbol_gt.gif) 519432<sup>525806</sup> would be much more difficult, as both numbers contain over three million digits.
9
9
 
10
10
  Using [base\_exp.txt](project/base_exp.txt) (right click and 'Save Link/Target As...'), a 22K text file containing one thousand lines with a base/exponent pair on each line, determine which line number has the greatest numerical value.
11
11
 
data/lib/euler/problem.rb CHANGED
@@ -24,6 +24,11 @@ module Euler
24
24
  @content = options[:content]
25
25
  end
26
26
 
27
+ # Content without going through the template engine
28
+ def template
29
+ @content
30
+ end
31
+
27
32
  # Passing content though an ultra simple template engine before returning it
28
33
  def content
29
34
  @content.gsub(/\{\{\s?images_dir\s?\}\}/, Euler.images_dir)
@@ -46,7 +51,7 @@ module Euler
46
51
  id: id,
47
52
  name: name,
48
53
  url: url,
49
- content: content
54
+ content: template
50
55
  }
51
56
  end
52
57
 
data/lib/euler/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Euler
2
- VERSION = '0.0.6'
2
+ VERSION = '0.1.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: euler-manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Yaworsky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-07 00:00:00.000000000 Z
11
+ date: 2014-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander