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,35 +2,32 @@
2
2
  :id: 328
3
3
  :name: Lowest-cost Search
4
4
  :url: http://projecteuler.net/problem=328
5
- :content: "\r\n<p>We are trying to find a hidden number selected from the set of integers
6
- {1, 2, ..., <var>n</var>} by asking questions. \r\nEach number (question) we ask,
7
- has a <u>cost equal to the number asked</u> and we get one of three possible answers:<br></p>\n<ul>\n<li>
8
- \"Your guess is lower than the hidden number\", or</li>\r\n<li> \"Yes, that's it!\",
9
- or</li>\r\n<li> \"Your guess is higher than the hidden number\".</li>\r\n</ul>\n<p>Given
10
- the value of <var>n</var>, an <i>optimal strategy</i> minimizes the total cost (i.e.
11
- the sum of all the questions asked) <u>for the worst possible case</u>. E.g.</p>\r\n\r\n<p>If
12
- <var>n</var>=3, the best we can do is obviously to ask the number \"<b>2</b>\".
13
- The answer will immediately lead us to find the hidden number (at a total cost =
14
- 2).</p>\r\n\r\n<p>If <var>n</var>=8, we might decide to use a \"binary search\"
15
- type of strategy: Our first question would be \"<b>4</b>\" and if the hidden number
16
- is higher than 4 we will need one or two additional questions.<br>\r\nLet our second
17
- question be \"<b>6</b>\". If the hidden number is still higher than 6, we will need
18
- a third question in order to discriminate between 7 and 8.<br>\r\nThus, our third
19
- question will be \"<b>7</b>\" and the total cost for this worst-case scenario will
20
- be 4+6+7=<span style=\"color:red;\"><b>17</b></span>.</p>\r\n\r\n<p>We can improve
21
- considerably the worst-case cost for <var>n</var>=8, by asking \"<b>5</b>\" as our
22
- first question.<br>\r\nIf we are told that the hidden number is higher than 5, our
23
- second question will be \"<b>7</b>\", then we'll know for certain what the hidden
24
- number is (for a total cost of 5+7=<span style=\"color:blue;\"><b>12</b></span>).<br>\r\nIf
25
- we are told that the hidden number is lower than 5, our second question will be
26
- \"<b>3</b>\" and if the hidden number is lower than 3 our third question will be
27
- \"<b>1</b>\", giving a total cost of 5+3+1=<span style=\"color:blue;\"><b>9</b></span>.<br>\r\nSince
28
- <span style=\"color:blue;\"><b>12</b></span>&gt;<span style=\"color:blue;\"><b>9</b></span>,
29
- the worst-case cost for this strategy is <span style=\"color:red;\"><b>12</b></span>.
5
+ :content: "We are trying to find a hidden number selected from the set of integers
6
+ {1, 2, ..., <var>n</var>} by asking questions. \rEach number (question) we ask,
7
+ has a <u>cost equal to the number asked</u> and we get one of three possible answers:\n\n-
8
+ \"Your guess is lower than the hidden number\", or\n- \"Yes, that's it!\", or\n-
9
+ \"Your guess is higher than the hidden number\".\n\nGiven the value of <var>n</var>,
10
+ an _optimal strategy_ minimizes the total cost (i.e. the sum of all the questions
11
+ asked) <u>for the worst possible case</u>. E.g.\n\nIf <var>n</var>=3, the best we
12
+ can do is obviously to ask the number \" **2** \". The answer will immediately lead
13
+ us to find the hidden number (at a total cost = 2).\n\nIf <var>n</var>=8, we might
14
+ decide to use a \"binary search\" type of strategy: Our first question would be
15
+ \" **4** \" and if the hidden number is higher than 4 we will need one or two additional
16
+ questions. \n\rLet our second question be \" **6** \". If the hidden number is
17
+ still higher than 6, we will need a third question in order to discriminate between
18
+ 7 and 8. \n\rThus, our third question will be \" **7** \" and the total cost for
19
+ this worst-case scenario will be 4+6+7= **17** .\n\nWe can improve considerably
20
+ the worst-case cost for <var>n</var>=8, by asking \" **5** \" as our first question.
21
+ \ \n\rIf we are told that the hidden number is higher than 5, our second question
22
+ will be \" **7** \", then we'll know for certain what the hidden number is (for
23
+ a total cost of 5+7= **12** ). \n\rIf we are told that the hidden number is lower
24
+ than 5, our second question will be \" **3** \" and if the hidden number is lower
25
+ than 3 our third question will be \" **1** \", giving a total cost of 5+3+1= **9**
26
+ . \n\rSince **12** > **9** , the worst-case cost for this strategy is **12** .
30
27
  That's better than what we achieved previously with the \"binary search\" strategy;
31
- it is also better than or equal to any other strategy.<br>\r\nSo, in fact, we have
32
- just described an optimal strategy for <var>n</var>=8.</p>\r\n\r\n<p>Let C(<var>n</var>)
33
- be the worst-case cost achieved by an optimal strategy for <var>n</var>, as described
34
- above.<br>\r\nThus C(1) = 0, C(2) = 1, C(3) = 2 and C(8) = 12.<br>\r\nSimilarly,
35
- C(100) = 400 and <img style=\"vertical-align:middle\" src=\"project/images/p_328_sum1.gif\">C(<var>n</var>)
36
- = 17575.</p>\r\n\r\n<p>Find <img style=\"vertical-align:middle\" src=\"project/images/p_328_sum2.gif\">C(<var>n</var>).</p>\r\n"
28
+ it is also better than or equal to any other strategy. \n\rSo, in fact, we have
29
+ just described an optimal strategy for <var>n</var>=8.\n\nLet C(<var>n</var>) be
30
+ the worst-case cost achieved by an optimal strategy for <var>n</var>, as described
31
+ above. \n\rThus C(1) = 0, C(2) = 1, C(3) = 2 and C(8) = 12. \n\rSimilarly, C(100)
32
+ = 400 and ![](/home/will/src/euler-manager/config/../data/images/p_328_sum1.gif)C(<var>n</var>)
33
+ = 17575.\n\nFind ![](/home/will/src/euler-manager/config/../data/images/p_328_sum2.gif)C(<var>n</var>).\n\n"
@@ -2,16 +2,15 @@
2
2
  :id: 329
3
3
  :name: Prime Frog
4
4
  :url: http://projecteuler.net/problem=329
5
- :content: "\r\n<p>Susan has a prime frog.<br>\r\nHer frog is jumping around over 500
6
- squares numbered 1 to 500.\r\nHe can only jump one square to the left or to the
7
- right, with equal probability, and he cannot jump outside the range [1;500].<br>(if
8
- it lands at either end, it automatically jumps to the only available square on the
9
- next move.)\r\n</p>\r\n<p>\r\nWhen he is on a square with a prime number on it,
10
- he croaks 'P' (PRIME) with probability 2/3 or 'N' (NOT PRIME) with probability 1/3
11
- just before jumping to the next square.<br>\r\nWhen he is on a square with a number
12
- on it that is not a prime he croaks 'P' with probability 1/3 or 'N' with probability
13
- 2/3 just before jumping to the next square.\r\n</p>\r\n<p>\r\nGiven that the frog's
14
- starting position is random with the same probability for every square, and given
15
- that she listens to his first 15 croaks, what is the probability that she hears
16
- the sequence PPPPNNPPPNPPNPN?\r\n</p>\r\nGive your answer as a fraction p/q in reduced
17
- form.\r\n\r\n"
5
+ :content: "Susan has a prime frog. \n\rHer frog is jumping around over 500 squares
6
+ numbered 1 to 500.\rHe can only jump one square to the left or to the right, with
7
+ equal probability, and he cannot jump outside the range [1;500]. \n(if it lands
8
+ at either end, it automatically jumps to the only available square on the next move.)\n\nWhen
9
+ he is on a square with a prime number on it, he croaks 'P' (PRIME) with probability
10
+ 2/3 or 'N' (NOT PRIME) with probability 1/3 just before jumping to the next square.
11
+ \ \n\rWhen he is on a square with a number on it that is not a prime he croaks 'P'
12
+ with probability 1/3 or 'N' with probability 2/3 just before jumping to the next
13
+ square.\n\nGiven that the frog's starting position is random with the same probability
14
+ for every square, and given that she listens to his first 15 croaks, what is the
15
+ probability that she hears the sequence PPPPNNPPPNPPNPN?\n\n\rGive your answer as
16
+ a fraction p/q in reduced form.\r\r\n"
data/data/problems/33.yml CHANGED
@@ -2,12 +2,12 @@
2
2
  :id: 33
3
3
  :name: Digit canceling fractions
4
4
  :url: http://projecteuler.net/problem=33
5
- :content: "\r\n<p>The fraction <sup>49</sup>/<sub>98</sub> is a curious fraction,
6
- as an inexperienced mathematician in attempting to simplify it may incorrectly believe
7
- that <sup>49</sup>/<sub>98</sub> = <sup>4</sup>/<sub>8</sub>, which is correct,
8
- is obtained by cancelling the 9s.</p>\r\n<p>We shall consider fractions like, <sup>30</sup>/<sub>50</sub>
9
- = <sup>3</sup>/<sub>5</sub>, to be trivial examples.</p>\r\n<p>There are exactly
10
- four non-trivial examples of this type of fraction, less than one in value, and
11
- containing two digits in the numerator and denominator.</p>\r\n<p>If the product
12
- of these four fractions is given in its lowest common terms, find the value of the
13
- denominator.</p>\r\n\r\n"
5
+ :content: |+
6
+ The fraction <sup>49</sup>/<sub>98</sub> is a curious fraction, as an inexperienced mathematician in attempting to simplify it may incorrectly believe that <sup>49</sup>/<sub>98</sub> = <sup>4</sup>/<sub>8</sub>, which is correct, is obtained by cancelling the 9s.
7
+
8
+ We shall consider fractions like, <sup>30</sup>/<sub>50</sub> = <sup>3</sup>/<sub>5</sub>, to be trivial examples.
9
+
10
+ There are exactly four non-trivial examples of this type of fraction, less than one in value, and containing two digits in the numerator and denominator.
11
+
12
+ If the product of these four fractions is given in its lowest common terms, find the value of the denominator.
13
+
@@ -2,39 +2,20 @@
2
2
  :id: 330
3
3
  :name: Euler's Number
4
4
  :url: http://projecteuler.net/problem=330
5
- :content: "\r\nAn infinite sequence of real numbers <var>a</var>(<var>n</var>) is
6
- defined for all integers <var>n</var> as follows:\r\n<div align=\"center\"><img
7
- src=\"project/images/p_330_formula.gif\"></div>\r\n\r\n<p>For example,<br></p>\n<table
8
- class=\"formula\"><tr>\n<td>\n<var>a</var>(0) = </td>\r\n <td><table class=\"frac\">\n<tr><td>1</td></tr>\n<tr><td
9
- class=\"overline\">1!</td></tr>\n</table></td>\r\n <td>+</td>\r\n <td><table
10
- class=\"frac\">\n<tr><td>1</td></tr>\n<tr><td class=\"overline\">2!</td></tr>\n</table></td>\r\n
11
- \ <td>+</td>\r\n <td><table class=\"frac\">\n<tr><td>1</td></tr>\n<tr><td class=\"overline\">3!</td></tr>\n</table></td>\r\n
12
- \ <td>+ ... = e <img src=\"images/symbol_minus.gif\" width=\"9\" height=\"3\"
13
- alt=\"−\" border=\"0\" style=\"vertical-align:middle;\"> 1 </td>\r\n</tr></table>\n<table
14
- class=\"formula\"><tr>\n<td>\n<var>a</var>(1) = </td>\r\n <td><table class=\"frac\">\n<tr><td>e
15
- <img src=\"images/symbol_minus.gif\" width=\"9\" height=\"3\" alt=\"−\" border=\"0\"
16
- style=\"vertical-align:middle;\"> 1</td></tr>\n<tr><td class=\"overline\">1!</td></tr>\n</table></td>\r\n
17
- \ <td>+</td>\r\n <td><table class=\"frac\">\n<tr><td>1</td></tr>\n<tr><td class=\"overline\">2!</td></tr>\n</table></td>\r\n
18
- \ <td>+</td>\r\n <td><table class=\"frac\">\n<tr><td>1</td></tr>\n<tr><td class=\"overline\">3!</td></tr>\n</table></td>\r\n
19
- \ <td>+ ... = 2e <img src=\"images/symbol_minus.gif\" width=\"9\" height=\"3\"
20
- alt=\"−\" border=\"0\" style=\"vertical-align:middle;\"> 3 </td>\r\n</tr></table>\n<table
21
- class=\"formula\"><tr>\n<td>\n<var>a</var>(2) = </td>\r\n <td><table class=\"frac\">\n<tr><td>2e
22
- <img src=\"images/symbol_minus.gif\" width=\"9\" height=\"3\" alt=\"−\" border=\"0\"
23
- style=\"vertical-align:middle;\"> 3</td></tr>\n<tr><td class=\"overline\">1!</td></tr>\n</table></td>\r\n
24
- \ <td>+</td>\r\n <td><table class=\"frac\">\n<tr><td>e <img src=\"images/symbol_minus.gif\"
25
- width=\"9\" height=\"3\" alt=\"−\" border=\"0\" style=\"vertical-align:middle;\">
26
- 1</td></tr>\n<tr><td class=\"overline\">2!</td></tr>\n</table></td>\r\n <td>+</td>\r\n
27
- \ <td><table class=\"frac\">\n<tr><td>1</td></tr>\n<tr><td class=\"overline\">3!</td></tr>\n</table></td>\r\n
28
- \ <td>+ ... =</td>\r\n <td><table class=\"frac\">\n<tr><td>7</td></tr>\n<tr><td
29
- class=\"overline\">2</td></tr>\n</table></td>\r\n <td>e <img src=\"images/symbol_minus.gif\"
30
- width=\"9\" height=\"3\" alt=\"−\" border=\"0\" style=\"vertical-align:middle;\">
31
- 6 </td>\r\n</tr></table>\r\nwith e = 2.7182818... being Euler's constant.\r\n\r\n<p>\r\n</p>\n<table
32
- class=\"formula\"><tr>\n<td>It can be shown that <var>a</var>(<var>n</var>) is of
33
- the form \r\n </td>\r\n <td><table class=\"frac\">\n<tr><td>A(<var>n</var>)
34
- e + B(<var>n</var>)</td></tr>\n<tr><td class=\"overline\">\n<var>n</var>!</td></tr>\n</table></td>\r\n
35
- \ <td>for integers A(<var>n</var>) and B(<var>n</var>). \r\n </td>\r\n</tr></table>\n<table
36
- class=\"formula\"><tr>\n<td>For example <var>a</var>(10) = \r\n </td>\r\n <td><table
37
- class=\"frac\">\n<tr><td>328161643 e <img src=\"images/symbol_minus.gif\" width=\"9\"
38
- height=\"3\" alt=\"−\" border=\"0\" style=\"vertical-align:middle;\"> 652694486</td></tr>\n<tr><td
39
- class=\"overline\">10!</td></tr>\n</table></td>\r\n <td>.</td>\r\n</tr></table>\n<p>\r\nFind
40
- A(10<sup>9</sup>) + B(10<sup>9</sup>) and give your answer mod 77 777 777.\r\n</p>\r\n\r\n\r\n\r\n"
5
+ :content: "\rAn infinite sequence of real numbers <var>a</var>(<var>n</var>) is defined
6
+ for all integers <var>n</var> as follows:\r\n ![](/home/will/src/euler-manager/config/../data/images/p_330_formula.gif)\n\nFor
7
+ example,\n\n| <var>a</var>(0) = | \n\n| 1 |\n| 1! |\n\n | + | \n\n| 1 |\n| 2! |\n\n
8
+ | + | \n\n| 1 |\n| 3! |\n\n | + ... = e ![−](/home/will/src/euler-manager/config/../data/images/symbol_minus.gif)
9
+ 1 |\n\n| <var>a</var>(1) = | \n\n| e ![−](/home/will/src/euler-manager/config/../data/images/symbol_minus.gif)
10
+ 1 |\n| 1! |\n\n | + | \n\n| 1 |\n| 2! |\n\n | + | \n\n| 1 |\n| 3! |\n\n | + ...
11
+ = 2e ![−](/home/will/src/euler-manager/config/../data/images/symbol_minus.gif) 3
12
+ |\n\n| <var>a</var>(2) = | \n\n| 2e ![−](/home/will/src/euler-manager/config/../data/images/symbol_minus.gif)
13
+ 3 |\n| 1! |\n\n | + | \n\n| e ![−](/home/will/src/euler-manager/config/../data/images/symbol_minus.gif)
14
+ 1 |\n| 2! |\n\n | + | \n\n| 1 |\n| 3! |\n\n | + ... = | \n\n| 7 |\n| 2 |\n\n | e
15
+ ![−](/home/will/src/euler-manager/config/../data/images/symbol_minus.gif) 6 |\n\n\rwith
16
+ e = 2.7182818... being Euler's constant.\r\r\n\n| It can be shown that <var>a</var>(<var>n</var>)
17
+ is of the form \r | \n\n| A(<var>n</var>) e + B(<var>n</var>) |\n| <var>n</var>!
18
+ |\n\n | for integers A(<var>n</var>) and B(<var>n</var>). \r |\n\n| For example
19
+ <var>a</var>(10) = \r | \n\n| 328161643 e ![−](/home/will/src/euler-manager/config/../data/images/symbol_minus.gif)
20
+ 652694486 |\n| 10! |\n\n | . |\n\nFind A(10<sup>9</sup>) + B(10<sup>9</sup>) and
21
+ give your answer mod 77 777 777.\n\n"
@@ -2,27 +2,21 @@
2
2
  :id: 331
3
3
  :name: Cross flips
4
4
  :url: http://projecteuler.net/problem=331
5
- :content: "\r\n<p><var>N</var><img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\"
6
- alt=\"×\" border=\"0\" style=\"vertical-align:middle;\"><var>N</var> disks are placed
7
- on a square game board. Each disk has a black side and white side.</p>\r\n\r\n<p>At
5
+ :content: "<var>N</var> ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)<var>N</var>
6
+ disks are placed on a square game board. Each disk has a black side and white side.\n\nAt
8
7
  each turn, you may choose a disk and flip all the disks in the same row and the
9
- same column as this disk: thus 2<img src=\"images/symbol_times.gif\" width=\"9\"
10
- height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\"><var>N</var>-1
8
+ same column as this disk: thus 2 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)<var>N</var>-1
11
9
  disks are flipped. The game ends when all disks show their white side. The following
12
- example shows a game on a 5<img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\"
13
- alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">5 board.</p>\r\n\r\n<div
14
- align=\"center\"><img src=\"project/images/p_331_crossflips3.gif\"></div>\r\n\r\n<p>It
15
- can be proven that 3 is the minimal number of turns to finish this game.</p>\r\n\r\n<p>The
16
- bottom left disk on the <var>N</var><img src=\"images/symbol_times.gif\" width=\"9\"
17
- height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\"><var>N</var>
18
- board has coordinates (0,0);<br>\r\nthe bottom right disk has coordinates (<var>N</var>-1,0)
19
- and the top left disk has coordinates (0,<var>N</var>-1). </p>\r\n\r\n<p>Let C<sub><var>N</var></sub>
20
- be the following configuration of a board with <var>N</var><img src=\"images/symbol_times.gif\"
21
- width=\"9\" height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\"><var>N</var>
22
- disks:<br>\r\nA disk at (<var>x</var>,<var>y</var>) satisfying <img style=\"vertical-align:middle\"
23
- src=\"project/images/p_331_crossflips1.gif\">, shows its black side; otherwise,
24
- it shows its white side. C<sub>5</sub> is shown above.</p>\r\n\r\n<p>Let T(<var>N</var>)
25
- be the minimal number of turns to finish a game starting from configuration C<sub><var>N</var></sub>
26
- or 0 if configuration C<sub><var>N</var></sub> is unsolvable.<br>\r\nWe have shown
27
- that T(5)=3. You are also given that T(10)=29 and T(1 000)=395253.</p>\r\n\r\n<p>Find
28
- <img style=\"vertical-align:middle\" src=\"project/images/p_331_crossflips2.gif\">.</p>\r\n\r\n"
10
+ example shows a game on a 5 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)5
11
+ board.\n\n ![](/home/will/src/euler-manager/config/../data/images/p_331_crossflips3.gif)\n\nIt
12
+ can be proven that 3 is the minimal number of turns to finish this game.\n\nThe
13
+ bottom left disk on the <var>N</var> ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)<var>N</var>
14
+ board has coordinates (0,0); \n\rthe bottom right disk has coordinates (<var>N</var>-1,0)
15
+ and the top left disk has coordinates (0,<var>N</var>-1).\n\nLet C<sub><var>N</var></sub>
16
+ be the following configuration of a board with <var>N</var> ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)<var>N</var>
17
+ disks: \n\rA disk at (<var>x</var>,<var>y</var>) satisfying ![](/home/will/src/euler-manager/config/../data/images/p_331_crossflips1.gif),
18
+ shows its black side; otherwise, it shows its white side. C<sub>5</sub> is shown
19
+ above.\n\nLet T(<var>N</var>) be the minimal number of turns to finish a game starting
20
+ from configuration C<sub><var>N</var></sub> or 0 if configuration C<sub><var>N</var></sub>
21
+ is unsolvable. \n\rWe have shown that T(5)=3. You are also given that T(10)=29
22
+ and T(1 000)=395253.\n\nFind ![](/home/will/src/euler-manager/config/../data/images/p_331_crossflips2.gif).\n\n"
@@ -2,15 +2,13 @@
2
2
  :id: 332
3
3
  :name: Spherical triangles
4
4
  :url: http://projecteuler.net/problem=332
5
- :content: "\r\n<p>A <b>spherical triangle</b> is a figure formed on the surface of
6
- a sphere by three <b>great circular arcs</b> intersecting pairwise in three vertices.</p>\r\n\r\n<div
7
- align=\"center\"><img src=\"project/images/p_332_spherical.jpg\"></div>\r\n\r\n\r\n<p>Let
8
- C(<var>r</var>) be the sphere with the centre (0,0,0) and radius <var>r</var>.<br>\r\nLet
5
+ :content: "A **spherical triangle** is a figure formed on the surface of a sphere
6
+ by three **great circular arcs** intersecting pairwise in three vertices.\n\n ![](/home/will/src/euler-manager/config/../data/images/p_332_spherical.jpg)\n\nLet
7
+ C(<var>r</var>) be the sphere with the centre (0,0,0) and radius <var>r</var>. \n\rLet
9
8
  Z(<var>r</var>) be the set of points on the surface of C(<var>r</var>) with integer
10
- coordinates.<br>\r\nLet T(<var>r</var>) be the set of spherical triangles with vertices
11
- in Z(<var>r</var>).\r\nDegenerate spherical triangles, formed by three points on
12
- the same great arc, are <u>not</u> included in T(<var>r</var>).<br>\r\nLet A(<var>r</var>)
13
- be the area of the smallest spherical triangle in T(<var>r</var>).</p>\r\n\r\n<p>For
14
- example A(14) is 3.294040 rounded to six decimal places.</p>\r\n\r\n<p>Find <img
15
- style=\"vertical-align:middle\" src=\"project/images/p_332_sum.gif\"> A(<var>r</var>).
16
- Give your answer rounded to six decimal places.</p>\r\n\r\n"
9
+ coordinates. \n\rLet T(<var>r</var>) be the set of spherical triangles with vertices
10
+ in Z(<var>r</var>).\rDegenerate spherical triangles, formed by three points on the
11
+ same great arc, are <u>not</u> included in T(<var>r</var>). \n\rLet A(<var>r</var>)
12
+ be the area of the smallest spherical triangle in T(<var>r</var>).\n\nFor example
13
+ A(14) is 3.294040 rounded to six decimal places.\n\nFind ![](/home/will/src/euler-manager/config/../data/images/p_332_sum.gif)
14
+ A(<var>r</var>). Give your answer rounded to six decimal places.\n\n"
@@ -2,24 +2,21 @@
2
2
  :id: 333
3
3
  :name: Special partitions
4
4
  :url: http://projecteuler.net/problem=333
5
- :content: "\r\n<p>All positive integers can be partitioned in such a way that each
6
- and every term of the partition can be expressed as 2<sup>i</sup>x3<sup>j</sup>,
7
- where i,j <img src=\"images/symbol_ge.gif\" width=\"10\" height=\"12\" alt=\"≥\"
8
- border=\"0\" style=\"vertical-align:middle;\"> 0.</p>\r\n\r\n<p>Let's consider only
9
- those such partitions where none of the terms can divide any of the other terms.\r\n<br>For
10
- example, the partition of 17 = 2 + 6 + 9 = (2<sup>1</sup>x3<sup>0</sup> + 2<sup>1</sup>x3<sup>1</sup>
11
- + 2<sup>0</sup>x3<sup>2</sup>) would not be valid since 2 can divide 6. Neither
12
- would the partition 17 = 16 + 1 = (2<sup>4</sup>x3<sup>0</sup> + 2<sup>0</sup>x3<sup>0</sup>)
13
- since 1 can divide 16. The only valid partition of 17 would be 8 + 9 = (2<sup>3</sup>x3<sup>0</sup>
14
- + 2<sup>0</sup>x3<sup>2</sup>).</p>\r\n\r\n<p>Many integers have more than one valid
15
- partition, the first being 11 having the following two partitions.\r\n<br>11 = 2
16
- + 9 = (2<sup>1</sup>x3<sup>0</sup> + 2<sup>0</sup>x3<sup>2</sup>)\r\n<br>11 = 8
17
- + 3 = (2<sup>3</sup>x3<sup>0</sup> + 2<sup>0</sup>x3<sup>1</sup>)</p>\r\n\r\n<p>Let's
5
+ :content: "All positive integers can be partitioned in such a way that each and every
6
+ term of the partition can be expressed as 2<sup>i</sup>x3<sup>j</sup>, where i,j
7
+ ![≥](/home/will/src/euler-manager/config/../data/images/symbol_ge.gif) 0.\n\nLet's
8
+ consider only those such partitions where none of the terms can divide any of the
9
+ other terms.\r \nFor example, the partition of 17 = 2 + 6 + 9 = (2<sup>1</sup>x3<sup>0</sup>
10
+ + 2<sup>1</sup>x3<sup>1</sup> + 2<sup>0</sup>x3<sup>2</sup>) would not be valid
11
+ since 2 can divide 6. Neither would the partition 17 = 16 + 1 = (2<sup>4</sup>x3<sup>0</sup>
12
+ + 2<sup>0</sup>x3<sup>0</sup>) since 1 can divide 16. The only valid partition of
13
+ 17 would be 8 + 9 = (2<sup>3</sup>x3<sup>0</sup> + 2<sup>0</sup>x3<sup>2</sup>).\n\nMany
14
+ integers have more than one valid partition, the first being 11 having the following
15
+ two partitions.\r \n11 = 2 + 9 = (2<sup>1</sup>x3<sup>0</sup> + 2<sup>0</sup>x3<sup>2</sup>)\r
16
+ \ \n11 = 8 + 3 = (2<sup>3</sup>x3<sup>0</sup> + 2<sup>0</sup>x3<sup>1</sup>)\n\nLet's
18
17
  define P(<var>n</var>) as the number of valid partitions of <var>n</var>. For example,
19
- P(11) = 2.</p>\r\n\r\n<p>Let's consider only the prime integers <var>q</var> which
20
- would have a single valid partition such as P(17).</p>\r\n\r\n<p>The sum of the
21
- primes <var>q</var> <img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\"
22
- alt=\"&lt;\" border=\"0\" style=\"vertical-align:middle;\">100 such that P(<var>q</var>)=1
23
- equals 233.</p>\r\n\r\n<p>Find the sum of the primes <var>q</var> <img src=\"images/symbol_lt.gif\"
24
- width=\"10\" height=\"10\" alt=\"&lt;\" border=\"0\" style=\"vertical-align:middle;\">1000000
25
- such that P(<var>q</var>)=1.</p>\r\n"
18
+ P(11) = 2.\n\nLet's consider only the prime integers <var>q</var> which would have
19
+ a single valid partition such as P(17).\n\nThe sum of the primes <var>q</var> ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)100
20
+ such that P(<var>q</var>)=1 equals 233.\n\nFind the sum of the primes <var>q</var>
21
+ ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)1000000 such
22
+ that P(<var>q</var>)=1.\n\n"
@@ -2,38 +2,26 @@
2
2
  :id: 334
3
3
  :name: Spilling the beans
4
4
  :url: http://projecteuler.net/problem=334
5
- :content: "\r\n<p>In Plato's heaven, there exist an infinite number of bowls in a
6
- straight line.<br>\r\nEach bowl either contains some or none of a finite number
7
- of beans.<br>\r\nA child plays a game, which allows only one kind of move: removing
8
- two beans from any bowl, and putting one in each of the two adjacent bowls.<br>
9
- The game ends when each bowl contains either one or no beans.</p>\r\n\r\n<p>For
10
- example, consider two adjacent bowls containing 2 and 3 beans respectively, all
11
- other bowls being empty. The following eight moves will finish the game:</p>\r\n\r\n<div
12
- align=\"center\"><img src=\"project/images/p_334_beans.gif\"></div>\r\n\r\n<p>You
13
- are given the following sequences:<br></p>\n<table class=\"formula\" style=\"margin-left:50px;\"><tr>\n<td>\r\n
14
- \ <var>t</var><sub><i>0</i></sub> = 123456.\r\n </td>\r\n</tr></table>\n<table
15
- class=\"formula\" style=\"margin-left:50px;\">\n<tr>\n<td>\r\n <var>t</var><sub><i>i</i></sub>
16
- = \r\n </td>\r\n <td><img src=\"project/images/p_334_cases.gif\"></td>\r\n <td>\r\n
17
- \ <table class=\"formula\">\n<tr>\n<td></td>\r\n <td>\r\n <table class=\"frac\">\n<tr><td>\n<var>t</var><sub><i>i-1</i></sub>\n</td></tr>\n<tr><td
18
- class=\"overline\">2</td></tr>\n</table>\n</td>\r\n <td>\r\n ,\r\n
19
- \ </td>\r\n <td></td>\r\n <td>\r\n if <var>t</var><sub><i>i-1</i></sub>
20
- is even\r\n </td>\r\n </tr>\n<tr>\n<td><img src=\"project/images/p_334_lfloor.gif\"></td>\r\n
21
- \ <td>\r\n <table class=\"frac\">\n<tr><td>\n<var>t</var><sub><i>i-1</i></sub>\n</td></tr>\n<tr><td
22
- class=\"overline\">2</td></tr>\n</table>\n</td>\r\n <td>\r\n <img src=\"project/images/p_334_rfloor.gif\">\n</td>\r\n
23
- \ <td>\r\n 926252, \r\n </td>\r\n <td>\r\n if <var>t</var><sub><i>i-1</i></sub>
24
- is odd\r\n </td>\r\n </tr>\n</table>\n</td>\n<td>\r\n</td>\n</tr>\n<tr>\n<td></td>\r\n
25
- \ <td></td>\r\n <td>\r\n where <img src=\"images/symbol_lfloor.gif\" width=\"6\"
26
- height=\"16\" alt=\"⌊\" border=\"0\" style=\"vertical-align:middle;\"><var>x</var><img
27
- src=\"images/symbol_rfloor.gif\" width=\"6\" height=\"16\" alt=\"⌋\" border=\"0\"
28
- style=\"vertical-align:middle;\"> is the floor function\r\n </td>\r\n</tr>\n<tr>\n<td></td>\r\n
29
- \ <td></td>\r\n <td>\r\n and <img src=\"project/images/p_334_oplus.gif\">
30
- is the bitwise XOR operator.\r\n </td>\r\n</tr>\n</table>\n<table class=\"formula\"
31
- style=\"margin-left:50px;\"><tr>\n<td>\r\n <var>b</var><sub><i>i</i></sub>
32
- = ( <var>t</var><sub><i>i</i></sub> mod 2<sup>11</sup>) + 1.\r\n </td>\r\n</tr></table>\n<p>The
33
- first two terms of the last sequence are <var>b</var><sub><i>1</i></sub> = 289 and
34
- <var>b</var><sub><i>2</i></sub> = 145.<br>\r\nIf we start with <var>b</var><sub><i>1</i></sub>
5
+ :content: "In Plato's heaven, there exist an infinite number of bowls in a straight
6
+ line. \n\rEach bowl either contains some or none of a finite number of beans. \n\rA
7
+ child plays a game, which allows only one kind of move: removing two beans from
8
+ any bowl, and putting one in each of the two adjacent bowls. \n The game ends when
9
+ each bowl contains either one or no beans.\n\nFor example, consider two adjacent
10
+ bowls containing 2 and 3 beans respectively, all other bowls being empty. The following
11
+ eight moves will finish the game:\n\n ![](/home/will/src/euler-manager/config/../data/images/p_334_beans.gif)\n\nYou
12
+ are given the following sequences:\n\n| <var>t</var><sub><i>0</i></sub> = 123456.\r
13
+ |\n\n| <var>t</var><sub><i>i</i></sub> = \r | ![](/home/will/src/euler-manager/config/../data/images/p_334_cases.gif)
14
+ | \n\n| | \n\n| <var>t</var><sub><i>i-1</i></sub> |\n| 2 |\n\n | \r ,\r | | \r if
15
+ <var>t</var><sub><i>i-1</i></sub> is even\r |\n| ![](/home/will/src/euler-manager/config/../data/images/p_334_lfloor.gif)
16
+ | \n\n| <var>t</var><sub><i>i-1</i></sub> |\n| 2 |\n\n | ![](/home/will/src/euler-manager/config/../data/images/p_334_rfloor.gif)
17
+ | \r 926252, \r | \r if <var>t</var><sub><i>i-1</i></sub> is odd\r |\n\n | |\n|
18
+ | | \r where ![⌊](/home/will/src/euler-manager/config/../data/images/symbol_lfloor.gif)<var>x</var>
19
+ ![⌋](/home/will/src/euler-manager/config/../data/images/symbol_rfloor.gif) is the
20
+ floor function\r |\n| | | \r and ![](/home/will/src/euler-manager/config/../data/images/p_334_oplus.gif)
21
+ is the bitwise XOR operator.\r |\n\n| <var>b</var><sub><i>i</i></sub> = ( <var>t</var><sub><i>i</i></sub>
22
+ mod 2<sup>11</sup>) + 1.\r |\n\nThe first two terms of the last sequence are <var>b</var><sub><i>1</i></sub>
23
+ = 289 and <var>b</var><sub><i>2</i></sub> = 145. \n\rIf we start with <var>b</var><sub><i>1</i></sub>
35
24
  and <var>b</var><sub><i>2</i></sub> beans in two adjacent bowls, 3419100 moves would
36
- be required to finish the game.</p>\r\n\r\n<p>Consider now 1500 adjacent bowls containing
37
- <var>b</var><sub><i>1</i></sub>, <var>b</var><sub><i>2</i></sub>,..., <var>b</var><sub><i>1500</i></sub>
38
- beans respectively, all other bowls being empty. Find how many moves it takes before
39
- the game ends.</p>\r\n\r\n\r\n"
25
+ be required to finish the game.\n\nConsider now 1500 adjacent bowls containing <var>b</var><sub><i>1</i></sub>,
26
+ <var>b</var><sub><i>2</i></sub>,..., <var>b</var><sub><i>1500</i></sub> beans respectively,
27
+ all other bowls being empty. Find how many moves it takes before the game ends.\n\n"
@@ -2,15 +2,14 @@
2
2
  :id: 335
3
3
  :name: Gathering the beans
4
4
  :url: http://projecteuler.net/problem=335
5
- :content: "\r\n<p>Whenever Peter feels bored, he places some bowls, containing one
6
- bean each, in a circle. After this, he takes all the beans out of a certain bowl
7
- and drops them one by one in the bowls going clockwise. He repeats this, starting
8
- from the bowl he dropped the last bean in, until the initial situation appears again.
9
- For example with 5 bowls he acts as follows:</p>\r\n\r\n<div align=\"center\"><img
10
- src=\"project/images/p_335_mancala.gif\"></div>\r\n\r\n<p>So with 5 bowls it takes
11
- Peter 15 moves to return to the initial situation.</p>\r\n\r\n<p>Let <var>M</var>(<var>x</var>)
12
- represent the number of moves required to return to the initial situation, starting
13
- with <var>x</var> bowls. Thus, <var>M</var>(5) = 15. It can also be verified that
14
- <var>M</var>(100) = 10920.</p>\r\n\r\n<p>Find <img style=\"vertical-align:middle\"
15
- src=\"project/images/p_335_sum.gif\"><var>M</var>(2<sup><var>k</var></sup>+1). Give
16
- your answer modulo 7<sup>9</sup>.</p>\r\n\r\n\r\n"
5
+ :content: |+
6
+ Whenever Peter feels bored, he places some bowls, containing one bean each, in a circle. After this, he takes all the beans out of a certain bowl and drops them one by one in the bowls going clockwise. He repeats this, starting from the bowl he dropped the last bean in, until the initial situation appears again. For example with 5 bowls he acts as follows:
7
+
8
+ ![](/home/will/src/euler-manager/config/../data/images/p_335_mancala.gif)
9
+
10
+ So with 5 bowls it takes Peter 15 moves to return to the initial situation.
11
+
12
+ Let <var>M</var>(<var>x</var>) represent the number of moves required to return to the initial situation, starting with <var>x</var> bowls. Thus, <var>M</var>(5) = 15. It can also be verified that <var>M</var>(100) = 10920.
13
+
14
+ Find ![](/home/will/src/euler-manager/config/../data/images/p_335_sum.gif)<var>M</var>(2<sup><var>k</var></sup>+1). Give your answer modulo 7<sup>9</sup>.
15
+
@@ -2,23 +2,21 @@
2
2
  :id: 336
3
3
  :name: Maximix Arrangements
4
4
  :url: http://projecteuler.net/problem=336
5
- :content: "\r\n<p>A train is used to transport four carriages in the order: ABCD.
6
- However, sometimes when the train arrives to collect the carriages they are not
7
- in the correct order. <br>\r\nTo rearrange the carriages they are all shunted on
8
- to a large rotating turntable. After the carriages are uncoupled at a specific point
9
- the train moves off the turntable pulling the carriages still attached with it.
10
- The remaining carriages are rotated 180 degrees. All of the carriages are then rejoined
11
- and this process is repeated as often as necessary in order to obtain the least
12
- number of uses of the turntable.<br>\r\nSome arrangements, such as ADCB, can be
13
- solved easily: the carriages are separated between A and D, and after DCB are rotated
14
- the correct order has been achieved.</p>\r\n\r\n<p>However, Simple Simon, the train
15
- driver, is not known for his efficiency, so he always solves the problem by initially
16
- getting carriage A in the correct place, then carriage B, and so on.</p>\r\n\r\n<p>Using
17
- four carriages, the worst possible arrangements for Simon, which we shall call <i>maximix
18
- arrangements</i>, are DACB and DBAC; each requiring him five rotations (although,
19
- using the most efficient approach, they could be solved using just three rotations).
20
- The process he uses for DACB is shown below.</p>\r\n\r\n<div align=\"center\"><img
21
- src=\"project/images/p_336_maximix.gif\"></div>\r\n\r\n\r\n<p>It can be verified
22
- that there are 24 maximix arrangements for six carriages, of which the tenth lexicographic
23
- maximix arrangement is DFAECB.</p>\r\n\r\n<p>Find the 2011<sup>th</sup> lexicographic
24
- maximix arrangement for eleven carriages.</p>\r\n\r\n"
5
+ :content: "A train is used to transport four carriages in the order: ABCD. However,
6
+ sometimes when the train arrives to collect the carriages they are not in the correct
7
+ order. \n\rTo rearrange the carriages they are all shunted on to a large rotating
8
+ turntable. After the carriages are uncoupled at a specific point the train moves
9
+ off the turntable pulling the carriages still attached with it. The remaining carriages
10
+ are rotated 180 degrees. All of the carriages are then rejoined and this process
11
+ is repeated as often as necessary in order to obtain the least number of uses of
12
+ the turntable. \n\rSome arrangements, such as ADCB, can be solved easily: the carriages
13
+ are separated between A and D, and after DCB are rotated the correct order has been
14
+ achieved.\n\nHowever, Simple Simon, the train driver, is not known for his efficiency,
15
+ so he always solves the problem by initially getting carriage A in the correct place,
16
+ then carriage B, and so on.\n\nUsing four carriages, the worst possible arrangements
17
+ for Simon, which we shall call _maximix arrangements_, are DACB and DBAC; each requiring
18
+ him five rotations (although, using the most efficient approach, they could be solved
19
+ using just three rotations). The process he uses for DACB is shown below.\n\n ![](/home/will/src/euler-manager/config/../data/images/p_336_maximix.gif)\n\nIt
20
+ can be verified that there are 24 maximix arrangements for six carriages, of which
21
+ the tenth lexicographic maximix arrangement is DFAECB.\n\nFind the 2011<sup>th</sup>
22
+ lexicographic maximix arrangement for eleven carriages.\n\n"
@@ -2,14 +2,12 @@
2
2
  :id: 337
3
3
  :name: Totient Stairstep Sequences
4
4
  :url: http://projecteuler.net/problem=337
5
- :content: "\r\n<p>Let {a<sub>1</sub>, a<sub>2</sub>,..., a<sub><var>n</var></sub>}
6
- be an integer sequence of length <var>n</var> such that:</p>\r\n<ul>\n<li>a<sub>1</sub>
7
- = 6</li>\r\n<li>for all 1 <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\"
8
- alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>i</var> n : φ(a<sub><var>i</var></sub>)
9
- <var>i</var>+1) <var>i</var> <var>i</var>+1 <sup>1</sup>\n</li>\r\n</ul>\n<p>Let
10
- S(<var>N</var>) be the number of such sequences with a<sub><var>n</var></sub><img
11
- src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>N</var>.<br>\r\nFor
12
- example, S(10) = 4: {6}, {6, 8}, {6, 8, 9} and {6, 10}.<br>\r\nWe can verify that
13
- S(100) = 482073668 and S(10 000) mod 10<sup>8</sup> = 73808307.</p>\r\n\r\n<p>Find
14
- S(20 000 000) mod 10<sup>8</sup>.</p>\r\n\r\n<p><sup>1</sup> φ denotes <b>Euler's
15
- totient function</b>.</p>\r\n\r\n"
5
+ :content: "Let {a<sub>1</sub>, a<sub>2</sub>,..., a<sub><var>n</var></sub>} be an
6
+ integer sequence of length <var>n</var> such that:\n\n- a<sub>1</sub> = 6\n- for
7
+ all 1 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) <var>i</var>
8
+ n : φ(a<sub><var>i</var></sub>) <var>i</var>+1) <var>i</var> <var>i</var>+1 <sup>1</sup>\n\nLet
9
+ S(<var>N</var>) be the number of such sequences with a<sub><var>n</var></sub> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
10
+ <var>N</var>. \n\rFor example, S(10) = 4: {6}, {6, 8}, {6, 8, 9} and {6, 10}. \n\rWe
11
+ can verify that S(100) = 482073668 and S(10 000) mod 10<sup>8</sup> = 73808307.\n\nFind
12
+ S(20 000 000) mod 10<sup>8</sup>.\n\n<sup>1</sup> φ denotes **Euler's totient function**
13
+ .\n\n"