euler-manager 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (645) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -1
  3. data/Rakefile +3 -0
  4. data/bin/euler +28 -9
  5. data/config/config.rb +1 -0
  6. data/data/answers.yml +430 -456
  7. data/data/images/blackdot.gif +0 -0
  8. data/data/images/bracket_left.gif +0 -0
  9. data/data/images/bracket_right.gif +0 -0
  10. data/data/images/p295_lenticular.gif +0 -0
  11. data/data/images/p296_bisector.gif +0 -0
  12. data/data/images/p303_formula100.gif +0 -0
  13. data/data/images/p303_formula10000.gif +0 -0
  14. data/data/images/p392_gridlines.png +0 -0
  15. data/data/images/p400_winning.png +0 -0
  16. data/data/images/p411_longpath.png +0 -0
  17. data/data/images/p412_table53.png +0 -0
  18. data/data/images/p412_tablenums.png +0 -0
  19. data/data/images/p422_hyperbola.gif +0 -0
  20. data/data/images/p428_necklace.png +0 -0
  21. data/data/images/p_015.gif +0 -0
  22. data/data/images/p_068_1.gif +0 -0
  23. data/data/images/p_068_2.gif +0 -0
  24. data/data/images/p_085.gif +0 -0
  25. data/data/images/p_086.gif +0 -0
  26. data/data/images/p_090.gif +0 -0
  27. data/data/images/p_091_1.gif +0 -0
  28. data/data/images/p_091_2.gif +0 -0
  29. data/data/images/p_107_1.gif +0 -0
  30. data/data/images/p_107_2.gif +0 -0
  31. data/data/images/p_109.gif +0 -0
  32. data/data/images/p_126.gif +0 -0
  33. data/data/images/p_128.gif +0 -0
  34. data/data/images/p_138.gif +0 -0
  35. data/data/images/p_139.gif +0 -0
  36. data/data/images/p_143_torricelli.gif +0 -0
  37. data/data/images/p_144_1.gif +0 -0
  38. data/data/images/p_144_2.gif +0 -0
  39. data/data/images/p_147.gif +0 -0
  40. data/data/images/p_150.gif +0 -0
  41. data/data/images/p_151.gif +0 -0
  42. data/data/images/p_152_sum.gif +0 -0
  43. data/data/images/p_153_formule1.gif +0 -0
  44. data/data/images/p_153_formule2.gif +0 -0
  45. data/data/images/p_153_formule5.gif +0 -0
  46. data/data/images/p_153_formule6.gif +0 -0
  47. data/data/images/p_154_pyramid.gif +0 -0
  48. data/data/images/p_155_capacitors1.gif +0 -0
  49. data/data/images/p_155_capsform.gif +0 -0
  50. data/data/images/p_155_capsmu.gif +0 -0
  51. data/data/images/p_161_k9.gif +0 -0
  52. data/data/images/p_161_trio1.gif +0 -0
  53. data/data/images/p_161_trio3.gif +0 -0
  54. data/data/images/p_163.gif +0 -0
  55. data/data/images/p_173_square_laminas.gif +0 -0
  56. data/data/images/p_177_quad.gif +0 -0
  57. data/data/images/p_184.gif +0 -0
  58. data/data/images/p_189_colours.gif +0 -0
  59. data/data/images/p_189_grid.gif +0 -0
  60. data/data/images/p_194_Fig.png +0 -0
  61. data/data/images/p_194_GraphA.png +0 -0
  62. data/data/images/p_194_GraphB.png +0 -0
  63. data/data/images/p_199_circles_in_circles.gif +0 -0
  64. data/data/images/p_201_laserbeam.gif +0 -0
  65. data/data/images/p_208_robotwalk.gif +0 -0
  66. data/data/images/p_215_crackfree.gif +0 -0
  67. data/data/images/p_220.gif +0 -0
  68. data/data/images/p_226_formula.gif +0 -0
  69. data/data/images/p_226_scoop2.gif +0 -0
  70. data/data/images/p_228.png +0 -0
  71. data/data/images/p_237.gif +0 -0
  72. data/data/images/p_244_example.gif +0 -0
  73. data/data/images/p_244_start.gif +0 -0
  74. data/data/images/p_244_target.gif +0 -0
  75. data/data/images/p_246_anim.gif +0 -0
  76. data/data/images/p_246_ellipse.gif +0 -0
  77. data/data/images/p_247_hypersquares.gif +0 -0
  78. data/data/images/p_251_cardano.gif +0 -0
  79. data/data/images/p_252_convexhole.gif +0 -0
  80. data/data/images/p_255_Example.gif +0 -0
  81. data/data/images/p_255_Heron.gif +0 -0
  82. data/data/images/p_256_tatami3.gif +0 -0
  83. data/data/images/p_257_bisector.gif +0 -0
  84. data/data/images/p_262_formula1.gif +0 -0
  85. data/data/images/p_264_TriangleCentres.gif +0 -0
  86. data/data/images/p_265_BinaryCircles.gif +0 -0
  87. data/data/images/p_270_CutSquare.gif +0 -0
  88. data/data/images/p_275_sculptures2.gif +0 -0
  89. data/data/images/p_281_pizza.gif +0 -0
  90. data/data/images/p_282_formula.gif +0 -0
  91. data/data/images/p_282formula3.gif +0 -0
  92. data/data/images/p_287_quadtree.gif +0 -0
  93. data/data/images/p_289_euler.gif +0 -0
  94. data/data/images/p_291_formula.gif +0 -0
  95. data/data/images/p_299_ThreeSimTri.gif +0 -0
  96. data/data/images/p_300_protein.gif +0 -0
  97. data/data/images/p_306_pstrip.gif +0 -0
  98. data/data/images/p_309_ladders.gif +0 -0
  99. data/data/images/p_311_biclinic.gif +0 -0
  100. data/data/images/p_312_sierpinsky8t.gif +0 -0
  101. data/data/images/p_312_sierpinskyAt.gif +0 -0
  102. data/data/images/p_313_sliding_game_1.gif +0 -0
  103. data/data/images/p_313_sliding_game_2.gif +0 -0
  104. data/data/images/p_314_landgrab.gif +0 -0
  105. data/data/images/p_315_clocks.gif +0 -0
  106. data/data/images/p_316_decexp1.gif +0 -0
  107. data/data/images/p_316_decexp2.gif +0 -0
  108. data/data/images/p_316_decexp3.gif +0 -0
  109. data/data/images/p_321_swapping_counters_1.gif +0 -0
  110. data/data/images/p_321_swapping_counters_2.gif +0 -0
  111. data/data/images/p_326_formula1.gif +0 -0
  112. data/data/images/p_326_formula2.gif +0 -0
  113. data/data/images/p_327_rooms_of_doom.gif +0 -0
  114. data/data/images/p_328_sum1.gif +0 -0
  115. data/data/images/p_328_sum2.gif +0 -0
  116. data/data/images/p_330_formula.gif +0 -0
  117. data/data/images/p_331_crossflips1.gif +0 -0
  118. data/data/images/p_331_crossflips2.gif +0 -0
  119. data/data/images/p_331_crossflips3.gif +0 -0
  120. data/data/images/p_332_spherical.jpg +0 -0
  121. data/data/images/p_332_sum.gif +0 -0
  122. data/data/images/p_334_beans.gif +0 -0
  123. data/data/images/p_334_cases.gif +0 -0
  124. data/data/images/p_334_lfloor.gif +0 -0
  125. data/data/images/p_334_oplus.gif +0 -0
  126. data/data/images/p_334_rfloor.gif +0 -0
  127. data/data/images/p_335_mancala.gif +0 -0
  128. data/data/images/p_335_sum.gif +0 -0
  129. data/data/images/p_336_maximix.gif +0 -0
  130. data/data/images/p_338_gridpaper.gif +0 -0
  131. data/data/images/p_340_formula.gif +0 -0
  132. data/data/images/p_344_silverdollar.gif +0 -0
  133. data/data/images/p_351_hexorchard.png +0 -0
  134. data/data/images/p_354_bee_honeycomb.png +0 -0
  135. data/data/images/p_356_cubicpoly1.gif +0 -0
  136. data/data/images/p_356_cubicpoly2.gif +0 -0
  137. data/data/images/p_361_Thue-Morse1.gif +0 -0
  138. data/data/images/p_364_comf_dist.gif +0 -0
  139. data/data/images/p_372_pencilray1.jpg +0 -0
  140. data/data/images/p_372_pencilray2.gif +0 -0
  141. data/data/images/p_380_mazes.gif +0 -0
  142. data/data/images/p_384_formula.gif +0 -0
  143. data/data/images/p_385_ellipsetriangle.png +0 -0
  144. data/data/images/p_394_eatpie.gif +0 -0
  145. data/data/images/p_395_pythagorean.gif +0 -0
  146. data/data/images/p_404_c_ellipse.gif +0 -0
  147. data/data/images/p_405_tile1.png +0 -0
  148. data/data/images/p_405_tile2.gif +0 -0
  149. data/data/images/p_420_matrix.gif +0 -0
  150. data/data/images/p_424_kakuro1.gif +0 -0
  151. data/data/images/p_426_baxball1.gif +0 -0
  152. data/data/images/p_426_baxball2.gif +0 -0
  153. data/data/images/p_430_flips.gif +0 -0
  154. data/data/images/sod_13.gif +115 -0
  155. data/data/images/spacer.gif +0 -0
  156. data/data/images/symbol_asymp.gif +0 -0
  157. data/data/images/symbol_cong.gif +0 -0
  158. data/data/images/symbol_ge.gif +0 -0
  159. data/data/images/symbol_gt.gif +0 -0
  160. data/data/images/symbol_implies.gif +0 -0
  161. data/data/images/symbol_lceil.gif +0 -0
  162. data/data/images/symbol_le.gif +0 -0
  163. data/data/images/symbol_lfloor.gif +0 -0
  164. data/data/images/symbol_lt.gif +0 -0
  165. data/data/images/symbol_maps.gif +0 -0
  166. data/data/images/symbol_minus.gif +0 -0
  167. data/data/images/symbol_ne.gif +0 -0
  168. data/data/images/symbol_plusmn.gif +0 -0
  169. data/data/images/symbol_radic.gif +0 -0
  170. data/data/images/symbol_rceil.gif +0 -0
  171. data/data/images/symbol_rfloor.gif +0 -0
  172. data/data/images/symbol_sum.gif +0 -0
  173. data/data/images/symbol_times.gif +0 -0
  174. data/data/problems/1.yml +5 -3
  175. data/data/problems/10.yml +3 -4
  176. data/data/problems/100.yml +7 -9
  177. data/data/problems/101.yml +32 -45
  178. data/data/problems/102.yml +11 -12
  179. data/data/problems/103.yml +18 -22
  180. data/data/problems/104.yml +9 -11
  181. data/data/problems/105.yml +12 -17
  182. data/data/problems/106.yml +14 -15
  183. data/data/problems/107.yml +16 -16
  184. data/data/problems/108.yml +17 -28
  185. data/data/problems/109.yml +27 -29
  186. data/data/problems/11.yml +24 -29
  187. data/data/problems/110.yml +11 -15
  188. data/data/problems/111.yml +27 -17
  189. data/data/problems/112.yml +13 -11
  190. data/data/problems/113.yml +11 -9
  191. data/data/problems/114.yml +46 -100
  192. data/data/problems/115.yml +15 -12
  193. data/data/problems/116.yml +33 -72
  194. data/data/problems/117.yml +36 -78
  195. data/data/problems/118.yml +5 -5
  196. data/data/problems/119.yml +9 -7
  197. data/data/problems/12.yml +8 -9
  198. data/data/problems/120.yml +7 -13
  199. data/data/problems/121.yml +9 -11
  200. data/data/problems/122.yml +21 -38
  201. data/data/problems/123.yml +9 -9
  202. data/data/problems/124.yml +24 -54
  203. data/data/problems/125.yml +7 -8
  204. data/data/problems/126.yml +12 -13
  205. data/data/problems/127.yml +21 -27
  206. data/data/problems/128.yml +19 -14
  207. data/data/problems/129.yml +9 -8
  208. data/data/problems/13.yml +52 -2
  209. data/data/problems/130.yml +12 -15
  210. data/data/problems/131.yml +9 -8
  211. data/data/problems/132.yml +7 -8
  212. data/data/problems/133.yml +9 -9
  213. data/data/problems/134.yml +7 -15
  214. data/data/problems/135.yml +9 -16
  215. data/data/problems/136.yml +9 -13
  216. data/data/problems/137.yml +22 -32
  217. data/data/problems/138.yml +11 -16
  218. data/data/problems/139.yml +11 -11
  219. data/data/problems/14.yml +14 -24
  220. data/data/problems/140.yml +18 -25
  221. data/data/problems/141.yml +10 -11
  222. data/data/problems/142.yml +3 -10
  223. data/data/problems/143.yml +13 -16
  224. data/data/problems/144.yml +23 -26
  225. data/data/problems/145.yml +7 -7
  226. data/data/problems/146.yml +6 -6
  227. data/data/problems/147.yml +7 -8
  228. data/data/problems/148.yml +15 -7
  229. data/data/problems/149.yml +26 -35
  230. data/data/problems/15.yml +7 -7
  231. data/data/problems/150.yml +18 -29
  232. data/data/problems/151.yml +17 -15
  233. data/data/problems/152.yml +11 -8
  234. data/data/problems/153.yml +38 -53
  235. data/data/problems/154.yml +10 -12
  236. data/data/problems/155.yml +12 -15
  237. data/data/problems/156.yml +20 -22
  238. data/data/problems/157.yml +26 -28
  239. data/data/problems/158.yml +13 -14
  240. data/data/problems/159.yml +15 -25
  241. data/data/problems/16.yml +5 -2
  242. data/data/problems/160.yml +3 -4
  243. data/data/problems/161.yml +6 -10
  244. data/data/problems/162.yml +10 -11
  245. data/data/problems/163.yml +13 -15
  246. data/data/problems/164.yml +3 -3
  247. data/data/problems/165.yml +25 -28
  248. data/data/problems/166.yml +7 -11
  249. data/data/problems/167.yml +10 -12
  250. data/data/problems/168.yml +7 -9
  251. data/data/problems/169.yml +4 -5
  252. data/data/problems/17.yml +7 -7
  253. data/data/problems/170.yml +7 -10
  254. data/data/problems/171.yml +7 -9
  255. data/data/problems/172.yml +3 -2
  256. data/data/problems/173.yml +9 -7
  257. data/data/problems/174.yml +13 -15
  258. data/data/problems/175.yml +13 -15
  259. data/data/problems/176.yml +5 -5
  260. data/data/problems/177.yml +13 -12
  261. data/data/problems/178.yml +5 -5
  262. data/data/problems/179.yml +3 -6
  263. data/data/problems/18.yml +13 -17
  264. data/data/problems/180.yml +20 -25
  265. data/data/problems/181.yml +7 -3
  266. data/data/problems/182.yml +22 -27
  267. data/data/problems/183.yml +17 -23
  268. data/data/problems/184.yml +11 -14
  269. data/data/problems/185.yml +17 -18
  270. data/data/problems/186.yml +16 -24
  271. data/data/problems/187.yml +9 -12
  272. data/data/problems/188.yml +5 -6
  273. data/data/problems/189.yml +5 -7
  274. data/data/problems/19.yml +7 -8
  275. data/data/problems/190.yml +7 -9
  276. data/data/problems/191.yml +9 -10
  277. data/data/problems/192.yml +14 -22
  278. data/data/problems/193.yml +5 -3
  279. data/data/problems/194.yml +11 -14
  280. data/data/problems/195.yml +7 -9
  281. data/data/problems/196.yml +13 -21
  282. data/data/problems/197.yml +7 -11
  283. data/data/problems/198.yml +13 -16
  284. data/data/problems/199.yml +10 -10
  285. data/data/problems/2.yml +6 -6
  286. data/data/problems/20.yml +10 -18
  287. data/data/problems/200.yml +8 -8
  288. data/data/problems/201.yml +14 -16
  289. data/data/problems/202.yml +11 -10
  290. data/data/problems/203.yml +11 -16
  291. data/data/problems/204.yml +7 -7
  292. data/data/problems/205.yml +6 -6
  293. data/data/problems/206.yml +2 -2
  294. data/data/problems/207.yml +13 -16
  295. data/data/problems/208.yml +8 -8
  296. data/data/problems/209.yml +11 -23
  297. data/data/problems/21.yml +8 -9
  298. data/data/problems/210.yml +6 -6
  299. data/data/problems/211.yml +7 -7
  300. data/data/problems/212.yml +26 -36
  301. data/data/problems/213.yml +6 -7
  302. data/data/problems/214.yml +10 -11
  303. data/data/problems/215.yml +11 -14
  304. data/data/problems/216.yml +7 -10
  305. data/data/problems/217.yml +14 -23
  306. data/data/problems/218.yml +9 -10
  307. data/data/problems/219.yml +10 -15
  308. data/data/problems/22.yml +7 -9
  309. data/data/problems/220.yml +15 -20
  310. data/data/problems/221.yml +10 -16
  311. data/data/problems/222.yml +5 -3
  312. data/data/problems/223.yml +6 -8
  313. data/data/problems/224.yml +6 -8
  314. data/data/problems/225.yml +6 -7
  315. data/data/problems/226.yml +9 -12
  316. data/data/problems/227.yml +9 -9
  317. data/data/problems/228.yml +14 -17
  318. data/data/problems/229.yml +17 -25
  319. data/data/problems/23.yml +11 -15
  320. data/data/problems/230.yml +15 -19
  321. data/data/problems/231.yml +8 -12
  322. data/data/problems/232.yml +9 -10
  323. data/data/problems/233.yml +7 -6
  324. data/data/problems/234.yml +14 -19
  325. data/data/problems/235.yml +4 -5
  326. data/data/problems/236.yml +20 -22
  327. data/data/problems/237.yml +14 -9
  328. data/data/problems/238.yml +21 -33
  329. data/data/problems/239.yml +5 -5
  330. data/data/problems/24.yml +7 -6
  331. data/data/problems/240.yml +7 -7
  332. data/data/problems/241.yml +9 -12
  333. data/data/problems/242.yml +7 -9
  334. data/data/problems/243.yml +14 -15
  335. data/data/problems/244.yml +19 -28
  336. data/data/problems/245.yml +22 -30
  337. data/data/problems/246.yml +10 -13
  338. data/data/problems/247.yml +14 -17
  339. data/data/problems/248.yml +5 -2
  340. data/data/problems/249.yml +3 -3
  341. data/data/problems/25.yml +12 -11
  342. data/data/problems/250.yml +3 -3
  343. data/data/problems/251.yml +11 -9
  344. data/data/problems/252.yml +24 -25
  345. data/data/problems/253.yml +19 -32
  346. data/data/problems/254.yml +13 -17
  347. data/data/problems/255.yml +40 -50
  348. data/data/problems/256.yml +31 -39
  349. data/data/problems/257.yml +10 -14
  350. data/data/problems/258.yml +7 -9
  351. data/data/problems/259.yml +14 -12
  352. data/data/problems/26.yml +17 -7
  353. data/data/problems/260.yml +21 -25
  354. data/data/problems/261.yml +13 -15
  355. data/data/problems/262.yml +15 -16
  356. data/data/problems/263.yml +13 -15
  357. data/data/problems/264.yml +15 -16
  358. data/data/problems/265.yml +10 -12
  359. data/data/problems/266.yml +6 -6
  360. data/data/problems/267.yml +13 -10
  361. data/data/problems/268.yml +5 -4
  362. data/data/problems/269.yml +10 -11
  363. data/data/problems/27.yml +15 -21
  364. data/data/problems/270.yml +13 -13
  365. data/data/problems/271.yml +7 -9
  366. data/data/problems/272.yml +8 -11
  367. data/data/problems/273.yml +13 -17
  368. data/data/problems/274.yml +16 -19
  369. data/data/problems/275.yml +13 -15
  370. data/data/problems/276.yml +5 -7
  371. data/data/problems/277.yml +17 -20
  372. data/data/problems/278.yml +20 -28
  373. data/data/problems/279.yml +4 -3
  374. data/data/problems/28.yml +6 -13
  375. data/data/problems/280.yml +9 -9
  376. data/data/problems/281.yml +10 -13
  377. data/data/problems/282.yml +9 -6
  378. data/data/problems/283.yml +8 -8
  379. data/data/problems/284.yml +15 -18
  380. data/data/problems/285.yml +11 -11
  381. data/data/problems/286.yml +7 -8
  382. data/data/problems/287.yml +22 -32
  383. data/data/problems/288.yml +10 -11
  384. data/data/problems/289.yml +14 -15
  385. data/data/problems/29.yml +13 -20
  386. data/data/problems/290.yml +3 -4
  387. data/data/problems/291.yml +3 -6
  388. data/data/problems/292.yml +8 -9
  389. data/data/problems/293.yml +9 -10
  390. data/data/problems/294.yml +6 -6
  391. data/data/problems/295.yml +16 -21
  392. data/data/problems/296.yml +9 -11
  393. data/data/problems/297.yml +12 -15
  394. data/data/problems/298.yml +29 -29
  395. data/data/problems/299.yml +15 -21
  396. data/data/problems/3.yml +3 -3
  397. data/data/problems/30.yml +7 -8
  398. data/data/problems/300.yml +15 -16
  399. data/data/problems/301.yml +15 -17
  400. data/data/problems/302.yml +13 -14
  401. data/data/problems/303.yml +9 -7
  402. data/data/problems/304.yml +10 -15
  403. data/data/problems/305.yml +6 -10
  404. data/data/problems/306.yml +20 -24
  405. data/data/problems/307.yml +7 -8
  406. data/data/problems/308.yml +19 -30
  407. data/data/problems/309.yml +11 -12
  408. data/data/problems/31.yml +11 -14
  409. data/data/problems/310.yml +10 -15
  410. data/data/problems/311.yml +11 -17
  411. data/data/problems/312.yml +10 -11
  412. data/data/problems/313.yml +13 -13
  413. data/data/problems/314.yml +23 -25
  414. data/data/problems/315.yml +39 -45
  415. data/data/problems/316.yml +13 -13
  416. data/data/problems/317.yml +6 -7
  417. data/data/problems/318.yml +35 -57
  418. data/data/problems/319.yml +15 -19
  419. data/data/problems/32.yml +9 -10
  420. data/data/problems/320.yml +9 -8
  421. data/data/problems/321.yml +8 -9
  422. data/data/problems/322.yml +6 -8
  423. data/data/problems/323.yml +12 -15
  424. data/data/problems/324.yml +10 -13
  425. data/data/problems/325.yml +15 -21
  426. data/data/problems/326.yml +15 -8
  427. data/data/problems/327.yml +19 -23
  428. data/data/problems/328.yml +28 -31
  429. data/data/problems/329.yml +12 -13
  430. data/data/problems/33.yml +9 -9
  431. data/data/problems/330.yml +17 -36
  432. data/data/problems/331.yml +16 -22
  433. data/data/problems/332.yml +9 -11
  434. data/data/problems/333.yml +17 -20
  435. data/data/problems/334.yml +22 -34
  436. data/data/problems/335.yml +11 -12
  437. data/data/problems/336.yml +18 -20
  438. data/data/problems/337.yml +9 -11
  439. data/data/problems/338.yml +27 -37
  440. data/data/problems/339.yml +9 -9
  441. data/data/problems/34.yml +7 -3
  442. data/data/problems/340.yml +8 -10
  443. data/data/problems/341.yml +12 -14
  444. data/data/problems/342.yml +9 -13
  445. data/data/problems/343.yml +18 -25
  446. data/data/problems/344.yml +16 -17
  447. data/data/problems/345.yml +17 -22
  448. data/data/problems/346.yml +7 -7
  449. data/data/problems/347.yml +9 -12
  450. data/data/problems/348.yml +7 -8
  451. data/data/problems/349.yml +8 -9
  452. data/data/problems/35.yml +7 -4
  453. data/data/problems/350.yml +12 -14
  454. data/data/problems/351.yml +8 -9
  455. data/data/problems/352.yml +38 -42
  456. data/data/problems/353.yml +17 -21
  457. data/data/problems/354.yml +11 -13
  458. data/data/problems/355.yml +4 -4
  459. data/data/problems/356.yml +6 -6
  460. data/data/problems/357.yml +5 -5
  461. data/data/problems/358.yml +16 -25
  462. data/data/problems/359.yml +19 -22
  463. data/data/problems/36.yml +7 -4
  464. data/data/problems/360.yml +8 -8
  465. data/data/problems/361.yml +14 -15
  466. data/data/problems/362.yml +16 -28
  467. data/data/problems/363.yml +22 -23
  468. data/data/problems/364.yml +9 -11
  469. data/data/problems/365.yml +7 -13
  470. data/data/problems/366.yml +19 -22
  471. data/data/problems/367.yml +14 -15
  472. data/data/problems/368.yml +18 -35
  473. data/data/problems/369.yml +7 -11
  474. data/data/problems/37.yml +7 -6
  475. data/data/problems/370.yml +10 -13
  476. data/data/problems/371.yml +8 -9
  477. data/data/problems/372.yml +9 -12
  478. data/data/problems/373.yml +5 -6
  479. data/data/problems/374.yml +17 -21
  480. data/data/problems/375.yml +13 -17
  481. data/data/problems/376.yml +19 -21
  482. data/data/problems/377.yml +6 -7
  483. data/data/problems/378.yml +8 -11
  484. data/data/problems/379.yml +9 -11
  485. data/data/problems/38.yml +9 -13
  486. data/data/problems/380.yml +14 -17
  487. data/data/problems/381.yml +12 -18
  488. data/data/problems/382.yml +16 -19
  489. data/data/problems/383.yml +7 -9
  490. data/data/problems/384.yml +20 -24
  491. data/data/problems/385.yml +12 -16
  492. data/data/problems/386.yml +9 -11
  493. data/data/problems/387.yml +14 -15
  494. data/data/problems/388.yml +6 -8
  495. data/data/problems/389.yml +8 -8
  496. data/data/problems/39.yml +7 -6
  497. data/data/problems/390.yml +9 -14
  498. data/data/problems/391.yml +21 -25
  499. data/data/problems/392.yml +16 -17
  500. data/data/problems/393.yml +5 -6
  501. data/data/problems/394.yml +15 -18
  502. data/data/problems/395.yml +12 -13
  503. data/data/problems/396.yml +17 -22
  504. data/data/problems/397.yml +13 -16
  505. data/data/problems/398.yml +8 -9
  506. data/data/problems/399.yml +18 -18
  507. data/data/problems/4.yml +5 -4
  508. data/data/problems/40.yml +11 -14
  509. data/data/problems/400.yml +10 -11
  510. data/data/problems/401.yml +6 -7
  511. data/data/problems/402.yml +16 -21
  512. data/data/problems/403.yml +12 -14
  513. data/data/problems/404.yml +14 -16
  514. data/data/problems/405.yml +10 -11
  515. data/data/problems/406.yml +35 -41
  516. data/data/problems/407.yml +9 -16
  517. data/data/problems/408.yml +9 -9
  518. data/data/problems/409.yml +5 -7
  519. data/data/problems/41.yml +5 -4
  520. data/data/problems/410.yml +10 -13
  521. data/data/problems/411.yml +15 -19
  522. data/data/problems/412.yml +11 -15
  523. data/data/problems/413.yml +8 -8
  524. data/data/problems/414.yml +29 -34
  525. data/data/problems/415.yml +12 -15
  526. data/data/problems/416.yml +7 -7
  527. data/data/problems/417.yml +16 -17
  528. data/data/problems/418.yml +9 -12
  529. data/data/problems/419.yml +13 -18
  530. data/data/problems/42.yml +9 -10
  531. data/data/problems/420.yml +5 -6
  532. data/data/problems/421.yml +14 -25
  533. data/data/problems/422.yml +16 -18
  534. data/data/problems/423.yml +16 -18
  535. data/data/problems/424.yml +18 -19
  536. data/data/problems/425.yml +11 -12
  537. data/data/problems/426.yml +20 -21
  538. data/data/problems/427.yml +11 -13
  539. data/data/problems/428.yml +21 -25
  540. data/data/problems/429.yml +6 -6
  541. data/data/problems/43.yml +15 -13
  542. data/data/problems/430.yml +14 -16
  543. data/data/problems/44.yml +9 -12
  544. data/data/problems/45.yml +11 -11
  545. data/data/problems/46.yml +9 -14
  546. data/data/problems/47.yml +11 -16
  547. data/data/problems/48.yml +5 -3
  548. data/data/problems/49.yml +7 -6
  549. data/data/problems/5.yml +5 -4
  550. data/data/problems/50.yml +11 -6
  551. data/data/problems/51.yml +9 -11
  552. data/data/problems/52.yml +5 -4
  553. data/data/problems/53.yml +15 -24
  554. data/data/problems/54.yml +29 -39
  555. data/data/problems/55.yml +16 -17
  556. data/data/problems/56.yml +5 -7
  557. data/data/problems/57.yml +10 -11
  558. data/data/problems/58.yml +11 -18
  559. data/data/problems/59.yml +11 -19
  560. data/data/problems/6.yml +13 -9
  561. data/data/problems/60.yml +5 -6
  562. data/data/problems/61.yml +18 -26
  563. data/data/problems/62.yml +5 -5
  564. data/data/problems/63.yml +5 -3
  565. data/data/problems/64.yml +52 -126
  566. data/data/problems/65.yml +21 -47
  567. data/data/problems/66.yml +13 -23
  568. data/data/problems/67.yml +10 -13
  569. data/data/problems/68.yml +15 -19
  570. data/data/problems/69.yml +18 -10
  571. data/data/problems/7.yml +5 -2
  572. data/data/problems/70.yml +10 -12
  573. data/data/problems/71.yml +11 -13
  574. data/data/problems/72.yml +11 -12
  575. data/data/problems/73.yml +11 -12
  576. data/data/problems/74.yml +25 -37
  577. data/data/problems/75.yml +10 -12
  578. data/data/problems/76.yml +4 -4
  579. data/data/problems/77.yml +4 -4
  580. data/data/problems/78.yml +13 -8
  581. data/data/problems/79.yml +7 -7
  582. data/data/problems/8.yml +14 -8
  583. data/data/problems/80.yml +7 -7
  584. data/data/problems/81.yml +9 -15
  585. data/data/problems/82.yml +10 -15
  586. data/data/problems/83.yml +10 -19
  587. data/data/problems/84.yml +36 -59
  588. data/data/problems/85.yml +7 -5
  589. data/data/problems/86.yml +11 -11
  590. data/data/problems/87.yml +7 -8
  591. data/data/problems/88.yml +30 -49
  592. data/data/problems/89.yml +13 -14
  593. data/data/problems/9.yml +6 -9
  594. data/data/problems/90.yml +16 -18
  595. data/data/problems/91.yml +10 -15
  596. data/data/problems/92.yml +14 -25
  597. data/data/problems/93.yml +13 -17
  598. data/data/problems/94.yml +7 -7
  599. data/data/problems/95.yml +13 -19
  600. data/data/problems/96.yml +24 -40
  601. data/data/problems/97.yml +7 -10
  602. data/data/problems/98.yml +9 -12
  603. data/data/problems/99.yml +9 -12
  604. data/euler-manager.gemspec +1 -0
  605. data/example/1/README.md +4 -4
  606. data/example/15/README.md +8 -0
  607. data/example/15/python/15.py +5 -0
  608. data/example/15/python/euler.py +0 -0
  609. data/example/2/README.md +7 -5
  610. data/example/Eulerfile.rb +1 -0
  611. data/lib/euler/problem.rb +6 -1
  612. data/lib/euler/solution.rb +4 -2
  613. data/lib/euler/version.rb +1 -1
  614. data/rake/clean.rake +16 -0
  615. data/rake/update.rake +88 -0
  616. data/spec/euler/solution_spec.rb +2 -1
  617. data/templates/Eulerfile.rb +12 -0
  618. metadata +189 -29
  619. data/data/problems/431.yml +0 -33
  620. data/data/problems/432.yml +0 -13
  621. data/data/problems/433.yml +0 -18
  622. data/data/problems/434.yml +0 -32
  623. data/data/problems/435.yml +0 -21
  624. data/data/problems/436.yml +0 -21
  625. data/data/problems/437.yml +0 -22
  626. data/data/problems/438.yml +0 -29
  627. data/data/problems/439.yml +0 -17
  628. data/data/problems/440.yml +0 -21
  629. data/data/problems/441.yml +0 -23
  630. data/data/problems/442.yml +0 -9
  631. data/data/problems/443.yml +0 -13
  632. data/data/problems/444.yml +0 -28
  633. data/data/problems/445.yml +0 -37
  634. data/data/problems/446.yml +0 -29
  635. data/data/problems/447.yml +0 -31
  636. data/data/problems/448.yml +0 -14
  637. data/data/problems/449.yml +0 -17
  638. data/data/problems/450.yml +0 -26
  639. data/data/problems/451.yml +0 -15
  640. data/data/problems/452.yml +0 -8
  641. data/data/problems/453.yml +0 -16
  642. data/data/problems/454.yml +0 -17
  643. data/data/problems/455.yml +0 -16
  644. data/data/problems/456.yml +0 -15
  645. data/scripts/update_problems +0 -68
@@ -2,15 +2,13 @@
2
2
  :id: 154
3
3
  :name: Exploring Pascal's pyramid
4
4
  :url: http://projecteuler.net/problem=154
5
- :content: "\r\n<p>A triangular pyramid is constructed using spherical balls so that
6
- each ball rests on exactly three balls of the next lower level.</p>\r\n<div style=\"text-align:center;\"><img
7
- src=\"project/images/p_154_pyramid.gif\" width=\"488\" height=\"379\" alt=\"\"></div>\r\n<p>Then,
8
- we calculate the number of paths leading from the apex to each position:</p>\r\n<p>A
9
- path starts at the apex and progresses downwards to any of the three spheres directly
10
- below the current position.</p>\r\n<p>Consequently, the number of paths to reach
11
- a certain position is the sum of the numbers immediately above it (depending on
12
- the position, there are up to three numbers above it).</p>\r\n<p>The result is <i>Pascal's
13
- pyramid</i> and the numbers at each level <var>n</var> are the coefficients of the
14
- trinomial expansion \r\n(<var>x + y + z</var>)<sup><var>n</var></sup>.</p>\r\n<p>How
15
- many coefficients in the expansion of (<var>x + y + z</var>)<sup>200000</sup> are
16
- multiples of 10<sup>12</sup>?</p>\r\n"
5
+ :content: "A triangular pyramid is constructed using spherical balls so that each
6
+ ball rests on exactly three balls of the next lower level.\n\n ![](/home/will/src/euler-manager/config/../data/images/p_154_pyramid.gif)\n\nThen,
7
+ we calculate the number of paths leading from the apex to each position:\n\nA path
8
+ starts at the apex and progresses downwards to any of the three spheres directly
9
+ below the current position.\n\nConsequently, the number of paths to reach a certain
10
+ position is the sum of the numbers immediately above it (depending on the position,
11
+ there are up to three numbers above it).\n\nThe result is _Pascal's pyramid_ and
12
+ the numbers at each level <var>n</var> are the coefficients of the trinomial expansion
13
+ \r(<var>x + y + z</var>)<sup><var>n</var></sup>.\n\nHow many coefficients in the
14
+ expansion of (<var>x + y + z</var>)<sup>200000</sup> are multiples of 10<sup>12</sup>?\n\n"
@@ -2,21 +2,18 @@
2
2
  :id: 155
3
3
  :name: Counting Capacitor Circuits
4
4
  :url: http://projecteuler.net/problem=155
5
- :content: "\r\n<p>An electric circuit uses exclusively identical capacitors of the
6
- same value C.\r\n<br>\r\nThe capacitors can be connected in series or in parallel
7
- to form sub-units, which can then be connected in series or in parallel with other
8
- capacitors or other sub-units to form larger sub-units, and so on up to a final
9
- circuit.</p>\r\n<p>Using this simple procedure and up to <var>n</var> identical
10
- capacitors, we can make circuits having a range of different total capacitances.
11
- For example, using up to <var>n</var>=3 capacitors of 60 <img src=\"project/images/p_155_capsmu.gif\"
12
- width=\"12\" height=\"21\" alt=\"\" style=\"vertical-align:middle;\">F each, we
13
- can obtain the following 7 distinct total capacitance values: </p>\r\n<div style=\"text-align:center;\"><img
14
- src=\"project/images/p_155_capacitors1.gif\" width=\"387\" height=\"557\" alt=\"\"></div>\r\n<p>If
5
+ :content: "An electric circuit uses exclusively identical capacitors of the same value
6
+ C.\r \n\rThe capacitors can be connected in series or in parallel to form sub-units,
7
+ which can then be connected in series or in parallel with other capacitors or other
8
+ sub-units to form larger sub-units, and so on up to a final circuit.\n\nUsing this
9
+ simple procedure and up to <var>n</var> identical capacitors, we can make circuits
10
+ having a range of different total capacitances. For example, using up to <var>n</var>=3
11
+ capacitors of 60 ![](/home/will/src/euler-manager/config/../data/images/p_155_capsmu.gif)F
12
+ each, we can obtain the following 7 distinct total capacitance values:\n\n ![](/home/will/src/euler-manager/config/../data/images/p_155_capacitors1.gif)\n\nIf
15
13
  we denote by <var>D</var>(<var>n</var>) the number of distinct total capacitance
16
14
  values we can obtain when using up to <var>n</var> equal-valued capacitors and the
17
15
  simple procedure described above, we have: <var>D</var>(1)=1, <var>D</var>(2)=3,
18
- <var>D</var>(3)=7 ...</p>\r\n<p>Find <var>D</var>(18).</p>\r\n<p><i>Reminder :</i>
19
- When connecting capacitors C<sub>1</sub>, C<sub>2</sub> etc in parallel, the total
20
- capacitance is C<sub>T</sub> = C<sub>1</sub> + C<sub>2</sub> +...,\r\n<br>\r\nwhereas
21
- when connecting them in series, the overall capacitance is given by:\r\n<img src=\"project/images/p_155_capsform.gif\"
22
- width=\"127\" height=\"38\" alt=\"\" style=\"vertical-align:middle;\"></p>\r\n\r\n"
16
+ <var>D</var>(3)=7 ...\n\nFind <var>D</var>(18).\n\n_Reminder :_ When connecting
17
+ capacitors C<sub>1</sub>, C<sub>2</sub> etc in parallel, the total capacitance is
18
+ C<sub>T</sub> = C<sub>1</sub> + C<sub>2</sub> +...,\r \n\rwhereas when connecting
19
+ them in series, the overall capacitance is given by:\r ![](/home/will/src/euler-manager/config/../data/images/p_155_capsform.gif)\n\n"
@@ -2,26 +2,24 @@
2
2
  :id: 156
3
3
  :name: Counting Digits
4
4
  :url: http://projecteuler.net/problem=156
5
- :content: "\r\n<p>Starting from zero the natural numbers are written down in base
6
- 10 like this:\r\n<br>\r\n0 1 2 3 4 5 6 7 8 9 10 11 12....\r\n</p>\r\n<p>Consider
7
- the digit <var>d</var>=1. After we write down each number <var>n</var>, we will
8
- update the number of ones that have occurred and call this number <var>f</var>(<var>n</var>,1).
9
- The first values for <var>f</var>(<var>n</var>,1), then, are as follows:</p>\r\n<div
10
- style=\"text-align:center;\">\r\n<table style=\"text-align:center;\" align=\"center\">\n<tr>\n<td><var>n</var></td>\n<td>\n<var>f</var>(<var>n</var>,1)</td>\r\n</tr>\n<tr>\n<td>0</td>\n<td>0</td>\r\n</tr>\n<tr>\n<td>1</td>\n<td>1</td>\r\n</tr>\n<tr>\n<td>2</td>\n<td>1</td>\r\n</tr>\n<tr>\n<td>3</td>\n<td>1</td>\r\n</tr>\n<tr>\n<td>4</td>\n<td>1</td>\r\n</tr>\n<tr>\n<td>5</td>\n<td>1</td>\r\n</tr>\n<tr>\n<td>6</td>\n<td>1</td>\r\n</tr>\n<tr>\n<td>7</td>\n<td>1</td>\r\n</tr>\n<tr>\n<td>8</td>\n<td>1</td>\r\n</tr>\n<tr>\n<td>9</td>\n<td>1</td>\r\n</tr>\n<tr>\n<td>10</td>\n<td>2</td>\r\n</tr>\n<tr>\n<td>11</td>\n<td>4</td>\r\n</tr>\n<tr>\n<td>12</td>\n<td>5</td>\r\n</tr>\n</table>\n</div>\r\n<p>Note
11
- that <var>f</var>(<var>n</var>,1) never equals 3.\r\n<br>\r\nSo the first two solutions
12
- of the equation <var>f</var>(<var>n</var>,1)=<var>n</var> are <var>n</var>=0 and
13
- <var>n</var>=1. The next solution is <var>n</var>=199981.</p>\r\n<p>In the same
14
- manner the function <var>f</var>(<var>n,d</var>) gives the total number of digits
15
- <var>d</var> that have been written down after the number <var>n</var> has been
16
- written.\r\n<br>\r\nIn fact, for every digit <var>d</var> <img src=\"images/symbol_ne.gif\"
17
- width=\"11\" height=\"10\" alt=\"≠\" border=\"0\" style=\"vertical-align:middle;\">
18
- 0, 0 is the first solution of the equation <var>f</var>(<var>n,d</var>)=<var>n</var>.</p>\r\n<p>Let
19
- <var>s</var>(<var>d</var>) be the sum of all the solutions for which <var>f</var>(<var>n,d</var>)=<var>n</var>.\r\n<br>\r\nYou
20
- are given that <var>s</var>(1)=22786974071.</p>\r\n<p>Find <img src=\"images/symbol_sum.gif\"
21
- width=\"11\" height=\"14\" alt=\"∑\" border=\"0\" style=\"vertical-align:middle;\"><var>s</var>(<var>d</var>)
22
- for 1 <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
23
- style=\"vertical-align:middle;\"> d <img src=\"images/symbol_le.gif\" width=\"10\"
24
- height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"> 9.</p>\r\n<p>Note:
25
- if, for some <var>n</var>, <var>f</var>(<var>n,d</var>)=<var>n</var>\r\n for more
5
+ :content: "Starting from zero the natural numbers are written down in base 10 like
6
+ this:\r \n\r0 1 2 3 4 5 6 7 8 9 10 11 12....\n\nConsider the digit <var>d</var>=1.
7
+ After we write down each number <var>n</var>, we will update the number of ones
8
+ that have occurred and call this number <var>f</var>(<var>n</var>,1). The first
9
+ values for <var>f</var>(<var>n</var>,1), then, are as follows:\n\n| <var>n</var>
10
+ | <var>f</var>(<var>n</var>,1) |\n| 0 | 0 |\n| 1 | 1 |\n| 2 | 1 |\n| 3 | 1 |\n|
11
+ 4 | 1 |\n| 5 | 1 |\n| 6 | 1 |\n| 7 | 1 |\n| 8 | 1 |\n| 9 | 1 |\n| 10 | 2 |\n| 11
12
+ | 4 |\n| 12 | 5 |\n\nNote that <var>f</var>(<var>n</var>,1) never equals 3.\r \n\rSo
13
+ the first two solutions of the equation <var>f</var>(<var>n</var>,1)=<var>n</var>
14
+ are <var>n</var>=0 and <var>n</var>=1. The next solution is <var>n</var>=199981.\n\nIn
15
+ the same manner the function <var>f</var>(<var>n,d</var>) gives the total number
16
+ of digits <var>d</var> that have been written down after the number <var>n</var>
17
+ has been written.\r \n\rIn fact, for every digit <var>d</var> ![≠](/home/will/src/euler-manager/config/../data/images/symbol_ne.gif)
18
+ 0, 0 is the first solution of the equation <var>f</var>(<var>n,d</var>)=<var>n</var>.\n\nLet
19
+ <var>s</var>(<var>d</var>) be the sum of all the solutions for which <var>f</var>(<var>n,d</var>)=<var>n</var>.\r
20
+ \ \n\rYou are given that <var>s</var>(1)=22786974071.\n\nFind ![∑](/home/will/src/euler-manager/config/../data/images/symbol_sum.gif)
21
+ <var>s</var>(<var>d</var>) for 1 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
22
+ d ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) 9.\n\nNote:
23
+ if, for some <var>n</var>, <var>f</var>(<var>n,d</var>)=<var>n</var>\r for more
26
24
  than one value of <var>d</var> this value of <var>n</var> is counted again for every
27
- value of <var>d</var> for which <var>f</var>(<var>n,d</var>)=<var>n</var>.</p>\r\n"
25
+ value of <var>d</var> for which <var>f</var>(<var>n,d</var>)=<var>n</var>.\n\n"
@@ -3,32 +3,30 @@
3
3
  :name: Solving the diophantine equation <sup>1</sup>/<sub><var>a</var></sub>+<sup>1</sup>/<sub><var>b</var></sub>=
4
4
  <sup><var>p</var></sup>/<sub>10<sup><var>n</var></sup></sub>
5
5
  :url: http://projecteuler.net/problem=157
6
- :content: "\r\n<p>Consider the diophantine equation <sup>1</sup>/<sub><var>a</var></sub>+<sup>1</sup>/<sub><var>b</var></sub>=
6
+ :content: "Consider the diophantine equation <sup>1</sup>/<sub><var>a</var></sub>+<sup>1</sup>/<sub><var>b</var></sub>=
7
7
  <sup><var>p</var></sup>/<sub>10<sup><var>n</var></sup></sub> with <var>a, b, p,
8
- n</var> positive integers and <var>a</var> <img src=\"images/symbol_le.gif\" width=\"10\"
9
- height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>b</var>.<br>\r\nFor
10
- <var>n</var>=1 this equation has 20 solutions that are listed below:</p>\r\n<table>\n<tr>\n<td
11
- width=\"120\">\n<sup>1</sup>/<sub>1</sub>+<sup>1</sup>/<sub>1</sub>=<sup>20</sup>/<sub>10</sub>\n</td>\r\n<td
12
- width=\"120\">\n<sup>1</sup>/<sub>1</sub>+<sup>1</sup>/<sub>2</sub>=<sup>15</sup>/<sub>10</sub>\n</td>\r\n<td
13
- width=\"120\">\n<sup>1</sup>/<sub>1</sub>+<sup>1</sup>/<sub>5</sub>=<sup>12</sup>/<sub>10</sub>\n</td>\r\n<td
14
- width=\"120\">\n<sup>1</sup>/<sub>1</sub>+<sup>1</sup>/<sub>10</sub>=<sup>11</sup>/<sub>10</sub>\n</td>\r\n<td
15
- width=\"120\">\n<sup>1</sup>/<sub>2</sub>+<sup>1</sup>/<sub>2</sub>=<sup>10</sup>/<sub>10</sub>\n</td>\r\n</tr>\n<tr>\n<td
16
- width=\"120\">\n<sup>1</sup>/<sub>2</sub>+<sup>1</sup>/<sub>5</sub>=<sup>7</sup>/<sub>10</sub>\n</td>\r\n<td
17
- width=\"120\">\n<sup>1</sup>/<sub>2</sub>+<sup>1</sup>/<sub>10</sub>=<sup>6</sup>/<sub>10</sub>\n</td>\r\n<td
18
- width=\"120\">\n<sup>1</sup>/<sub>3</sub>+<sup>1</sup>/<sub>6</sub>=<sup>5</sup>/<sub>10</sub>\n</td>\r\n<td
19
- width=\"120\">\n<sup>1</sup>/<sub>3</sub>+<sup>1</sup>/<sub>15</sub>=<sup>4</sup>/<sub>10</sub>\n</td>\r\n<td
20
- width=\"120\">\n<sup>1</sup>/<sub>4</sub>+<sup>1</sup>/<sub>4</sub>=<sup>5</sup>/<sub>10</sub>\n</td>\r\n</tr>\n<tr>\n<td
21
- width=\"120\">\n<sup>1</sup>/<sub>4</sub>+<sup>1</sup>/<sub>20</sub>=<sup>3</sup>/<sub>10</sub>\n</td>\r\n<td
22
- width=\"120\">\n<sup>1</sup>/<sub>5</sub>+<sup>1</sup>/<sub>5</sub>=<sup>4</sup>/<sub>10</sub>\n</td>\r\n<td
23
- width=\"120\">\n<sup>1</sup>/<sub>5</sub>+<sup>1</sup>/<sub>10</sub>=<sup>3</sup>/<sub>10</sub>\n</td>\r\n<td
24
- width=\"120\">\n<sup>1</sup>/<sub>6</sub>+<sup>1</sup>/<sub>30</sub>=<sup>2</sup>/<sub>10</sub>\n</td>\r\n<td
25
- width=\"120\">\n<sup>1</sup>/<sub>10</sub>+<sup>1</sup>/<sub>10</sub>=<sup>2</sup>/<sub>10</sub>\n</td>\r\n</tr>\n<tr>\n<td
26
- width=\"120\">\n<sup>1</sup>/<sub>11</sub>+<sup>1</sup>/<sub>110</sub>=<sup>1</sup>/<sub>10</sub>\n</td>\r\n<td
27
- width=\"120\">\n<sup>1</sup>/<sub>12</sub>+<sup>1</sup>/<sub>60</sub>=<sup>1</sup>/<sub>10</sub>\n</td>\r\n<td
28
- width=\"120\">\n<sup>1</sup>/<sub>14</sub>+<sup>1</sup>/<sub>35</sub>=<sup>1</sup>/<sub>10</sub>\n</td>\r\n<td
29
- width=\"120\">\n<sup>1</sup>/<sub>15</sub>+<sup>1</sup>/<sub>30</sub>=<sup>1</sup>/<sub>10</sub>\n</td>\r\n<td
30
- width=\"120\">\n<sup>1</sup>/<sub>20</sub>+<sup>1</sup>/<sub>20</sub>=<sup>1</sup>/<sub>10</sub>\n</td>\r\n</tr>\n</table>\n<p>How
31
- many solutions has this equation for 1 <img src=\"images/symbol_le.gif\" width=\"10\"
32
- height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>n</var>
33
- <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
34
- style=\"vertical-align:middle;\"> 9?</p>\r\n"
8
+ n</var> positive integers and <var>a</var> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
9
+ <var>b</var>. \n\rFor <var>n</var>=1 this equation has 20 solutions that are listed
10
+ below:\n\n| <sup>1</sup>/<sub>1</sub>+<sup>1</sup>/<sub>1</sub>=<sup>20</sup>/<sub>10</sub>
11
+ | <sup>1</sup>/<sub>1</sub>+<sup>1</sup>/<sub>2</sub>=<sup>15</sup>/<sub>10</sub>
12
+ | <sup>1</sup>/<sub>1</sub>+<sup>1</sup>/<sub>5</sub>=<sup>12</sup>/<sub>10</sub>
13
+ | <sup>1</sup>/<sub>1</sub>+<sup>1</sup>/<sub>10</sub>=<sup>11</sup>/<sub>10</sub>
14
+ | <sup>1</sup>/<sub>2</sub>+<sup>1</sup>/<sub>2</sub>=<sup>10</sup>/<sub>10</sub>
15
+ |\n| <sup>1</sup>/<sub>2</sub>+<sup>1</sup>/<sub>5</sub>=<sup>7</sup>/<sub>10</sub>
16
+ | <sup>1</sup>/<sub>2</sub>+<sup>1</sup>/<sub>10</sub>=<sup>6</sup>/<sub>10</sub>
17
+ | <sup>1</sup>/<sub>3</sub>+<sup>1</sup>/<sub>6</sub>=<sup>5</sup>/<sub>10</sub>
18
+ | <sup>1</sup>/<sub>3</sub>+<sup>1</sup>/<sub>15</sub>=<sup>4</sup>/<sub>10</sub>
19
+ | <sup>1</sup>/<sub>4</sub>+<sup>1</sup>/<sub>4</sub>=<sup>5</sup>/<sub>10</sub>
20
+ |\n| <sup>1</sup>/<sub>4</sub>+<sup>1</sup>/<sub>20</sub>=<sup>3</sup>/<sub>10</sub>
21
+ | <sup>1</sup>/<sub>5</sub>+<sup>1</sup>/<sub>5</sub>=<sup>4</sup>/<sub>10</sub>
22
+ | <sup>1</sup>/<sub>5</sub>+<sup>1</sup>/<sub>10</sub>=<sup>3</sup>/<sub>10</sub>
23
+ | <sup>1</sup>/<sub>6</sub>+<sup>1</sup>/<sub>30</sub>=<sup>2</sup>/<sub>10</sub>
24
+ | <sup>1</sup>/<sub>10</sub>+<sup>1</sup>/<sub>10</sub>=<sup>2</sup>/<sub>10</sub>
25
+ |\n| <sup>1</sup>/<sub>11</sub>+<sup>1</sup>/<sub>110</sub>=<sup>1</sup>/<sub>10</sub>
26
+ | <sup>1</sup>/<sub>12</sub>+<sup>1</sup>/<sub>60</sub>=<sup>1</sup>/<sub>10</sub>
27
+ | <sup>1</sup>/<sub>14</sub>+<sup>1</sup>/<sub>35</sub>=<sup>1</sup>/<sub>10</sub>
28
+ | <sup>1</sup>/<sub>15</sub>+<sup>1</sup>/<sub>30</sub>=<sup>1</sup>/<sub>10</sub>
29
+ | <sup>1</sup>/<sub>20</sub>+<sup>1</sup>/<sub>20</sub>=<sup>1</sup>/<sub>10</sub>
30
+ |\n\nHow many solutions has this equation for 1 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
31
+ <var>n</var> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
32
+ 9?\n\n"
@@ -3,17 +3,16 @@
3
3
  :name: Exploring strings for which only one character comes lexicographically after
4
4
  its neighbour to the left
5
5
  :url: http://projecteuler.net/problem=158
6
- :content: "\r\n<p>Taking three different letters from the 26 letters of the alphabet,
7
- character strings of length three can be formed.<br>\r\nExamples are 'abc', 'hat'
8
- and 'zyx'.<br>\r\nWhen we study these three examples we see that for 'abc' two characters
9
- come lexicographically after its neighbour to the left.<br> \r\nFor 'hat' there
10
- is exactly one character that comes lexicographically after its neighbour to the
11
- left. For 'zyx' there are zero characters that come lexicographically after its
12
- neighbour to the left.<br>\r\nIn all there are 10400 strings of length 3 for which
13
- exactly one character comes lexicographically after its neighbour to the left.</p>\r\n<p>We
14
- now consider strings of <var>n</var> <img src=\"images/symbol_le.gif\" width=\"10\"
15
- height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"> 26 different
16
- characters from the alphabet.<br> \r\nFor every <var>n</var>, p(<var>n</var>) is
17
- the number of strings of length <var>n</var> for which exactly one character comes
18
- lexicographically after its neighbour to the left.</p> \r\n<p>What is the maximum
19
- value of p(<var>n</var>)?</p>\r\n"
6
+ :content: "Taking three different letters from the 26 letters of the alphabet, character
7
+ strings of length three can be formed. \n\rExamples are 'abc', 'hat' and 'zyx'.
8
+ \ \n\rWhen we study these three examples we see that for 'abc' two characters come
9
+ lexicographically after its neighbour to the left. \n \rFor 'hat' there is exactly
10
+ one character that comes lexicographically after its neighbour to the left. For
11
+ 'zyx' there are zero characters that come lexicographically after its neighbour
12
+ to the left. \n\rIn all there are 10400 strings of length 3 for which exactly one
13
+ character comes lexicographically after its neighbour to the left.\n\nWe now consider
14
+ strings of <var>n</var> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
15
+ 26 different characters from the alphabet. \n \rFor every <var>n</var>, p(<var>n</var>)
16
+ is the number of strings of length <var>n</var> for which exactly one character
17
+ comes lexicographically after its neighbour to the left.\n\nWhat is the maximum
18
+ value of p(<var>n</var>)?\n\n"
@@ -2,28 +2,18 @@
2
2
  :id: 159
3
3
  :name: Digital root sums of factorisations
4
4
  :url: http://projecteuler.net/problem=159
5
- :content: "\r\n<p>A composite number can be factored many different ways. \r\nFor
6
- instance, not including multiplication by one, 24 can be factored in 7 distinct
7
- ways:</p>\r\n<div style=\"margin-left:50px;\">\r\n24 = 2x2x2x3<br>\r\n24 = 2x3x4<br>\r\n24
8
- = 2x2x6<br>\r\n24 = 4x6<br>\r\n24 = 3x8<br>\r\n24 = 2x12<br>\r\n24 = 24\r\n</div>\r\n<p>Recall
9
- that the digital root of a number, in base 10, is found by adding together the digits
10
- of that number, \r\nand repeating that process until a number is arrived at that
11
- is less than 10. \r\nThus the digital root of 467 is 8.</p>\r\n<p>We shall call
12
- a Digital Root Sum (DRS) the sum of the digital roots of the individual factors
13
- of our number.<br>\r\n The chart below demonstrates all of the DRS values for 24.</p>\r\n<table
14
- align=\"center\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\">\n<tr>\n<th>Factorisation</th>\n<th>Digital
15
- Root Sum</th>\n</tr>\n<tr>\n<td><div style=\"margin-left:20px;\">2x2x2x3</div></td>\r\n<td><div
16
- style=\"text-align:center;\">9</div></td>\n</tr>\n<tr>\n<td><div style=\"margin-left:20px;\">2x3x4</div></td>\r\n<td><div
17
- style=\"text-align:center;\">9</div></td>\n</tr>\n<tr>\n<td><div style=\"margin-left:20px;\">2x2x6</div></td>\r\n<td><div
18
- style=\"text-align:center;\">10</div></td>\n</tr>\n<tr>\n<td><div style=\"margin-left:20px;\">4x6</div></td>\r\n<td><div
19
- style=\"text-align:center;\">10</div></td>\n</tr>\n<tr>\n<td><div style=\"margin-left:20px;\">3x8</div></td>\r\n<td><div
20
- style=\"text-align:center;\">11</div></td>\n</tr>\n<tr>\n<td><div style=\"margin-left:20px;\">2x12</div></td>\r\n<td><div
21
- style=\"text-align:center;\">5</div></td>\n</tr>\n<tr>\n<td><div style=\"margin-left:20px;\">24</div></td>\r\n<td><div
22
- style=\"text-align:center;\">6</div></td>\n</tr>\n</table>\n<p>The maximum Digital
23
- Root Sum of 24 is 11.<br>\r\nThe function mdrs(<var>n</var>) gives the maximum
24
- Digital Root Sum of <var>n</var>. So mdrs(24)=11.<br>\r\nFind <img src=\"images/symbol_sum.gif\"
25
- width=\"11\" height=\"14\" alt=\"∑\" border=\"0\" style=\"vertical-align:middle;\">mdrs(<var>n</var>)
26
- for 1 <img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"&lt;\"
27
- border=\"0\" style=\"vertical-align:middle;\"><var>n</var> <img src=\"images/symbol_lt.gif\"
28
- width=\"10\" height=\"10\" alt=\"&lt;\" border=\"0\" style=\"vertical-align:middle;\">
29
- 1,000,000.</p>\r\n"
5
+ :content: "A composite number can be factored many different ways. \rFor instance,
6
+ not including multiplication by one, 24 can be factored in 7 distinct ways:\n\n\r24
7
+ = 2x2x2x3 \n\r24 = 2x3x4 \n\r24 = 2x2x6 \n\r24 = 4x6 \n\r24 = 3x8 \n\r24 =
8
+ 2x12 \n\r24 = 24\r\n\nRecall that the digital root of a number, in base 10, is
9
+ found by adding together the digits of that number, \rand repeating that process
10
+ until a number is arrived at that is less than 10. \rThus the digital root of 467
11
+ is 8.\n\nWe shall call a Digital Root Sum (DRS) the sum of the digital roots of
12
+ the individual factors of our number. \n\r The chart below demonstrates all of
13
+ the DRS values for 24.\n\n| Factorisation | Digital Root Sum |\n| --- | --- |\n|
14
+ \n2x2x2x3\n | \n9\n |\n| \n2x3x4\n | \n9\n |\n| \n2x2x6\n | \n10\n |\n| \n4x6\n
15
+ | \n10\n |\n| \n3x8\n | \n11\n |\n| \n2x12\n | \n5\n |\n| \n24\n | \n6\n |\n\nThe
16
+ maximum Digital Root Sum of 24 is 11. \n\rThe function mdrs(<var>n</var>) gives
17
+ the maximum Digital Root Sum of <var>n</var>. So mdrs(24)=11. \n\rFind ![∑](/home/will/src/euler-manager/config/../data/images/symbol_sum.gif)mdrs(<var>n</var>)
18
+ for 1 ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif) <var>n</var>
19
+ ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif) 1,000,000.\n\n"
data/data/problems/16.yml CHANGED
@@ -2,5 +2,8 @@
2
2
  :id: 16
3
3
  :name: Power digit sum
4
4
  :url: http://projecteuler.net/problem=16
5
- :content: "\r\n\n<p>2<sup>15</sup> = 32768 and the sum of its digits is 3 + 2 + 7
6
- + 6 + 8 = 26.</p>\n<p>What is the sum of the digits of the number 2<sup>1000</sup>?</p>\n\r\n"
5
+ :content: |+
6
+ 2<sup>15</sup> = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.
7
+
8
+ What is the sum of the digits of the number 2<sup>1000</sup>?
9
+
@@ -2,7 +2,6 @@
2
2
  :id: 160
3
3
  :name: Factorial trailing digits
4
4
  :url: http://projecteuler.net/problem=160
5
- :content: "\r\n<p>For any N, let f(N) be the last five digits before the trailing
6
- zeroes in N!.<br>\r\nFor example,</p>\r\n<p style=\"margin-left:50px;\">9! = 362880
7
- so f(9)=36288<br>\r\n10! = 3628800 so f(10)=36288<br>\r\n20! = 2432902008176640000
8
- so f(20)=17664</p>\r\n<p>Find f(1,000,000,000,000)</p>\r\n"
5
+ :content: "For any N, let f(N) be the last five digits before the trailing zeroes
6
+ in N!. \n\rFor example,\n\n9! = 362880 so f(9)=36288 \n\r10! = 3628800 so f(10)=36288
7
+ \ \n\r20! = 2432902008176640000 so f(20)=17664\n\nFind f(1,000,000,000,000)\n\n"
@@ -2,14 +2,10 @@
2
2
  :id: 161
3
3
  :name: Triominoes
4
4
  :url: http://projecteuler.net/problem=161
5
- :content: "\r\n<p>A triomino is a shape consisting of three squares joined via the
6
- edges.\r\nThere are two basic forms:</p>\r\n\r\n<p style=\"text-align:center;\"><img
7
- src=\"http://projecteuler.net/project/images/p_161_trio1.gif\" alt=\"\"></p>\r\n\r\n<p>If
8
- all possible orientations are taken into account there are six:</p>\r\n\r\n<p style=\"text-align:center;\"><img
9
- src=\"http://projecteuler.net/project/images/p_161_trio3.gif\" alt=\"\"></p>\r\n\r\n<p>Any
10
- n by m grid for which nxm is divisible by 3 can be tiled with triominoes.<br>\r\nIf
5
+ :content: "A triomino is a shape consisting of three squares joined via the edges.\rThere
6
+ are two basic forms:\n\n![](/home/will/src/euler-manager/config/../data/images/p_161_trio1.gif)\n\nIf
7
+ all possible orientations are taken into account there are six:\n\n![](/home/will/src/euler-manager/config/../data/images/p_161_trio3.gif)\n\nAny
8
+ n by m grid for which nxm is divisible by 3 can be tiled with triominoes. \n\rIf
11
9
  we consider tilings that can be obtained by reflection or rotation from another
12
- tiling as different there are 41 ways a 2 by 9 grid can be tiled with triominoes:</p>\r\n\r\n<p
13
- style=\"text-align:center;\"><img src=\"http://projecteuler.net/project/images/p_161_k9.gif\"
14
- alt=\"\"></p>\r\n\r\n<p>In how many ways can a 9 by 12 grid be tiled in this way
15
- by triominoes?</p>\r\n"
10
+ tiling as different there are 41 ways a 2 by 9 grid can be tiled with triominoes:\n\n![](/home/will/src/euler-manager/config/../data/images/p_161_k9.gif)\n\nIn
11
+ how many ways can a 9 by 12 grid be tiled in this way by triominoes?\n\n"
@@ -2,14 +2,13 @@
2
2
  :id: 162
3
3
  :name: Hexadecimal numbers
4
4
  :url: http://projecteuler.net/problem=162
5
- :content: "\r\n<p>In the hexadecimal number system numbers are represented using
6
- 16 different digits:</p>\r\n<div style=\"text-align:center;\">0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F</div>\r\n<p>The
7
- hexadecimal number AF when written in the decimal number system equals 10x16+15=175.</p>\r\n<p>In
8
- the 3-digit hexadecimal numbers 10A, 1A0, A10, and A01 the digits 0,1 and A are
9
- all present.<br>\r\nLike numbers written in base ten we write hexadecimal numbers
10
- without leading zeroes.</p>\r\n<p>How many hexadecimal numbers containing at most
11
- sixteen hexadecimal digits exist with all of the digits 0,1, and A present at least
12
- once?<br>\r\nGive your answer as a hexadecimal number.</p>\r\n<p>(A,B,C,D,E and
13
- F in upper case, without any leading or trailing code that marks the number as hexadecimal
14
- and without leading zeroes , e.g. 1A3F and not: 1a3f and not 0x1a3f and not $1A3F
15
- and not #1A3F and not 0000001A3F)</p>\r\n"
5
+ :content: "In the hexadecimal number system numbers are represented using 16 different
6
+ digits:\n\n0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F\n\nThe hexadecimal number AF when written
7
+ in the decimal number system equals 10x16+15=175.\n\nIn the 3-digit hexadecimal
8
+ numbers 10A, 1A0, A10, and A01 the digits 0,1 and A are all present. \n\rLike numbers
9
+ written in base ten we write hexadecimal numbers without leading zeroes.\n\nHow
10
+ many hexadecimal numbers containing at most sixteen hexadecimal digits exist with
11
+ all of the digits 0,1, and A present at least once? \n\rGive your answer as a hexadecimal
12
+ number.\n\n(A,B,C,D,E and F in upper case, without any leading or trailing code
13
+ that marks the number as hexadecimal and without leading zeroes , e.g. 1A3F and
14
+ not: 1a3f and not 0x1a3f and not $1A3F and not #1A3F and not 0000001A3F)\n\n"
@@ -2,18 +2,16 @@
2
2
  :id: 163
3
3
  :name: Cross-hatched triangles
4
4
  :url: http://projecteuler.net/problem=163
5
- :content: "\r\n<p>Consider an equilateral triangle in which straight lines are drawn
6
- from each vertex to the middle of the opposite side, such as in the <i>size 1</i>
7
- triangle in the sketch below.</p>\r\n<div style=\"text-align:center;\"><img src=\"project/images/p_163.gif\"
8
- width=\"300\" height=\"200\" alt=\"\"></div>\r\n<p>Sixteen triangles of either different
9
- shape or size or orientation or location can now be observed in that triangle. Using
10
- <i>size 1</i> triangles as building blocks, larger triangles can be formed, such
11
- as the <i>size 2</i> triangle in the above sketch. One-hundred and four triangles
12
- of either different shape or size or orientation or location can now be observed
13
- in that <i>size 2</i> triangle.</p>\r\n<p>It can be observed that the <i>size 2</i>
14
- triangle contains 4 <i>size 1</i> triangle building blocks. A <i>size 3</i> triangle
15
- would contain 9 <i>size 1</i> triangle building blocks and a <i>size n</i> triangle
16
- would thus contain <i>n<sup>2</sup> size 1</i> triangle building blocks.</p>\r\n<p>If
17
- we denote T(<var>n</var>) as the number of triangles present in a triangle of <i>size
18
- <var>n</var></i>, then</p>\r\n<p style=\"margin-left:50px;\">T(1) = 16<br>\r\nT(2)
19
- = 104</p>\r\n<p>Find T(36).</p>\r\n\r\n"
5
+ :content: "Consider an equilateral triangle in which straight lines are drawn from
6
+ each vertex to the middle of the opposite side, such as in the _size 1_ triangle
7
+ in the sketch below.\n\n ![](/home/will/src/euler-manager/config/../data/images/p_163.gif)\n\nSixteen
8
+ triangles of either different shape or size or orientation or location can now be
9
+ observed in that triangle. Using _size 1_ triangles as building blocks, larger triangles
10
+ can be formed, such as the _size 2_ triangle in the above sketch. One-hundred and
11
+ four triangles of either different shape or size or orientation or location can
12
+ now be observed in that _size 2_ triangle.\n\nIt can be observed that the _size
13
+ 2_ triangle contains 4 _size 1_ triangle building blocks. A _size 3_ triangle would
14
+ contain 9 _size 1_ triangle building blocks and a _size n_ triangle would thus contain
15
+ _n<sup>2</sup> size 1_ triangle building blocks.\n\nIf we denote T(<var>n</var>)
16
+ as the number of triangles present in a triangle of _size <var>n</var>_, then\n\nT(1)
17
+ = 16 \n\rT(2) = 104\n\nFind T(36).\n\n"
@@ -3,6 +3,6 @@
3
3
  :name: Numbers for which no three consecutive digits have a sum greater than a given
4
4
  value
5
5
  :url: http://projecteuler.net/problem=164
6
- :content: "\r\n<p>How many 20 digit numbers <var>n</var> (without any leading zero)
7
- exist such that no three consecutive digits of <var>n</var> have a sum greater than
8
- 9?</p>\r\n"
6
+ :content: |+
7
+ How many 20 digit numbers <var>n</var> (without any leading zero) exist such that no three consecutive digits of <var>n</var> have a sum greater than 9?
8
+
@@ -2,31 +2,28 @@
2
2
  :id: 165
3
3
  :name: Intersections
4
4
  :url: http://projecteuler.net/problem=165
5
- :content: "\r\n<p>A segment is uniquely defined by its two endpoints.<br> By considering
6
- two line segments in plane geometry there are three possibilities:<br> \r\nthe segments
7
- have zero points, one point, or infinitely many points in common.</p>\r\n<p>Moreover
8
- when two segments have exactly one point in common it might be the case that that
9
- common point is an endpoint of either one of the segments or of both. If a common
10
- point of two segments is not an endpoint of either of the segments it is an interior
11
- point of both segments.<br>\r\nWe will call a common point T of two segments L<sub>1</sub>
12
- and L<sub>2</sub> a true intersection point of L<sub>1</sub> and L<sub>2</sub> if
13
- T is the only common point of L<sub>1</sub> and L<sub>2</sub> and T is an interior
14
- point of both segments.\r\n</p>\r\n<p>Consider the three segments L<sub>1</sub>,
15
- L<sub>2</sub>, and L<sub>3</sub>:</p>\r\n<p style=\"margin-left:20px;\">L<sub>1</sub>:
16
- (27, 44) to (12, 32)<br>\r\nL<sub>2</sub>: (46, 53) to (17, 62)<br>\r\nL<sub>3</sub>:
17
- (46, 70) to (22, 40)</p>\r\n<p>It can be verified that line segments L<sub>2</sub>
18
- and L<sub>3</sub> have a true intersection point. We note that as the one of the
19
- end points of L<sub>3</sub>: (22,40) lies on L<sub>1</sub> this is not considered
20
- to be a true point of intersection. L<sub>1</sub> and L<sub>2</sub> have no common
21
- point. So among the three line segments, we find one true intersection point.</p>\r\n<p>Now
22
- let us do the same for 5000 line segments. To this end, we generate 20000 numbers
23
- using the so-called \"Blum Blum Shub\" pseudo-random number generator.</p>\r\n<p
24
- style=\"margin-left:50px;\">s<sub>0</sub> = 290797<br><br>\r\ns<sub>n+1</sub> =
25
- s<sub>n</sub><img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\"
26
- border=\"0\" style=\"vertical-align:middle;\">s<sub>n</sub> (modulo 50515093)<br><br>\r\nt<sub>n</sub>
27
- = s<sub>n</sub> (modulo 500)</p>\r\n<p>To create each line segment, we use four
28
- consecutive numbers t<sub>n</sub>. That is, the first line segment is given by:</p>\r\n<p>(t<sub>1</sub>,
29
- t<sub>2</sub>) to (t<sub>3</sub>, t<sub>4</sub>)</p>\r\n<p>The first four numbers
30
- computed according to the above generator should be: 27, 144, 12 and 232. The first
31
- segment would thus be (27,144) to (12,232).</p>\r\n<p>How many distinct true intersection
32
- points are found among the 5000 line segments?</p>\r\n\r\n"
5
+ :content: "A segment is uniquely defined by its two endpoints. \n By considering
6
+ two line segments in plane geometry there are three possibilities: \n \rthe segments
7
+ have zero points, one point, or infinitely many points in common.\n\nMoreover when
8
+ two segments have exactly one point in common it might be the case that that common
9
+ point is an endpoint of either one of the segments or of both. If a common point
10
+ of two segments is not an endpoint of either of the segments it is an interior point
11
+ of both segments. \n\rWe will call a common point T of two segments L<sub>1</sub>
12
+ and L<sub>2</sub> a true intersection point of L<sub>1</sub> and L<sub>2</sub> if
13
+ T is the only common point of L<sub>1</sub> and L<sub>2</sub> and T is an interior
14
+ point of both segments.\n\nConsider the three segments L<sub>1</sub>, L<sub>2</sub>,
15
+ and L<sub>3</sub>:\n\nL<sub>1</sub>: (27, 44) to (12, 32) \n\rL<sub>2</sub>: (46,
16
+ 53) to (17, 62) \n\rL<sub>3</sub>: (46, 70) to (22, 40)\n\nIt can be verified that
17
+ line segments L<sub>2</sub> and L<sub>3</sub> have a true intersection point. We
18
+ note that as the one of the end points of L<sub>3</sub>: (22,40) lies on L<sub>1</sub>
19
+ this is not considered to be a true point of intersection. L<sub>1</sub> and L<sub>2</sub>
20
+ have no common point. So among the three line segments, we find one true intersection
21
+ point.\n\nNow let us do the same for 5000 line segments. To this end, we generate
22
+ 20000 numbers using the so-called \"Blum Blum Shub\" pseudo-random number generator.\n\ns<sub>0</sub>
23
+ = 290797 \n \n \n\rs<sub>n+1</sub> = s<sub>n</sub> ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)s<sub>n</sub>
24
+ (modulo 50515093) \n \n \n\rt<sub>n</sub> = s<sub>n</sub> (modulo 500)\n\nTo
25
+ create each line segment, we use four consecutive numbers t<sub>n</sub>. That is,
26
+ the first line segment is given by:\n\n(t<sub>1</sub>, t<sub>2</sub>) to (t<sub>3</sub>,
27
+ t<sub>4</sub>)\n\nThe first four numbers computed according to the above generator
28
+ should be: 27, 144, 12 and 232. The first segment would thus be (27,144) to (12,232).\n\nHow
29
+ many distinct true intersection points are found among the 5000 line segments?\n\n"
@@ -2,14 +2,10 @@
2
2
  :id: 166
3
3
  :name: Criss Cross
4
4
  :url: http://projecteuler.net/problem=166
5
- :content: "\r\n<p>A 4x4 grid is filled with digits d, 0 <img src=\"images/symbol_le.gif\"
6
- width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">
7
- d <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
8
- style=\"vertical-align:middle;\"> 9.</p>\r\n\r\n<p>It can be seen that in the grid</p>\r\n\r\n<p
9
- style=\"text-align:center;\">\r\n6 3 3 0<br>\r\n5 0 4 3<br>\r\n0 7 1 4<br>\r\n1
10
- 2 4 5</p>\r\n\r\n<p>the sum of each row and each column has the value 12. Moreover
11
- the sum of each diagonal is also 12.</p>\r\n\r\n<p>In how many ways can you fill
12
- a 4x4 grid with the digits d, 0 <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\"
13
- alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"> d <img src=\"images/symbol_le.gif\"
14
- width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">
15
- 9 so that each row, each column, and both diagonals have the same sum?</p>\r\n"
5
+ :content: "A 4x4 grid is filled with digits d, 0 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
6
+ d ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) 9.\n\nIt
7
+ can be seen that in the grid\n\n6 3 3 0 \n\r5 0 4 3 \n\r0 7 1 4 \n\r1 2 4 5\n\nthe
8
+ sum of each row and each column has the value 12. Moreover the sum of each diagonal
9
+ is also 12.\n\nIn how many ways can you fill a 4x4 grid with the digits d, 0 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
10
+ d ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) 9 so that
11
+ each row, each column, and both diagonals have the same sum?\n\n"
@@ -2,16 +2,14 @@
2
2
  :id: 167
3
3
  :name: Investigating Ulam sequences
4
4
  :url: http://projecteuler.net/problem=167
5
- :content: "\r\n<p>For two positive integers a and b, the Ulam sequence U(a,b) is defined
6
- by U(a,b)<sub>1</sub> = a, U(a,b)<sub>2</sub> = b and for k &gt; 2,\r\nU(a,b)<sub>k</sub>
5
+ :content: "For two positive integers a and b, the Ulam sequence U(a,b) is defined
6
+ by U(a,b)<sub>1</sub> = a, U(a,b)<sub>2</sub> = b and for k > 2,\rU(a,b)<sub>k</sub>
7
7
  is the smallest integer greater than U(a,b)<sub>(k-1)</sub> which can be written
8
- in exactly one way as the sum of two distinct previous members of U(a,b).</p>\r\n<p>For
9
- example, the sequence U(1,2) begins with<br>\r\n1, 2, 3 = 1 + 2, 4 = 1 + 3, 6 =
10
- 2 + 4, 8 = 2 + 6, 11 = 3 + 8;<br>\r\n5 does not belong to it because 5 = 1 + 4 =
11
- 2 + 3 has two representations as the sum of two previous members, likewise 7 = 1
12
- + 6 = 3 + 4.</p>\r\n<p>Find <img src=\"images/symbol_sum.gif\" width=\"11\" height=\"14\"
13
- alt=\"∑\" border=\"0\" style=\"vertical-align:middle;\">U(2,2<var>n</var>+1)<sub><var>k</var></sub>
14
- for 2 <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
15
- style=\"vertical-align:middle;\"><var>n</var> <img src=\"images/symbol_le.gif\"
16
- width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">10,
17
- where <var>k</var> = 10<sup>11</sup>.</p>\r\n"
8
+ in exactly one way as the sum of two distinct previous members of U(a,b).\n\nFor
9
+ example, the sequence U(1,2) begins with \n\r1, 2, 3 = 1 + 2, 4 = 1 + 3, 6 = 2
10
+ + 4, 8 = 2 + 6, 11 = 3 + 8; \n\r5 does not belong to it because 5 = 1 + 4 = 2 +
11
+ 3 has two representations as the sum of two previous members, likewise 7 = 1 + 6
12
+ = 3 + 4.\n\nFind ![∑](/home/will/src/euler-manager/config/../data/images/symbol_sum.gif)U(2,2<var>n</var>+1)<sub><var>k</var></sub>
13
+ for 2 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) <var>n</var>
14
+ ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)10, where
15
+ <var>k</var> = 10<sup>11</sup>.\n\n"
@@ -2,12 +2,10 @@
2
2
  :id: 168
3
3
  :name: Number Rotations
4
4
  :url: http://projecteuler.net/problem=168
5
- :content: "\r\n<p>Consider the number 142857. We can right-rotate this number by moving
6
- the last digit (7) to the front of it, giving us 714285.<br>\r\nIt can be verified
7
- that 714285=5<img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\"
8
- border=\"0\" style=\"vertical-align:middle;\">142857.<br>\r\nThis demonstrates an
9
- unusual property of 142857: it is a divisor of its right-rotation.</p>\r\n<p>Find
10
- the last 5 digits of the sum of all integers <var>n</var>, 10 <img src=\"images/symbol_lt.gif\"
11
- width=\"10\" height=\"10\" alt=\"&lt;\" border=\"0\" style=\"vertical-align:middle;\"><var>n</var>
12
- <img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"&lt;\" border=\"0\"
13
- style=\"vertical-align:middle;\"> 10<sup>100</sup>, that have this property.</p>\r\n\r\n"
5
+ :content: "Consider the number 142857. We can right-rotate this number by moving the
6
+ last digit (7) to the front of it, giving us 714285. \n\rIt can be verified that
7
+ 714285=5 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)142857.
8
+ \ \n\rThis demonstrates an unusual property of 142857: it is a divisor of its right-rotation.\n\nFind
9
+ the last 5 digits of the sum of all integers <var>n</var>, 10 ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)
10
+ <var>n</var> ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)
11
+ 10<sup>100</sup>, that have this property.\n\n"
@@ -3,8 +3,7 @@
3
3
  :name: Exploring the number of different ways a number can be expressed as a sum of
4
4
  powers of 2
5
5
  :url: http://projecteuler.net/problem=169
6
- :content: "\r\n<p>Define f(0)=1 and f(<var>n</var>) to be the number of different
7
- ways <var>n</var> can be expressed as a sum of integer powers of 2 using each power
8
- no more than twice.</p>\r\n<p>For example, f(10)=5 since there are five different
9
- ways to express 10:</p>\r\n<p style=\"margin-left:50px;\">1 + 1 + 8<br>\r\n1 + 1
10
- + 4 + 4<br>1 + 1 + 2 + 2 + 4<br>\r\n2 + 4 + 4<br>\r\n2 + 8</p>\r\n<p>What is f(10<sup>25</sup>)?</p>\r\n\r\n"
6
+ :content: "Define f(0)=1 and f(<var>n</var>) to be the number of different ways <var>n</var>
7
+ can be expressed as a sum of integer powers of 2 using each power no more than twice.\n\nFor
8
+ example, f(10)=5 since there are five different ways to express 10:\n\n1 + 1 + 8
9
+ \ \n\r1 + 1 + 4 + 4 \n1 + 1 + 2 + 2 + 4 \n\r2 + 4 + 4 \n\r2 + 8\n\nWhat is f(10<sup>25</sup>)?\n\n"