euler-manager 0.0.6 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (303) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -0
  3. data/data/images/sod_13.gif +4 -0
  4. data/data/problems/100.yml +1 -1
  5. data/data/problems/101.yml +16 -16
  6. data/data/problems/102.yml +2 -3
  7. data/data/problems/103.yml +16 -16
  8. data/data/problems/105.yml +2 -2
  9. data/data/problems/106.yml +2 -2
  10. data/data/problems/107.yml +15 -15
  11. data/data/problems/108.yml +13 -16
  12. data/data/problems/109.yml +16 -17
  13. data/data/problems/11.yml +22 -23
  14. data/data/problems/110.yml +9 -10
  15. data/data/problems/114.yml +30 -41
  16. data/data/problems/116.yml +19 -25
  17. data/data/problems/117.yml +24 -33
  18. data/data/problems/120.yml +3 -3
  19. data/data/problems/122.yml +18 -20
  20. data/data/problems/123.yml +2 -2
  21. data/data/problems/124.yml +18 -23
  22. data/data/problems/126.yml +10 -11
  23. data/data/problems/127.yml +7 -7
  24. data/data/problems/128.yml +1 -1
  25. data/data/problems/130.yml +6 -7
  26. data/data/problems/131.yml +1 -1
  27. data/data/problems/132.yml +1 -1
  28. data/data/problems/134.yml +2 -2
  29. data/data/problems/135.yml +2 -2
  30. data/data/problems/136.yml +2 -2
  31. data/data/problems/137.yml +4 -4
  32. data/data/problems/138.yml +4 -4
  33. data/data/problems/139.yml +1 -1
  34. data/data/problems/14.yml +12 -13
  35. data/data/problems/140.yml +3 -3
  36. data/data/problems/142.yml +1 -1
  37. data/data/problems/143.yml +2 -2
  38. data/data/problems/144.yml +3 -3
  39. data/data/problems/147.yml +1 -1
  40. data/data/problems/149.yml +11 -13
  41. data/data/problems/15.yml +3 -3
  42. data/data/problems/150.yml +8 -8
  43. data/data/problems/151.yml +1 -1
  44. data/data/problems/152.yml +1 -1
  45. data/data/problems/153.yml +24 -26
  46. data/data/problems/154.yml +10 -9
  47. data/data/problems/155.yml +3 -3
  48. data/data/problems/156.yml +7 -8
  49. data/data/problems/157.yml +3 -4
  50. data/data/problems/158.yml +4 -5
  51. data/data/problems/159.yml +3 -3
  52. data/data/problems/161.yml +5 -4
  53. data/data/problems/163.yml +10 -10
  54. data/data/problems/165.yml +1 -1
  55. data/data/problems/166.yml +7 -7
  56. data/data/problems/167.yml +3 -4
  57. data/data/problems/168.yml +5 -5
  58. data/data/problems/170.yml +2 -2
  59. data/data/problems/171.yml +3 -3
  60. data/data/problems/173.yml +1 -1
  61. data/data/problems/174.yml +3 -3
  62. data/data/problems/175.yml +4 -4
  63. data/data/problems/177.yml +1 -1
  64. data/data/problems/179.yml +1 -1
  65. data/data/problems/180.yml +8 -9
  66. data/data/problems/182.yml +22 -24
  67. data/data/problems/183.yml +14 -15
  68. data/data/problems/184.yml +2 -2
  69. data/data/problems/186.yml +10 -11
  70. data/data/problems/187.yml +6 -8
  71. data/data/problems/189.yml +10 -9
  72. data/data/problems/190.yml +1 -1
  73. data/data/problems/192.yml +11 -12
  74. data/data/problems/194.yml +8 -8
  75. data/data/problems/195.yml +2 -2
  76. data/data/problems/197.yml +5 -6
  77. data/data/problems/198.yml +11 -12
  78. data/data/problems/199.yml +7 -7
  79. data/data/problems/20.yml +8 -10
  80. data/data/problems/202.yml +1 -1
  81. data/data/problems/207.yml +4 -4
  82. data/data/problems/208.yml +4 -5
  83. data/data/problems/21.yml +5 -6
  84. data/data/problems/210.yml +4 -5
  85. data/data/problems/211.yml +1 -1
  86. data/data/problems/212.yml +22 -26
  87. data/data/problems/213.yml +5 -6
  88. data/data/problems/214.yml +8 -9
  89. data/data/problems/215.yml +4 -4
  90. data/data/problems/216.yml +5 -5
  91. data/data/problems/217.yml +8 -10
  92. data/data/problems/218.yml +1 -1
  93. data/data/problems/22.yml +1 -1
  94. data/data/problems/220.yml +15 -15
  95. data/data/problems/221.yml +4 -5
  96. data/data/problems/223.yml +5 -6
  97. data/data/problems/224.yml +5 -6
  98. data/data/problems/226.yml +8 -8
  99. data/data/problems/228.yml +4 -5
  100. data/data/problems/229.yml +16 -16
  101. data/data/problems/230.yml +4 -4
  102. data/data/problems/231.yml +4 -5
  103. data/data/problems/233.yml +1 -1
  104. data/data/problems/234.yml +9 -10
  105. data/data/problems/236.yml +4 -4
  106. data/data/problems/237.yml +3 -3
  107. data/data/problems/238.yml +3 -4
  108. data/data/problems/241.yml +4 -4
  109. data/data/problems/242.yml +2 -2
  110. data/data/problems/243.yml +12 -12
  111. data/data/problems/244.yml +10 -11
  112. data/data/problems/245.yml +14 -15
  113. data/data/problems/246.yml +10 -9
  114. data/data/problems/247.yml +12 -13
  115. data/data/problems/251.yml +3 -3
  116. data/data/problems/252.yml +6 -7
  117. data/data/problems/254.yml +2 -2
  118. data/data/problems/255.yml +35 -36
  119. data/data/problems/256.yml +16 -20
  120. data/data/problems/257.yml +9 -9
  121. data/data/problems/258.yml +5 -6
  122. data/data/problems/26.yml +1 -1
  123. data/data/problems/260.yml +6 -8
  124. data/data/problems/261.yml +6 -7
  125. data/data/problems/262.yml +1 -1
  126. data/data/problems/264.yml +10 -11
  127. data/data/problems/265.yml +1 -1
  128. data/data/problems/27.yml +10 -11
  129. data/data/problems/270.yml +3 -3
  130. data/data/problems/271.yml +5 -6
  131. data/data/problems/272.yml +6 -7
  132. data/data/problems/273.yml +3 -3
  133. data/data/problems/274.yml +15 -15
  134. data/data/problems/275.yml +3 -3
  135. data/data/problems/276.yml +3 -3
  136. data/data/problems/277.yml +3 -3
  137. data/data/problems/278.yml +15 -17
  138. data/data/problems/281.yml +4 -4
  139. data/data/problems/282.yml +2 -2
  140. data/data/problems/284.yml +7 -8
  141. data/data/problems/287.yml +18 -17
  142. data/data/problems/288.yml +1 -1
  143. data/data/problems/289.yml +1 -1
  144. data/data/problems/29.yml +12 -13
  145. data/data/problems/290.yml +1 -1
  146. data/data/problems/291.yml +3 -3
  147. data/data/problems/292.yml +1 -1
  148. data/data/problems/293.yml +7 -7
  149. data/data/problems/295.yml +8 -8
  150. data/data/problems/296.yml +4 -5
  151. data/data/problems/297.yml +4 -5
  152. data/data/problems/299.yml +11 -12
  153. data/data/problems/300.yml +10 -9
  154. data/data/problems/301.yml +2 -2
  155. data/data/problems/303.yml +3 -3
  156. data/data/problems/304.yml +6 -7
  157. data/data/problems/305.yml +3 -2
  158. data/data/problems/306.yml +8 -11
  159. data/data/problems/307.yml +2 -3
  160. data/data/problems/309.yml +8 -8
  161. data/data/problems/31.yml +1 -1
  162. data/data/problems/310.yml +6 -7
  163. data/data/problems/311.yml +11 -11
  164. data/data/problems/312.yml +5 -5
  165. data/data/problems/313.yml +4 -4
  166. data/data/problems/314.yml +4 -5
  167. data/data/problems/315.yml +26 -27
  168. data/data/problems/316.yml +2 -4
  169. data/data/problems/318.yml +27 -34
  170. data/data/problems/319.yml +11 -12
  171. data/data/problems/32.yml +1 -1
  172. data/data/problems/320.yml +1 -1
  173. data/data/problems/321.yml +3 -3
  174. data/data/problems/322.yml +4 -4
  175. data/data/problems/323.yml +7 -8
  176. data/data/problems/324.yml +8 -9
  177. data/data/problems/325.yml +1 -1
  178. data/data/problems/326.yml +2 -2
  179. data/data/problems/327.yml +27 -29
  180. data/data/problems/328.yml +2 -2
  181. data/data/problems/330.yml +13 -14
  182. data/data/problems/331.yml +12 -12
  183. data/data/problems/332.yml +10 -9
  184. data/data/problems/333.yml +15 -16
  185. data/data/problems/334.yml +14 -14
  186. data/data/problems/335.yml +2 -2
  187. data/data/problems/336.yml +5 -4
  188. data/data/problems/337.yml +7 -7
  189. data/data/problems/338.yml +21 -24
  190. data/data/problems/340.yml +6 -7
  191. data/data/problems/341.yml +3 -5
  192. data/data/problems/342.yml +6 -7
  193. data/data/problems/343.yml +8 -12
  194. data/data/problems/344.yml +1 -1
  195. data/data/problems/347.yml +8 -8
  196. data/data/problems/350.yml +5 -5
  197. data/data/problems/351.yml +1 -1
  198. data/data/problems/352.yml +25 -26
  199. data/data/problems/353.yml +1 -1
  200. data/data/problems/354.yml +6 -6
  201. data/data/problems/356.yml +2 -3
  202. data/data/problems/358.yml +13 -14
  203. data/data/problems/359.yml +1 -1
  204. data/data/problems/361.yml +2 -1
  205. data/data/problems/362.yml +11 -13
  206. data/data/problems/363.yml +6 -6
  207. data/data/problems/364.yml +3 -3
  208. data/data/problems/365.yml +2 -2
  209. data/data/problems/366.yml +4 -5
  210. data/data/problems/369.yml +1 -1
  211. data/data/problems/370.yml +3 -3
  212. data/data/problems/372.yml +6 -8
  213. data/data/problems/374.yml +5 -7
  214. data/data/problems/375.yml +5 -6
  215. data/data/problems/377.yml +2 -2
  216. data/data/problems/378.yml +2 -2
  217. data/data/problems/379.yml +7 -8
  218. data/data/problems/38.yml +9 -9
  219. data/data/problems/380.yml +12 -15
  220. data/data/problems/381.yml +8 -11
  221. data/data/problems/382.yml +6 -6
  222. data/data/problems/383.yml +4 -4
  223. data/data/problems/384.yml +7 -8
  224. data/data/problems/385.yml +8 -8
  225. data/data/problems/386.yml +2 -2
  226. data/data/problems/388.yml +5 -6
  227. data/data/problems/39.yml +1 -1
  228. data/data/problems/390.yml +4 -6
  229. data/data/problems/391.yml +11 -12
  230. data/data/problems/392.yml +1 -1
  231. data/data/problems/393.yml +2 -2
  232. data/data/problems/394.yml +6 -7
  233. data/data/problems/395.yml +5 -5
  234. data/data/problems/396.yml +15 -17
  235. data/data/problems/397.yml +5 -8
  236. data/data/problems/4.yml +1 -1
  237. data/data/problems/40.yml +1 -1
  238. data/data/problems/400.yml +5 -6
  239. data/data/problems/401.yml +2 -2
  240. data/data/problems/402.yml +7 -8
  241. data/data/problems/403.yml +9 -10
  242. data/data/problems/404.yml +5 -6
  243. data/data/problems/405.yml +7 -7
  244. data/data/problems/406.yml +8 -10
  245. data/data/problems/407.yml +9 -9
  246. data/data/problems/410.yml +5 -6
  247. data/data/problems/411.yml +11 -12
  248. data/data/problems/412.yml +9 -9
  249. data/data/problems/414.yml +13 -15
  250. data/data/problems/415.yml +2 -2
  251. data/data/problems/417.yml +4 -5
  252. data/data/problems/418.yml +7 -8
  253. data/data/problems/419.yml +8 -8
  254. data/data/problems/420.yml +5 -5
  255. data/data/problems/421.yml +11 -12
  256. data/data/problems/422.yml +9 -9
  257. data/data/problems/423.yml +5 -7
  258. data/data/problems/424.yml +8 -9
  259. data/data/problems/425.yml +2 -3
  260. data/data/problems/426.yml +3 -3
  261. data/data/problems/427.yml +8 -8
  262. data/data/problems/428.yml +16 -19
  263. data/data/problems/430.yml +4 -5
  264. data/data/problems/44.yml +3 -3
  265. data/data/problems/45.yml +2 -2
  266. data/data/problems/46.yml +8 -8
  267. data/data/problems/47.yml +6 -10
  268. data/data/problems/53.yml +8 -9
  269. data/data/problems/56.yml +1 -1
  270. data/data/problems/57.yml +5 -5
  271. data/data/problems/58.yml +1 -1
  272. data/data/problems/6.yml +1 -1
  273. data/data/problems/61.yml +4 -4
  274. data/data/problems/64.yml +39 -46
  275. data/data/problems/65.yml +13 -14
  276. data/data/problems/66.yml +10 -10
  277. data/data/problems/68.yml +4 -5
  278. data/data/problems/69.yml +2 -2
  279. data/data/problems/70.yml +3 -4
  280. data/data/problems/71.yml +3 -3
  281. data/data/problems/72.yml +3 -3
  282. data/data/problems/73.yml +3 -3
  283. data/data/problems/74.yml +15 -22
  284. data/data/problems/75.yml +1 -1
  285. data/data/problems/8.yml +14 -14
  286. data/data/problems/81.yml +7 -7
  287. data/data/problems/82.yml +4 -4
  288. data/data/problems/83.yml +4 -4
  289. data/data/problems/85.yml +1 -1
  290. data/data/problems/86.yml +8 -8
  291. data/data/problems/88.yml +22 -27
  292. data/data/problems/9.yml +6 -6
  293. data/data/problems/90.yml +13 -13
  294. data/data/problems/91.yml +8 -8
  295. data/data/problems/92.yml +7 -9
  296. data/data/problems/93.yml +9 -10
  297. data/data/problems/95.yml +1 -1
  298. data/data/problems/96.yml +17 -17
  299. data/data/problems/97.yml +2 -2
  300. data/data/problems/99.yml +2 -2
  301. data/lib/euler/problem.rb +6 -1
  302. data/lib/euler/version.rb +1 -1
  303. metadata +2 -2
@@ -5,11 +5,11 @@
5
5
  :content: |+
6
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
7
 
8
- ![](/home/will/src/euler-manager/config/../data/images/p_335_mancala.gif)
8
+ ![]({{ images_dir }}/p_335_mancala.gif)
9
9
 
10
10
  So with 5 bowls it takes Peter 15 moves to return to the initial situation.
11
11
 
12
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
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>.
14
+ Find ![]({{ images_dir }}/p_335_sum.gif)<var>M</var>(2<sup><var>k</var></sup>+1). Give your answer modulo 7<sup>9</sup>.
15
15
 
@@ -16,7 +16,8 @@
16
16
  then carriage B, and so on.\n\nUsing four carriages, the worst possible arrangements
17
17
  for Simon, which we shall call _maximix arrangements_, are DACB and DBAC; each requiring
18
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"
19
+ using just three rotations). The process he uses for DACB is shown below.\n\n ![]({{
20
+ images_dir }}/p_336_maximix.gif)\n\nIt can be verified that there are 24 maximix
21
+ arrangements for six carriages, of which the tenth lexicographic maximix arrangement
22
+ is DFAECB.\n\nFind the 2011<sup>th</sup> lexicographic maximix arrangement for eleven
23
+ carriages.\n\n"
@@ -4,10 +4,10 @@
4
4
  :url: http://projecteuler.net/problem=337
5
5
  :content: "Let {a<sub>1</sub>, a<sub>2</sub>,..., a<sub><var>n</var></sub>} be an
6
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"
7
+ all 1 ![≤]({{ images_dir }}/symbol_le.gif) <var>i</var> n : φ(a<sub><var>i</var></sub>)
8
+ <var>i</var>+1) <var>i</var> <var>i</var>+1 <sup>1</sup>\n\nLet S(<var>N</var>)
9
+ be the number of such sequences with a<sub><var>n</var></sub> ![≤]({{ images_dir
10
+ }}/symbol_le.gif) <var>N</var>. \n\rFor example, S(10) = 4: {6}, {6, 8}, {6, 8,
11
+ 9} and {6, 10}. \n\rWe can verify that S(100) = 482073668 and S(10 000) mod 10<sup>8</sup>
12
+ = 73808307.\n\nFind S(20 000 000) mod 10<sup>8</sup>.\n\n<sup>1</sup> φ denotes
13
+ **Euler's totient function** .\n\n"
@@ -3,29 +3,26 @@
3
3
  :name: Cutting Rectangular Grid Paper
4
4
  :url: http://projecteuler.net/problem=338
5
5
  :content: "A rectangular sheet of grid paper with integer dimensions <var>w</var>
6
- ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif) <var>h</var>
7
- is given. Its grid spacing is 1. \n\rWhen we cut the sheet along the grid lines
8
- into two pieces and rearrange those pieces without overlap, we can make new rectangles
9
- with different dimensions.\n\nFor example, from a sheet with dimensions 9 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
10
- 4 , we can make rectangles with dimensions 18 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
11
- 2, 12 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
12
- 3 and 6 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
13
- 6 by cutting and rearranging as below:\n\n ![](/home/will/src/euler-manager/config/../data/images/p_338_gridpaper.gif)
14
- \ \n\nSimilarly, from a sheet with dimensions 9 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
15
- 8 , we can make rectangles with dimensions 18 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
16
- 4 and 12 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
17
- 6 .\n\nFor a pair <var>w</var> and <var>h</var>, let F(<var>w</var>,<var>h</var>)
18
- be the number of distinct rectangles that can be made from a sheet with dimensions
19
- <var>w</var> ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
6
+ ![×]({{ images_dir }}/symbol_times.gif) <var>h</var> is given. Its grid spacing
7
+ is 1. \n\rWhen we cut the sheet along the grid lines into two pieces and rearrange
8
+ those pieces without overlap, we can make new rectangles with different dimensions.\n\nFor
9
+ example, from a sheet with dimensions 9 ![×]({{ images_dir }}/symbol_times.gif)
10
+ 4 , we can make rectangles with dimensions 18 ![×]({{ images_dir }}/symbol_times.gif)
11
+ 2, 12 ![×]({{ images_dir }}/symbol_times.gif) 3 and 6 ![×]({{ images_dir }}/symbol_times.gif)
12
+ 6 by cutting and rearranging as below:\n\n ![]({{ images_dir }}/p_338_gridpaper.gif)
13
+ \ \n\nSimilarly, from a sheet with dimensions 9 ![×]({{ images_dir }}/symbol_times.gif)
14
+ 8 , we can make rectangles with dimensions 18 ![×]({{ images_dir }}/symbol_times.gif)
15
+ 4 and 12 ![×]({{ images_dir }}/symbol_times.gif) 6 .\n\nFor a pair <var>w</var>
16
+ and <var>h</var>, let F(<var>w</var>,<var>h</var>) be the number of distinct rectangles
17
+ that can be made from a sheet with dimensions <var>w</var> ![×]({{ images_dir }}/symbol_times.gif)
20
18
  <var>h</var> . \n\rFor example, F(2,1) = 0, F(2,2) = 1, F(9,4) = 3 and F(9,8) =
21
19
  2. \n\rNote that rectangles congruent to the initial one are not counted in F(<var>w</var>,<var>h</var>).
22
- \ \n\rNote also that rectangles with dimensions <var>w</var> ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
23
- <var>h</var> and dimensions <var>h</var> ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
24
- <var>w</var> are not considered distinct.\n\nFor an integer <var>N</var>, let G(<var>N</var>)
25
- be the sum of F(<var>w</var>,<var>h</var>) for all pairs <var>w</var> and <var>h</var>
26
- which satisfy 0 ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)
27
- <var>h</var> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
28
- <var>w</var> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
29
- <var>N</var>. \n\rWe can verify that G(10) = 55, G(10<sup>3</sup>) = 971745 and
30
- G(10<sup>5</sup>) = 9992617687.\n\nFind G(10<sup>12</sup>). Give your answer modulo
31
- 10<sup>8</sup>.\n\n"
20
+ \ \n\rNote also that rectangles with dimensions <var>w</var> ![×]({{ images_dir
21
+ }}/symbol_times.gif) <var>h</var> and dimensions <var>h</var> ![×]({{ images_dir
22
+ }}/symbol_times.gif) <var>w</var> are not considered distinct.\n\nFor an integer
23
+ <var>N</var>, let G(<var>N</var>) be the sum of F(<var>w</var>,<var>h</var>) for
24
+ all pairs <var>w</var> and <var>h</var> which satisfy 0 ![<]({{ images_dir }}/symbol_lt.gif)
25
+ <var>h</var> ![≤]({{ images_dir }}/symbol_le.gif) <var>w</var> ![≤]({{ images_dir
26
+ }}/symbol_le.gif) <var>N</var>. \n\rWe can verify that G(10) = 55, G(10<sup>3</sup>)
27
+ = 971745 and G(10<sup>5</sup>) = 9992617687.\n\nFind G(10<sup>12</sup>). Give your
28
+ answer modulo 10<sup>8</sup>.\n\n"
@@ -3,10 +3,9 @@
3
3
  :name: Crazy Function
4
4
  :url: http://projecteuler.net/problem=340
5
5
  :content: "For fixed integers a, b, c, define the _crazy function_ F(<var>n</var>)
6
- as follows: \n\rF(<var>n</var>) = <var>n</var> - c for all <var>n</var> ![>](/home/will/src/euler-manager/config/../data/images/symbol_gt.gif)
7
- b \n\rF(<var>n</var>) = F(a + F(a + F(a + F(a + <var>n</var>)))) for all <var>n</var>
8
- ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) b.\n\nAlso,
9
- define S(a, b, c) = ![](/home/will/src/euler-manager/config/../data/images/p_340_formula.gif).\n\nFor
10
- example, if a = 50, b = 2000 and c = 40, then F(0) = 3240 and F(2000) = 2040. \n\rAlso,
11
- S(50, 2000, 40) = 5204240.\n\nFind the last 9 digits of S(21<sup>7</sup>, 7<sup>21</sup>,
12
- 12<sup>7</sup>).\n\n"
6
+ as follows: \n\rF(<var>n</var>) = <var>n</var> - c for all <var>n</var> ![>]({{
7
+ images_dir }}/symbol_gt.gif) b \n\rF(<var>n</var>) = F(a + F(a + F(a + F(a + <var>n</var>))))
8
+ for all <var>n</var> ![≤]({{ images_dir }}/symbol_le.gif) b.\n\nAlso, define S(a,
9
+ b, c) = ![]({{ images_dir }}/p_340_formula.gif).\n\nFor example, if a = 50, b =
10
+ 2000 and c = 40, then F(0) = 3240 and F(2000) = 2040. \n\rAlso, S(50, 2000, 40)
11
+ = 5204240.\n\nFind the last 9 digits of S(21<sup>7</sup>, 7<sup>21</sup>, 12<sup>7</sup>).\n\n"
@@ -9,8 +9,6 @@
9
9
  | 11 | 12 | 13 | 14 | 15 | … |\n| G(<var>n</var>) | 1 | 2 | 2 | 3 | 3 | 4 | 4 |
10
10
  4 | 5 | 5 | 5 | 6 | 6 | 6 | 6 | … |\n\nYou are given that G(10<sup>3</sup>) = 86,
11
11
  G(10<sup>6</sup>) = 6137. \n\rYou are also given that ΣG(<var>n</var><sup>3</sup>)
12
- = 153506976 for 1 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
13
- <var>n</var> ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)
14
- 10<sup>3</sup>.\n\nFind ΣG(<var>n</var><sup>3</sup>) for 1 ![](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
15
- <var>n</var> ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)
16
- 10<sup>6</sup>.\n\n"
12
+ = 153506976 for 1 ![≤]({{ images_dir }}/symbol_le.gif) <var>n</var> ![<]({{ images_dir
13
+ }}/symbol_lt.gif) 10<sup>3</sup>.\n\nFind ΣG(<var>n</var><sup>3</sup>) for 1 ![]({{
14
+ images_dir }}/symbol_le.gif) <var>n</var> ![<]({{ images_dir }}/symbol_lt.gif) 10<sup>6</sup>.\n\n"
@@ -2,12 +2,11 @@
2
2
  :id: 342
3
3
  :name: The totient of a square is a cube
4
4
  :url: http://projecteuler.net/problem=342
5
- :content: "Consider the number 50. \n\r50<sup>2</sup> = 2500 = 2<sup>2</sup> ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
6
- 5<sup>4</sup>, so φ(2500) = 2 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
7
- 4 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif) 5<sup>3</sup>
8
- = 8 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif) 5<sup>3</sup>
9
- = 2<sup>3</sup> ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
10
- 5<sup>3</sup>. <sup>1</sup> \n\rSo 2500 is a square and φ(2500) is a cube.\n\nFind
11
- the sum of all numbers n, 1 &lt n ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)
5
+ :content: "Consider the number 50. \n\r50<sup>2</sup> = 2500 = 2<sup>2</sup> ![×]({{
6
+ images_dir }}/symbol_times.gif) 5<sup>4</sup>, so φ(2500) = 2 ![×]({{ images_dir
7
+ }}/symbol_times.gif) 4 ![×]({{ images_dir }}/symbol_times.gif) 5<sup>3</sup> = 8
8
+ ![×]({{ images_dir }}/symbol_times.gif) 5<sup>3</sup> = 2<sup>3</sup> ![×]({{ images_dir
9
+ }}/symbol_times.gif) 5<sup>3</sup>. <sup>1</sup> \n\rSo 2500 is a square and φ(2500)
10
+ is a cube.\n\nFind the sum of all numbers n, 1 &lt n ![<]({{ images_dir }}/symbol_lt.gif)
12
11
  10<sup>10</sup> such that φ(n<sup>2</sup>) is a cube.\n\n<sup>1</sup> φ denotes
13
12
  **Euler's totient function** .\n\n"
@@ -8,15 +8,11 @@
8
8
  reduced to lowest terms for <var>i</var>>1. \n\rWhen a<sub><var>i</var></sub> reaches
9
9
  some integer <var>n</var>, the sequence stops. (That is, when y<sub><var>i</var></sub>=1.)
10
10
  \ \n\rDefine f(<var>k</var>) = <var>n</var>. \n\rFor example, for <var>k</var>
11
- = 20:\n\n1/20 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif)
12
- 2/19 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) 3/18
13
- = 1/6 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) 2/5
14
- ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) 3/4 ![→](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif)
15
- 4/3 ![](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) 5/2
16
- ![](/home/will/src/euler-manager/config/../data/images/symbol_maps.gif) 6/1 = 6\n\nSo
17
- f(20) = 6.\n\nAlso f(1) = 1, f(2) = 2, f(3) = 1 and Σf(<var>k</var><sup>3</sup>)
18
- = 118937 for 1 ![](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
19
- <var>k</var> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
20
- 100.\n\nFind Σf(<var>k</var><sup>3</sup>) for 1 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
21
- <var>k</var> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
22
- 2 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)10<sup>6</sup>.\n\n"
11
+ = 20:\n\n1/20 ![→]({{ images_dir }}/symbol_maps.gif) 2/19 ![→]({{ images_dir }}/symbol_maps.gif)
12
+ 3/18 = 1/6 ![→]({{ images_dir }}/symbol_maps.gif) 2/5 ![→]({{ images_dir }}/symbol_maps.gif)
13
+ 3/4 ![→]({{ images_dir }}/symbol_maps.gif) 4/3 ![→]({{ images_dir }}/symbol_maps.gif)
14
+ 5/2 ![→]({{ images_dir }}/symbol_maps.gif) 6/1 = 6\n\nSo f(20) = 6.\n\nAlso f(1)
15
+ = 1, f(2) = 2, f(3) = 1 and Σf(<var>k</var><sup>3</sup>) = 118937 for 1 ![]({{
16
+ images_dir }}/symbol_le.gif) <var>k</var> ![]({{ images_dir }}/symbol_le.gif) 100.\n\nFind
17
+ Σf(<var>k</var><sup>3</sup>) for 1 ![≤]({{ images_dir }}/symbol_le.gif) <var>k</var>
18
+ ![≤]({{ images_dir }}/symbol_le.gif) 2 ![×]({{ images_dir }}/symbol_times.gif)10<sup>6</sup>.\n\n"
@@ -11,7 +11,7 @@
11
11
  or over another coin.\n\nAlternatively, the player can choose to make the _special_
12
12
  move of pocketing the leftmost coin rather than making a regular move. If no regular
13
13
  moves are possible, the player is forced to pocket the leftmost coin.\n\nThe winner
14
- is the player who pockets the silver dollar.\n\n ![](/home/will/src/euler-manager/config/../data/images/p_344_silverdollar.gif)
14
+ is the player who pockets the silver dollar.\n\n ![]({{ images_dir }}/p_344_silverdollar.gif)
15
15
  \ \n\nA _winning configuration_ is an arrangement of coins on the strip where the
16
16
  first player can force a win no matter what the second player does.\n\nLet W(<var>n</var>,<var>c</var>)
17
17
  be the number of winning configurations for a strip of <var>n</var> squares, <var>c</var>
@@ -2,12 +2,12 @@
2
2
  :id: 347
3
3
  :name: Largest integer divisible by two primes
4
4
  :url: http://projecteuler.net/problem=347
5
- :content: "The largest integer ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
6
- 100 that is only divisible by both the primes 2 and 3 is 96, as 96=32\\*3=2<sup>5</sup>\\*3.\rFor
7
- two _distinct_ primes p and q let M(p,q,N) be the largest positive integer ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)N
8
- only divisible\rby both p and q and M(p,q,N)=0 if such a positive integer does not
9
- exist.\n\nE.g. M(2,3,100)=96. \n \rM(3,5,100)=75 and not 90 because 90 is divisible
10
- by 2 ,3 and 5. \n\rAlso M(2,73,100)=0 because there does not exist a positive integer
11
- ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) 100 that
12
- is divisible by both 2 and 73.\n\nLet S(N) be the sum of all distinct M(p,q,N).\rS(100)=2262.\n\nFind
5
+ :content: "The largest integer ![≤]({{ images_dir }}/symbol_le.gif) 100 that is only
6
+ divisible by both the primes 2 and 3 is 96, as 96=32\\*3=2<sup>5</sup>\\*3.\rFor
7
+ two _distinct_ primes p and q let M(p,q,N) be the largest positive integer ![≤]({{
8
+ images_dir }}/symbol_le.gif)N only divisible\rby both p and q and M(p,q,N)=0 if
9
+ such a positive integer does not exist.\n\nE.g. M(2,3,100)=96. \n \rM(3,5,100)=75
10
+ and not 90 because 90 is divisible by 2 ,3 and 5. \n\rAlso M(2,73,100)=0 because
11
+ there does not exist a positive integer ![≤]({{ images_dir }}/symbol_le.gif) 100
12
+ that is divisible by both 2 and 73.\n\nLet S(N) be the sum of all distinct M(p,q,N).\rS(100)=2262.\n\nFind
13
13
  S(10 000 000).\n\n"
@@ -9,8 +9,8 @@
9
9
  **least common multiple** , or lcm, of a list is the smallest natural number divisible
10
10
  by each entry of the list. \nExamples: lcm(2,6,4) = 12, lcm(10,6,15,6) = 30 and
11
11
  lcm(11) = 11.\n\nLet f(<var>G</var>, <var>L</var>, <var>N</var>) be the number of
12
- lists of size <var>N</var> with gcd ![≥](/home/will/src/euler-manager/config/../data/images/symbol_ge.gif)
13
- <var>G</var> and lcm ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
14
- <var>L</var>. For example:\n\nf(10, 100, 1) = 91. \n\rf(10, 100, 2) = 327. \n\rf(10,
15
- 100, 3) = 1135. \n\rf(10, 100, 1000) mod 101<sup>4</sup> = 3286053.\n\nFind f(10<sup>6</sup>,
16
- 10<sup>12</sup>, 10<sup>18</sup>) mod 101<sup>4</sup>.\n\n"
12
+ lists of size <var>N</var> with gcd ![≥]({{ images_dir }}/symbol_ge.gif) <var>G</var>
13
+ and lcm ![≤]({{ images_dir }}/symbol_le.gif) <var>L</var>. For example:\n\nf(10,
14
+ 100, 1) = 91. \n\rf(10, 100, 2) = 327. \n\rf(10, 100, 3) = 1135. \n\rf(10, 100,
15
+ 1000) mod 101<sup>4</sup> = 3286053.\n\nFind f(10<sup>6</sup>, 10<sup>12</sup>,
16
+ 10<sup>18</sup>) mod 101<sup>4</sup>.\n\n"
@@ -4,7 +4,7 @@
4
4
  :url: http://projecteuler.net/problem=351
5
5
  :content: "A _hexagonal orchard_ of order <var>n</var> is a triangular lattice made
6
6
  up of points within a regular hexagon with side <var>n</var>. The following is an
7
- example of a hexagonal orchard of order 5:\n\n ![](/home/will/src/euler-manager/config/../data/images/p_351_hexorchard.png)
7
+ example of a hexagonal orchard of order 5:\n\n ![]({{ images_dir }}/p_351_hexorchard.png)
8
8
  \ \n\nHighlighted in green are the points which are hidden from the center by a
9
9
  point closer to it. It can be seen that for a hexagonal orchard of order 5, 30 points
10
10
  are hidden from the center.\n\nLet H(<var>n</var>) be the number of points hidden
@@ -16,30 +16,29 @@
16
16
  (on the pooled samples) for each group will be:\n\n- Negative (and no more tests
17
17
  needed) with probability 0.98<sup>5</sup> = 0.9039207968.\n- Positive (5 additional
18
18
  tests needed) with probability 1 - 0.9039207968 = 0.0960792032.\n\nThus, the expected
19
- number of tests for each group is 1 + 0.0960792032 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
19
+ number of tests for each group is 1 + 0.0960792032 ![×]({{ images_dir }}/symbol_times.gif)
20
20
  5 = 1.480396016. \n\rConsequently, all 5 groups can be screened using an average
21
- of only 1.480396016 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
22
- 5 = **7.40198008** tests, which represents a huge saving of more than 70% !\n\nAlthough
23
- the scheme we have just described seems to be very efficient, it can still be improved
24
- considerably (always assuming that the test is sufficiently sensitive and that there
25
- are no adverse effects caused by mixing different samples). E.g.:\n\n- We may start
26
- by running a test on a mixture of all the 25 samples. It can be verified that in
27
- about 60.35% of the cases this test will be negative, thus no more tests will be
28
- needed. Further testing will only be required for the remaining 39.65% of the cases.\n-
29
- If we know that at least one animal in a group of 5 is infected and the first 4
30
- individual tests come out negative, there is no need to run a test on the fifth
31
- animal (we know that it must be infected).\n- We can try a different number of groups
32
- / different number of animals in each group, adjusting those numbers at each level
33
- so that the total expected number of tests will be minimised.\n\nTo simplify the
34
- very wide range of possibilities, there is one restriction we place when devising
35
- the most cost-efficient testing scheme: whenever we start with a mixed sample, all
36
- the sheep contributing to that sample must be fully screened (i.e. a verdict of
37
- infected / virus-free must be reached for all of them) before we start examining
38
- any other animals.\n\n\rFor the current example, it turns out that the most cost-efficient
39
- testing scheme (we'll call it the _optimal strategy_) requires an average of just
40
- **4.155452** tests!\r\r\r\n\nUsing the optimal strategy, let T(<var>s</var>,<var>p</var>)
41
- represent the average number of tests needed to screen a flock of <var>s</var> sheep
42
- for a virus having probability <var>p</var> to be present in any individual. \n\rThus,
43
- rounded to six decimal places, T(25, 0.02) = 4.155452 and T(25, 0.10) = 12.702124.\n\nFind
44
- ΣT(10000, p) for p=0.01, 0.02, 0.03, ... 0.50. \n\rGive your answer rounded to
45
- six decimal places.\n\n"
21
+ of only 1.480396016 ![×]({{ images_dir }}/symbol_times.gif) 5 = **7.40198008** tests,
22
+ which represents a huge saving of more than 70% !\n\nAlthough the scheme we have
23
+ just described seems to be very efficient, it can still be improved considerably
24
+ (always assuming that the test is sufficiently sensitive and that there are no adverse
25
+ effects caused by mixing different samples). E.g.:\n\n- We may start by running
26
+ a test on a mixture of all the 25 samples. It can be verified that in about 60.35%
27
+ of the cases this test will be negative, thus no more tests will be needed. Further
28
+ testing will only be required for the remaining 39.65% of the cases.\n- If we know
29
+ that at least one animal in a group of 5 is infected and the first 4 individual
30
+ tests come out negative, there is no need to run a test on the fifth animal (we
31
+ know that it must be infected).\n- We can try a different number of groups / different
32
+ number of animals in each group, adjusting those numbers at each level so that the
33
+ total expected number of tests will be minimised.\n\nTo simplify the very wide range
34
+ of possibilities, there is one restriction we place when devising the most cost-efficient
35
+ testing scheme: whenever we start with a mixed sample, all the sheep contributing
36
+ to that sample must be fully screened (i.e. a verdict of infected / virus-free must
37
+ be reached for all of them) before we start examining any other animals.\n\n\rFor
38
+ the current example, it turns out that the most cost-efficient testing scheme (we'll
39
+ call it the _optimal strategy_) requires an average of just **4.155452** tests!\r\r\r\n\nUsing
40
+ the optimal strategy, let T(<var>s</var>,<var>p</var>) represent the average number
41
+ of tests needed to screen a flock of <var>s</var> sheep for a virus having probability
42
+ <var>p</var> to be present in any individual. \n\rThus, rounded to six decimal
43
+ places, T(25, 0.02) = 4.155452 and T(25, 0.10) = 12.702124.\n\nFind ΣT(10000, p)
44
+ for p=0.01, 0.02, 0.03, ... 0.50. \n\rGive your answer rounded to six decimal places.\n\n"
@@ -15,7 +15,7 @@
15
15
 
16
16
  You are given that M(7)=0.1784943998 rounded to 10 digits behind the decimal point.
17
17
 
18
- Find ![∑](/home/will/src/euler-manager/config/../data/images/symbol_sum.gif)M(2<sup>n</sup>-1) for 1 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)n ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)15.
18
+ Find ![∑]({{ images_dir }}/symbol_sum.gif)M(2<sup>n</sup>-1) for 1 ![≤]({{ images_dir }}/symbol_le.gif)n ![≤]({{ images_dir }}/symbol_le.gif)15.
19
19
 
20
20
  Give your answer rounded to 10 digits behind the decimal point in the form a.bcdefghijk.
21
21
 
@@ -3,12 +3,12 @@
3
3
  :name: Distances in a bee's honeycomb
4
4
  :url: http://projecteuler.net/problem=354
5
5
  :content: "Consider a honey bee's honeycomb where each cell is a perfect regular hexagon
6
- with side length 1.\n\n ![](/home/will/src/euler-manager/config/../data/images/p_354_bee_honeycomb.png)\n\nOne
7
- particular cell is occupied by the queen bee. \n\rFor a positive real number <var>L</var>,
6
+ with side length 1.\n\n ![]({{ images_dir }}/p_354_bee_honeycomb.png)\n\nOne particular
7
+ cell is occupied by the queen bee. \n\rFor a positive real number <var>L</var>,
8
8
  let B(<var>L</var>) count the cells with distance <var>L</var> from the queen bee
9
9
  cell (all distances are measured from centre to centre); you may assume that the
10
10
  honeycomb is large enough to accommodate for any distance we wish to consider. \n\rFor
11
- example, B( ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)3)
12
- = 6, B( ![√](/home/will/src/euler-manager/config/../data/images/symbol_radic.gif)21)
13
- = 12 and B(111 111 111) = 54.\n\nFind the number of <var>L</var> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)
14
- 5·10<sup>11</sup> such that B(<var>L</var>) = 450.\n\n"
11
+ example, B( ![√]({{ images_dir }}/symbol_radic.gif)3) = 6, B( ![√]({{ images_dir
12
+ }}/symbol_radic.gif)21) = 12 and B(111 111 111) = 54.\n\nFind the number of <var>L</var>
13
+ ![≤]({{ images_dir }}/symbol_le.gif) 5·10<sup>11</sup> such that B(<var>L</var>)
14
+ = 450.\n\n"
@@ -5,6 +5,5 @@
5
5
  :content: "Let <var>a</var><sub><var>n</var></sub> be the largest real root of a polynomial
6
6
  <var>g</var>(x) = x<sup>3</sup> - 2<sup><var>n</var></sup>·x<sup>2</sup> + <var>n</var>.
7
7
  \ \n\rFor example, <var>a</var><sub>2</sub> = 3.86619826...\n\nFind the last eight
8
- digits of ![](/home/will/src/euler-manager/config/../data/images/p_356_cubicpoly1.gif).\n\n<u><i>Note</i></u>:
9
- ![](/home/will/src/euler-manager/config/../data/images/p_356_cubicpoly2.gif) represents
10
- the floor function.\n\n"
8
+ digits of ![]({{ images_dir }}/p_356_cubicpoly1.gif).\n\n<u><i>Note</i></u>: ![]({{
9
+ images_dir }}/p_356_cubicpoly2.gif) represents the floor function.\n\n"
@@ -5,18 +5,17 @@
5
5
  :content: "A **cyclic number** with <var>n</var> digits has a very interesting property:
6
6
  \ \n\rWhen it is multiplied by 1, 2, 3, 4, ... <var>n</var>, all the products have
7
7
  exactly the same digits, in the same order, but rotated in a circular fashion!\n\nThe
8
- smallest cyclic number is the 6-digit number 142857 : \n\r142857 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
9
- 1 = 142857 \n\r142857 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
10
- 2 = 285714 \n\r142857 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
11
- 3 = 428571 \n\r142857 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
12
- 4 = 571428 \n\r142857 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
13
- 5 = 714285 \n\r142857 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
8
+ smallest cyclic number is the 6-digit number 142857 : \n\r142857 ![×]({{ images_dir
9
+ }}/symbol_times.gif) 1 = 142857 \n\r142857 ![×]({{ images_dir }}/symbol_times.gif)
10
+ 2 = 285714 \n\r142857 ![×]({{ images_dir }}/symbol_times.gif) 3 = 428571 \n\r142857
11
+ ![×]({{ images_dir }}/symbol_times.gif) 4 = 571428 \n\r142857 ![×]({{ images_dir
12
+ }}/symbol_times.gif) 5 = 714285 \n\r142857 ![×]({{ images_dir }}/symbol_times.gif)
14
13
  6 = 857142\n\nThe next cyclic number is 0588235294117647 with 16 digits : \n\r0588235294117647
15
- ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif) 1 = 0588235294117647
16
- \ \n\r0588235294117647 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
17
- 2 = 1176470588235294 \n\r0588235294117647 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
18
- 3 = 1764705882352941 \n\r... \n\r0588235294117647 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
19
- 16 = 9411764705882352\n\nNote that for cyclic numbers, leading zeros are important.\n\nThere
20
- is only one cyclic number for which, the eleven leftmost digits are 00000000137
21
- and the five rightmost digits are 56789 (i.e., it has the form 00000000137...56789
22
- with an unknown number of digits in the middle). Find the sum of all its digits.\n\n"
14
+ ![×]({{ images_dir }}/symbol_times.gif) 1 = 0588235294117647 \n\r0588235294117647
15
+ ![×]({{ images_dir }}/symbol_times.gif) 2 = 1176470588235294 \n\r0588235294117647
16
+ ![×]({{ images_dir }}/symbol_times.gif) 3 = 1764705882352941 \n\r... \n\r0588235294117647
17
+ ![×]({{ images_dir }}/symbol_times.gif) 16 = 9411764705882352\n\nNote that for cyclic
18
+ numbers, leading zeros are important.\n\nThere is only one cyclic number for which,
19
+ the eleven leftmost digits are 00000000137 and the five rightmost digits are 56789
20
+ (i.e., it has the form 00000000137...56789 with an unknown number of digits in the
21
+ middle). Find the sum of all its digits.\n\n"
@@ -19,5 +19,5 @@
19
19
  and 0 if no person occupies the room. Here are a few examples:\r \nP(1, 1) = 1\r
20
20
  \ \nP(1, 2) = 3\r \nP(2, 1) = 2\r \nP(10, 20) = 440\r \nP(25, 75) = 4863\r \nP(99,
21
21
  100) = 19454\n\nFind the sum of all P(<var>f</var>, <var>r</var>) for all positive
22
- <var>f</var> and <var>r</var> such that <var>f</var> ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)
22
+ <var>f</var> and <var>r</var> such that <var>f</var> ![×]({{ images_dir }}/symbol_times.gif)
23
23
  <var>r</var> = 71328803586048 and give the last 8 digits as your answer.\n\n"
@@ -16,4 +16,5 @@
16
16
  are given as follows:\n\n| <var>n</var> | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
17
17
  | 10 | 11 | 12 | … |\n| A<sub><var>n</var></sub> | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 9
18
18
  | 10 | 11 | 12 | 13 | 18 | … |\n\nWe can also verify that A<sub>100</sub> = 3251
19
- and A<sub>1000</sub> = 80852364498.\n\nFind the last 9 digits of ![](/home/will/src/euler-manager/config/../data/images/p_361_Thue-Morse1.gif).\n\n"
19
+ and A<sub>1000</sub> = 80852364498.\n\nFind the last 9 digits of ![]({{ images_dir
20
+ }}/p_361_Thue-Morse1.gif).\n\n"
@@ -3,18 +3,16 @@
3
3
  :name: Squarefree factors
4
4
  :url: http://projecteuler.net/problem=362
5
5
  :content: "Consider the number 54. \n\r54 can be factored in 7 distinct ways into
6
- one or more factors larger than 1: \n\r54, 2 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)27,
7
- 3 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)18, 6
8
- ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)9, 3 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)3
9
- ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)6, 2 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)3
10
- ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)9 and 2
11
- ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)3 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)3
12
- ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)3. \n\rIf
13
- we require that the factors are all squarefree only two ways remain: 3 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)3
14
- ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)6 and 2
15
- ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)3 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)3
16
- ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)3.\n\nLet's
6
+ one or more factors larger than 1: \n\r54, 2 ![×]({{ images_dir }}/symbol_times.gif)27,
7
+ 3 ![×]({{ images_dir }}/symbol_times.gif)18, 6 ![×]({{ images_dir }}/symbol_times.gif)9,
8
+ 3 ![×]({{ images_dir }}/symbol_times.gif)3 ![×]({{ images_dir }}/symbol_times.gif)6,
9
+ 2 ![×]({{ images_dir }}/symbol_times.gif)3 ![×]({{ images_dir }}/symbol_times.gif)9
10
+ and 2 ![×]({{ images_dir }}/symbol_times.gif)3 ![×]({{ images_dir }}/symbol_times.gif)3
11
+ ![×]({{ images_dir }}/symbol_times.gif)3. \n\rIf we require that the factors are
12
+ all squarefree only two ways remain: 3 ![×]({{ images_dir }}/symbol_times.gif)3
13
+ ![×]({{ images_dir }}/symbol_times.gif)6 and 2 ![×]({{ images_dir }}/symbol_times.gif)3
14
+ ![×]({{ images_dir }}/symbol_times.gif)3 ![×]({{ images_dir }}/symbol_times.gif)3.\n\nLet's
17
15
  call Fsf(<var>n</var>) the number of ways <var>n</var> can be factored into one
18
16
  or more squarefree factors larger than 1, so\rFsf(54)=2.\n\nLet S(<var>n</var>)
19
- be ![∑](/home/will/src/euler-manager/config/../data/images/symbol_sum.gif)Fsf(<var>k</var>)
20
- for <var>k</var>=2 to <var>n</var>.\n\nS(100)=193.\n\nFind S(10 000 000 000).\n\n"
17
+ be ![∑]({{ images_dir }}/symbol_sum.gif)Fsf(<var>k</var>) for <var>k</var>=2 to
18
+ <var>n</var>.\n\nS(100)=193.\n\nFind S(10 000 000 000).\n\n"
@@ -24,9 +24,9 @@
24
24
  P<sub>0</sub>P<sub>1</sub> in P<sub>0</sub> and P<sub>2</sub>P<sub>3</sub> in P<sub>3</sub>.\n\nA
25
25
  cubic Bézier curve with P<sub>0</sub>=(1,0), P<sub>1</sub>=(1,<var>v</var>), P<sub>2</sub>=(<var>v</var>,1)
26
26
  and P<sub>3</sub>=(0,1) is used to approximate a quarter circle. \n\rThe value
27
- <var>v</var> ![>](/home/will/src/euler-manager/config/../data/images/symbol_gt.gif)0
28
- is chosen such that the area enclosed by the lines OP<sub>0</sub>, OP<sub>3</sub>
29
- and the curve is equal to <sup>π</sup>/<sub>4</sub> (the area of the quarter circle).\n\nBy
30
- how many percent does the length of the curve differ from the length of the quarter
31
- circle? \n\rThat is, if L is the length of the curve, calculate 100\\*<sup>(L-π/2)</sup>/<sub>(π/2)</sub>.
32
- \ \n\rGive your answer rounded to 10 digits behind the decimal point.\n\n"
27
+ <var>v</var> ![>]({{ images_dir }}/symbol_gt.gif)0 is chosen such that the area
28
+ enclosed by the lines OP<sub>0</sub>, OP<sub>3</sub> and the curve is equal to <sup>π</sup>/<sub>4</sub>
29
+ (the area of the quarter circle).\n\nBy how many percent does the length of the
30
+ curve differ from the length of the quarter circle? \n\rThat is, if L is the length
31
+ of the curve, calculate 100\\*<sup>(L-π/2)</sup>/<sub>(π/2)</sub>. \n\rGive your
32
+ answer rounded to 10 digits behind the decimal point.\n\n"
@@ -8,6 +8,6 @@
8
8
  such seat and there is any seat for which only one adjacent seat is occupied take
9
9
  such a seat.\n3. Otherwise take one of the remaining available seats. \n\rLet T(<var>N</var>)
10
10
  be the number of possibilities that <var>N</var> seats are occupied by <var>N</var>
11
- people with the given rules. \n The following figure shows T(4)=8.\r\r\r\n ![](/home/will/src/euler-manager/config/../data/images/p_364_comf_dist.gif)\n\nWe
12
- can verify that T(10) = 61632 and T(1 000) mod 100 000 007 = 47255094.\n\nFind T(1
13
- 000 000) mod 100 000 007.\n\n"
11
+ people with the given rules. \n The following figure shows T(4)=8.\r\r\r\n ![]({{
12
+ images_dir }}/p_364_comf_dist.gif)\n\nWe can verify that T(10) = 61632 and T(1 000)
13
+ mod 100 000 007 = 47255094.\n\nFind T(1 000 000) mod 100 000 007.\n\n"
@@ -3,9 +3,9 @@
3
3
  :name: A huge binomial coefficient
4
4
  :url: http://projecteuler.net/problem=365
5
5
  :content: |+
6
- The binomial coeffient C(10<sup>18</sup>,10<sup>9</sup>) is a number with more than 9 billion (9 ![×](/home/will/src/euler-manager/config/../data/images/symbol_times.gif)10<sup>9</sup>) digits.
6
+ The binomial coeffient C(10<sup>18</sup>,10<sup>9</sup>) is a number with more than 9 billion (9 ![×]({{ images_dir }}/symbol_times.gif)10<sup>9</sup>) digits.
7
7
 
8
8
  Let M(n,k,m) denote the binomial coefficient C(n,k) modulo m.
9
9
 
10
- Calculate ![∑](/home/will/src/euler-manager/config/../data/images/symbol_sum.gif)M(10<sup>18</sup>,10<sup>9</sup>,p\*q\*r) for 1000 ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)p ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)q ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)r ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)5000 and p,q,r prime.
10
+ Calculate ![∑]({{ images_dir }}/symbol_sum.gif)M(10<sup>18</sup>,10<sup>9</sup>,p\*q\*r) for 1000 ![<]({{ images_dir }}/symbol_lt.gif)p ![<]({{ images_dir }}/symbol_lt.gif)q ![<]({{ images_dir }}/symbol_lt.gif)r ![<]({{ images_dir }}/symbol_lt.gif)5000 and p,q,r prime.
11
11
 
@@ -16,8 +16,7 @@
16
16
  than one possible move for the first player. \n\rE.g. when n=17 the first player
17
17
  can remove one or four stones.\n\nLet M(n) be the maximum number of stones the first
18
18
  player can take from a winning position _at his first turn_ and M(n)=0 for any other
19
- position.\n\n![∑](/home/will/src/euler-manager/config/../data/images/symbol_sum.gif)M(n)
20
- for n ![](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)100
21
- is 728.\n\nFind ![](/home/will/src/euler-manager/config/../data/images/symbol_sum.gif)M(n)
22
- for n ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)10<sup>18</sup>.\rGive
23
- your answer modulo 10<sup>8</sup>.\n\n"
19
+ position.\n\n![∑]({{ images_dir }}/symbol_sum.gif)M(n) for n ![≤]({{ images_dir
20
+ }}/symbol_le.gif)100 is 728.\n\nFind ![]({{ images_dir }}/symbol_sum.gif)M(n) for
21
+ n ![]({{ images_dir }}/symbol_le.gif)10<sup>18</sup>.\rGive your answer modulo
22
+ 10<sup>8</sup>.\n\n"
@@ -7,5 +7,5 @@
7
7
 
8
8
  Let f(<var>n</var>) be the number of ways to choose <var>n</var> cards with a 4 card subset that is a Badugi. For example, there are 2598960 ways to choose five cards from a standard 52 card deck, of which 514800 contain a 4 card subset that is a Badugi, so f(5) = 514800.
9
9
 
10
- Find ![∑](/home/will/src/euler-manager/config/../data/images/symbol_sum.gif)f(<var>n</var>) for 4 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) <var>n</var> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) 13.
10
+ Find ![∑]({{ images_dir }}/symbol_sum.gif)f(<var>n</var>) for 4 ![≤]({{ images_dir }}/symbol_le.gif) <var>n</var> ![≤]({{ images_dir }}/symbol_le.gif) 13.
11
11
 
@@ -3,11 +3,11 @@
3
3
  :name: Geometric triangles
4
4
  :url: http://projecteuler.net/problem=370
5
5
  :content: |+
6
- Let us define a _geometric triangle_ as an integer sided triangle with sides <var>a</var> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) <var>b</var> ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) <var>c</var> so that its sides form a **geometric progression** , i.e. <var>b<sup>2</sup></var> = <var>a</var> · <var>c</var> . 
6
+ Let us define a _geometric triangle_ as an integer sided triangle with sides <var>a</var> ![≤]({{ images_dir }}/symbol_le.gif) <var>b</var> ![≤]({{ images_dir }}/symbol_le.gif) <var>c</var> so that its sides form a **geometric progression** , i.e. <var>b<sup>2</sup></var> = <var>a</var> · <var>c</var> . 
7
7
 
8
8
  An example of such a geometric triangle is the triangle with sides <var>a</var> = 144, <var>b</var> = 156 and <var>c</var> = 169.
9
9
 
10
- There are 861805 geometric triangles with perimeter ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) 10<sup>6</sup> .
10
+ There are 861805 geometric triangles with perimeter ![≤]({{ images_dir }}/symbol_le.gif) 10<sup>6</sup> .
11
11
 
12
- How many geometric triangles exist with perimeter ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) 2.5·10<sup>13</sup> ?
12
+ How many geometric triangles exist with perimeter ![≤]({{ images_dir }}/symbol_le.gif) 2.5·10<sup>13</sup> ?
13
13
 
@@ -3,11 +3,9 @@
3
3
  :name: Pencils of rays
4
4
  :url: http://projecteuler.net/problem=372
5
5
  :content: "Let R(<var>M</var>, <var>N</var>) be the number of lattice points (<var>x</var>,
6
- <var>y</var>) which satisfy <var>M</var> ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)<var>x</var>
7
- ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)<var>N</var>,
8
- <var>M</var> ![<](/home/will/src/euler-manager/config/../data/images/symbol_lt.gif)<var>y</var>
9
- ![](/home/will/src/euler-manager/config/../data/images/symbol_le.gif)<var>N</var>
10
- and ![](/home/will/src/euler-manager/config/../data/images/p_372_pencilray1.jpg)
11
- is odd. \n\rWe can verify that R(0, 100) = 3019 and R(100, 10000) = 29750422. \n\rFind
12
- R(2·10<sup>6</sup>, 10<sup>9</sup>).\n\n<u><i>Note</i></u>: ![](/home/will/src/euler-manager/config/../data/images/p_372_pencilray2.gif)
13
- represents the floor function.\n\n"
6
+ <var>y</var>) which satisfy <var>M</var> ![<]({{ images_dir }}/symbol_lt.gif)<var>x</var>
7
+ ![≤]({{ images_dir }}/symbol_le.gif)<var>N</var>, <var>M</var> ![<]({{ images_dir
8
+ }}/symbol_lt.gif)<var>y</var> ![]({{ images_dir }}/symbol_le.gif)<var>N</var> and
9
+ ![]({{ images_dir }}/p_372_pencilray1.jpg) is odd. \n\rWe can verify that R(0,
10
+ 100) = 3019 and R(100, 10000) = 29750422. \n\rFind R(2·10<sup>6</sup>, 10<sup>9</sup>).\n\n<u><i>Note</i></u>:
11
+ ![]({{ images_dir }}/p_372_pencilray2.gif) represents the floor function.\n\n"
@@ -12,10 +12,8 @@
12
12
  <var>n</var> with that product.\n\nSo f(5)=6 and m(5)=2.\n\nFor <var>n</var>=10
13
13
  the partition with the largest product is 10=2+3+5, which gives f(10)=30 and m(10)=3.\r
14
14
  \ \nAnd their product, f(10)·m(10) = 30·3 = 90\n\nIt can be verified that\r \n
15
- ![∑](/home/will/src/euler-manager/config/../data/images/symbol_sum.gif)f(<var>n</var>)·m(<var>n</var>)
16
- for 1 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) <var>n</var>
17
- ![](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) 100 = 1683550844462.\n\nFind
18
- ![](/home/will/src/euler-manager/config/../data/images/symbol_sum.gif)f(<var>n</var>)·m(<var>n</var>)
19
- for 1 ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) <var>n</var>
20
- ![≤](/home/will/src/euler-manager/config/../data/images/symbol_le.gif) 10<sup>14</sup>.\r
21
- \ \nGive your answer modulo 982451653, the 50 millionth prime.\n\n"
15
+ ![∑]({{ images_dir }}/symbol_sum.gif)f(<var>n</var>)·m(<var>n</var>) for 1 ![≤]({{
16
+ images_dir }}/symbol_le.gif) <var>n</var> ![≤]({{ images_dir }}/symbol_le.gif) 100
17
+ = 1683550844462.\n\nFind ![]({{ images_dir }}/symbol_sum.gif)f(<var>n</var>)·m(<var>n</var>)
18
+ for 1 ![]({{ images_dir }}/symbol_le.gif) <var>n</var> ![≤]({{ images_dir }}/symbol_le.gif)
19
+ 10<sup>14</sup>.\r \nGive your answer modulo 982451653, the 50 millionth prime.\n\n"