euler-manager 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (499) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +37 -0
  6. data/Rakefile +1 -0
  7. data/bin/euler +145 -0
  8. data/data/answers.yml +456 -0
  9. data/data/problems/1.yml +7 -0
  10. data/data/problems/10.yml +8 -0
  11. data/data/problems/100.yml +13 -0
  12. data/data/problems/101.yml +49 -0
  13. data/data/problems/102.yml +16 -0
  14. data/data/problems/103.yml +26 -0
  15. data/data/problems/104.yml +15 -0
  16. data/data/problems/105.yml +21 -0
  17. data/data/problems/106.yml +19 -0
  18. data/data/problems/107.yml +20 -0
  19. data/data/problems/108.yml +32 -0
  20. data/data/problems/109.yml +33 -0
  21. data/data/problems/11.yml +33 -0
  22. data/data/problems/110.yml +19 -0
  23. data/data/problems/111.yml +21 -0
  24. data/data/problems/112.yml +15 -0
  25. data/data/problems/113.yml +13 -0
  26. data/data/problems/114.yml +106 -0
  27. data/data/problems/115.yml +17 -0
  28. data/data/problems/116.yml +76 -0
  29. data/data/problems/117.yml +82 -0
  30. data/data/problems/118.yml +9 -0
  31. data/data/problems/119.yml +11 -0
  32. data/data/problems/12.yml +13 -0
  33. data/data/problems/120.yml +17 -0
  34. data/data/problems/121.yml +15 -0
  35. data/data/problems/122.yml +42 -0
  36. data/data/problems/123.yml +13 -0
  37. data/data/problems/124.yml +58 -0
  38. data/data/problems/125.yml +12 -0
  39. data/data/problems/126.yml +17 -0
  40. data/data/problems/127.yml +31 -0
  41. data/data/problems/128.yml +18 -0
  42. data/data/problems/129.yml +12 -0
  43. data/data/problems/13.yml +6 -0
  44. data/data/problems/130.yml +19 -0
  45. data/data/problems/131.yml +12 -0
  46. data/data/problems/132.yml +12 -0
  47. data/data/problems/133.yml +13 -0
  48. data/data/problems/134.yml +19 -0
  49. data/data/problems/135.yml +20 -0
  50. data/data/problems/136.yml +17 -0
  51. data/data/problems/137.yml +36 -0
  52. data/data/problems/138.yml +20 -0
  53. data/data/problems/139.yml +15 -0
  54. data/data/problems/14.yml +28 -0
  55. data/data/problems/140.yml +29 -0
  56. data/data/problems/141.yml +14 -0
  57. data/data/problems/142.yml +14 -0
  58. data/data/problems/143.yml +20 -0
  59. data/data/problems/144.yml +30 -0
  60. data/data/problems/145.yml +11 -0
  61. data/data/problems/146.yml +9 -0
  62. data/data/problems/147.yml +14 -0
  63. data/data/problems/148.yml +11 -0
  64. data/data/problems/149.yml +41 -0
  65. data/data/problems/15.yml +11 -0
  66. data/data/problems/150.yml +34 -0
  67. data/data/problems/151.yml +19 -0
  68. data/data/problems/152.yml +12 -0
  69. data/data/problems/153.yml +57 -0
  70. data/data/problems/154.yml +16 -0
  71. data/data/problems/155.yml +22 -0
  72. data/data/problems/156.yml +27 -0
  73. data/data/problems/157.yml +34 -0
  74. data/data/problems/158.yml +19 -0
  75. data/data/problems/159.yml +29 -0
  76. data/data/problems/16.yml +6 -0
  77. data/data/problems/160.yml +8 -0
  78. data/data/problems/161.yml +15 -0
  79. data/data/problems/162.yml +15 -0
  80. data/data/problems/163.yml +19 -0
  81. data/data/problems/164.yml +8 -0
  82. data/data/problems/165.yml +32 -0
  83. data/data/problems/166.yml +15 -0
  84. data/data/problems/167.yml +17 -0
  85. data/data/problems/168.yml +13 -0
  86. data/data/problems/169.yml +10 -0
  87. data/data/problems/17.yml +11 -0
  88. data/data/problems/170.yml +16 -0
  89. data/data/problems/171.yml +13 -0
  90. data/data/problems/172.yml +6 -0
  91. data/data/problems/173.yml +12 -0
  92. data/data/problems/174.yml +20 -0
  93. data/data/problems/175.yml +21 -0
  94. data/data/problems/176.yml +9 -0
  95. data/data/problems/177.yml +16 -0
  96. data/data/problems/178.yml +9 -0
  97. data/data/problems/179.yml +10 -0
  98. data/data/problems/18.yml +21 -0
  99. data/data/problems/180.yml +34 -0
  100. data/data/problems/181.yml +7 -0
  101. data/data/problems/182.yml +35 -0
  102. data/data/problems/183.yml +27 -0
  103. data/data/problems/184.yml +18 -0
  104. data/data/problems/185.yml +22 -0
  105. data/data/problems/186.yml +28 -0
  106. data/data/problems/187.yml +16 -0
  107. data/data/problems/188.yml +10 -0
  108. data/data/problems/189.yml +15 -0
  109. data/data/problems/19.yml +12 -0
  110. data/data/problems/190.yml +13 -0
  111. data/data/problems/191.yml +15 -0
  112. data/data/problems/192.yml +27 -0
  113. data/data/problems/193.yml +7 -0
  114. data/data/problems/194.yml +18 -0
  115. data/data/problems/195.yml +13 -0
  116. data/data/problems/196.yml +25 -0
  117. data/data/problems/197.yml +16 -0
  118. data/data/problems/198.yml +21 -0
  119. data/data/problems/199.yml +14 -0
  120. data/data/problems/2.yml +10 -0
  121. data/data/problems/20.yml +22 -0
  122. data/data/problems/200.yml +12 -0
  123. data/data/problems/201.yml +20 -0
  124. data/data/problems/202.yml +14 -0
  125. data/data/problems/203.yml +21 -0
  126. data/data/problems/204.yml +11 -0
  127. data/data/problems/205.yml +10 -0
  128. data/data/problems/206.yml +6 -0
  129. data/data/problems/207.yml +20 -0
  130. data/data/problems/208.yml +12 -0
  131. data/data/problems/209.yml +27 -0
  132. data/data/problems/21.yml +13 -0
  133. data/data/problems/210.yml +10 -0
  134. data/data/problems/211.yml +11 -0
  135. data/data/problems/212.yml +41 -0
  136. data/data/problems/213.yml +11 -0
  137. data/data/problems/214.yml +15 -0
  138. data/data/problems/215.yml +18 -0
  139. data/data/problems/216.yml +14 -0
  140. data/data/problems/217.yml +27 -0
  141. data/data/problems/218.yml +14 -0
  142. data/data/problems/219.yml +19 -0
  143. data/data/problems/22.yml +13 -0
  144. data/data/problems/220.yml +24 -0
  145. data/data/problems/221.yml +20 -0
  146. data/data/problems/222.yml +7 -0
  147. data/data/problems/223.yml +12 -0
  148. data/data/problems/224.yml +12 -0
  149. data/data/problems/225.yml +11 -0
  150. data/data/problems/226.yml +16 -0
  151. data/data/problems/227.yml +13 -0
  152. data/data/problems/228.yml +23 -0
  153. data/data/problems/229.yml +30 -0
  154. data/data/problems/23.yml +19 -0
  155. data/data/problems/230.yml +23 -0
  156. data/data/problems/231.yml +16 -0
  157. data/data/problems/232.yml +14 -0
  158. data/data/problems/233.yml +10 -0
  159. data/data/problems/234.yml +23 -0
  160. data/data/problems/235.yml +9 -0
  161. data/data/problems/236.yml +32 -0
  162. data/data/problems/237.yml +13 -0
  163. data/data/problems/238.yml +42 -0
  164. data/data/problems/239.yml +9 -0
  165. data/data/problems/24.yml +10 -0
  166. data/data/problems/240.yml +11 -0
  167. data/data/problems/241.yml +17 -0
  168. data/data/problems/242.yml +16 -0
  169. data/data/problems/243.yml +19 -0
  170. data/data/problems/244.yml +32 -0
  171. data/data/problems/245.yml +36 -0
  172. data/data/problems/246.yml +17 -0
  173. data/data/problems/247.yml +21 -0
  174. data/data/problems/248.yml +6 -0
  175. data/data/problems/249.yml +7 -0
  176. data/data/problems/25.yml +15 -0
  177. data/data/problems/250.yml +7 -0
  178. data/data/problems/251.yml +13 -0
  179. data/data/problems/252.yml +31 -0
  180. data/data/problems/253.yml +36 -0
  181. data/data/problems/254.yml +21 -0
  182. data/data/problems/255.yml +59 -0
  183. data/data/problems/256.yml +43 -0
  184. data/data/problems/257.yml +18 -0
  185. data/data/problems/258.yml +13 -0
  186. data/data/problems/259.yml +16 -0
  187. data/data/problems/26.yml +11 -0
  188. data/data/problems/260.yml +30 -0
  189. data/data/problems/261.yml +19 -0
  190. data/data/problems/262.yml +20 -0
  191. data/data/problems/263.yml +19 -0
  192. data/data/problems/264.yml +20 -0
  193. data/data/problems/265.yml +16 -0
  194. data/data/problems/266.yml +10 -0
  195. data/data/problems/267.yml +14 -0
  196. data/data/problems/268.yml +8 -0
  197. data/data/problems/269.yml +15 -0
  198. data/data/problems/27.yml +25 -0
  199. data/data/problems/270.yml +17 -0
  200. data/data/problems/271.yml +13 -0
  201. data/data/problems/272.yml +15 -0
  202. data/data/problems/273.yml +21 -0
  203. data/data/problems/274.yml +23 -0
  204. data/data/problems/275.yml +19 -0
  205. data/data/problems/276.yml +11 -0
  206. data/data/problems/277.yml +24 -0
  207. data/data/problems/278.yml +32 -0
  208. data/data/problems/279.yml +6 -0
  209. data/data/problems/28.yml +17 -0
  210. data/data/problems/280.yml +13 -0
  211. data/data/problems/281.yml +17 -0
  212. data/data/problems/282.yml +10 -0
  213. data/data/problems/283.yml +11 -0
  214. data/data/problems/284.yml +22 -0
  215. data/data/problems/285.yml +17 -0
  216. data/data/problems/286.yml +12 -0
  217. data/data/problems/287.yml +36 -0
  218. data/data/problems/288.yml +15 -0
  219. data/data/problems/289.yml +19 -0
  220. data/data/problems/29.yml +24 -0
  221. data/data/problems/290.yml +8 -0
  222. data/data/problems/291.yml +10 -0
  223. data/data/problems/292.yml +13 -0
  224. data/data/problems/293.yml +15 -0
  225. data/data/problems/294.yml +10 -0
  226. data/data/problems/295.yml +26 -0
  227. data/data/problems/296.yml +15 -0
  228. data/data/problems/297.yml +19 -0
  229. data/data/problems/298.yml +46 -0
  230. data/data/problems/299.yml +31 -0
  231. data/data/problems/3.yml +7 -0
  232. data/data/problems/30.yml +12 -0
  233. data/data/problems/300.yml +24 -0
  234. data/data/problems/301.yml +25 -0
  235. data/data/problems/302.yml +18 -0
  236. data/data/problems/303.yml +11 -0
  237. data/data/problems/304.yml +19 -0
  238. data/data/problems/305.yml +14 -0
  239. data/data/problems/306.yml +29 -0
  240. data/data/problems/307.yml +12 -0
  241. data/data/problems/308.yml +34 -0
  242. data/data/problems/309.yml +17 -0
  243. data/data/problems/31.yml +18 -0
  244. data/data/problems/310.yml +19 -0
  245. data/data/problems/311.yml +21 -0
  246. data/data/problems/312.yml +15 -0
  247. data/data/problems/313.yml +17 -0
  248. data/data/problems/314.yml +29 -0
  249. data/data/problems/315.yml +49 -0
  250. data/data/problems/316.yml +25 -0
  251. data/data/problems/317.yml +11 -0
  252. data/data/problems/318.yml +61 -0
  253. data/data/problems/319.yml +23 -0
  254. data/data/problems/32.yml +14 -0
  255. data/data/problems/320.yml +12 -0
  256. data/data/problems/321.yml +18 -0
  257. data/data/problems/322.yml +12 -0
  258. data/data/problems/323.yml +19 -0
  259. data/data/problems/324.yml +17 -0
  260. data/data/problems/325.yml +25 -0
  261. data/data/problems/326.yml +12 -0
  262. data/data/problems/327.yml +39 -0
  263. data/data/problems/328.yml +36 -0
  264. data/data/problems/329.yml +17 -0
  265. data/data/problems/33.yml +13 -0
  266. data/data/problems/330.yml +40 -0
  267. data/data/problems/331.yml +28 -0
  268. data/data/problems/332.yml +16 -0
  269. data/data/problems/333.yml +25 -0
  270. data/data/problems/334.yml +39 -0
  271. data/data/problems/335.yml +16 -0
  272. data/data/problems/336.yml +24 -0
  273. data/data/problems/337.yml +15 -0
  274. data/data/problems/338.yml +41 -0
  275. data/data/problems/339.yml +17 -0
  276. data/data/problems/34.yml +7 -0
  277. data/data/problems/340.yml +14 -0
  278. data/data/problems/341.yml +18 -0
  279. data/data/problems/342.yml +17 -0
  280. data/data/problems/343.yml +29 -0
  281. data/data/problems/344.yml +21 -0
  282. data/data/problems/345.yml +26 -0
  283. data/data/problems/346.yml +11 -0
  284. data/data/problems/347.yml +16 -0
  285. data/data/problems/348.yml +12 -0
  286. data/data/problems/349.yml +13 -0
  287. data/data/problems/35.yml +8 -0
  288. data/data/problems/350.yml +18 -0
  289. data/data/problems/351.yml +13 -0
  290. data/data/problems/352.yml +49 -0
  291. data/data/problems/353.yml +25 -0
  292. data/data/problems/354.yml +16 -0
  293. data/data/problems/355.yml +8 -0
  294. data/data/problems/356.yml +10 -0
  295. data/data/problems/357.yml +9 -0
  296. data/data/problems/358.yml +31 -0
  297. data/data/problems/359.yml +26 -0
  298. data/data/problems/36.yml +8 -0
  299. data/data/problems/360.yml +12 -0
  300. data/data/problems/361.yml +20 -0
  301. data/data/problems/362.yml +32 -0
  302. data/data/problems/363.yml +33 -0
  303. data/data/problems/364.yml +15 -0
  304. data/data/problems/365.yml +17 -0
  305. data/data/problems/366.yml +26 -0
  306. data/data/problems/367.yml +20 -0
  307. data/data/problems/368.yml +39 -0
  308. data/data/problems/369.yml +15 -0
  309. data/data/problems/37.yml +10 -0
  310. data/data/problems/370.yml +16 -0
  311. data/data/problems/371.yml +13 -0
  312. data/data/problems/372.yml +16 -0
  313. data/data/problems/373.yml +10 -0
  314. data/data/problems/374.yml +25 -0
  315. data/data/problems/375.yml +23 -0
  316. data/data/problems/376.yml +25 -0
  317. data/data/problems/377.yml +11 -0
  318. data/data/problems/378.yml +15 -0
  319. data/data/problems/379.yml +15 -0
  320. data/data/problems/38.yml +18 -0
  321. data/data/problems/380.yml +22 -0
  322. data/data/problems/381.yml +21 -0
  323. data/data/problems/382.yml +23 -0
  324. data/data/problems/383.yml +13 -0
  325. data/data/problems/384.yml +28 -0
  326. data/data/problems/385.yml +22 -0
  327. data/data/problems/386.yml +16 -0
  328. data/data/problems/387.yml +19 -0
  329. data/data/problems/388.yml +12 -0
  330. data/data/problems/389.yml +12 -0
  331. data/data/problems/39.yml +10 -0
  332. data/data/problems/390.yml +18 -0
  333. data/data/problems/391.yml +29 -0
  334. data/data/problems/392.yml +22 -0
  335. data/data/problems/393.yml +12 -0
  336. data/data/problems/394.yml +22 -0
  337. data/data/problems/395.yml +19 -0
  338. data/data/problems/396.yml +28 -0
  339. data/data/problems/397.yml +20 -0
  340. data/data/problems/398.yml +13 -0
  341. data/data/problems/399.yml +22 -0
  342. data/data/problems/4.yml +8 -0
  343. data/data/problems/40.yml +18 -0
  344. data/data/problems/400.yml +18 -0
  345. data/data/problems/401.yml +11 -0
  346. data/data/problems/402.yml +25 -0
  347. data/data/problems/403.yml +19 -0
  348. data/data/problems/404.yml +21 -0
  349. data/data/problems/405.yml +15 -0
  350. data/data/problems/406.yml +46 -0
  351. data/data/problems/407.yml +20 -0
  352. data/data/problems/408.yml +14 -0
  353. data/data/problems/409.yml +12 -0
  354. data/data/problems/41.yml +8 -0
  355. data/data/problems/410.yml +19 -0
  356. data/data/problems/411.yml +23 -0
  357. data/data/problems/412.yml +19 -0
  358. data/data/problems/413.yml +13 -0
  359. data/data/problems/414.yml +40 -0
  360. data/data/problems/415.yml +19 -0
  361. data/data/problems/416.yml +13 -0
  362. data/data/problems/417.yml +21 -0
  363. data/data/problems/418.yml +17 -0
  364. data/data/problems/419.yml +22 -0
  365. data/data/problems/42.yml +14 -0
  366. data/data/problems/420.yml +13 -0
  367. data/data/problems/421.yml +29 -0
  368. data/data/problems/422.yml +22 -0
  369. data/data/problems/423.yml +22 -0
  370. data/data/problems/424.yml +37 -0
  371. data/data/problems/425.yml +16 -0
  372. data/data/problems/426.yml +29 -0
  373. data/data/problems/427.yml +18 -0
  374. data/data/problems/428.yml +32 -0
  375. data/data/problems/429.yml +10 -0
  376. data/data/problems/43.yml +17 -0
  377. data/data/problems/430.yml +20 -0
  378. data/data/problems/431.yml +33 -0
  379. data/data/problems/432.yml +13 -0
  380. data/data/problems/433.yml +18 -0
  381. data/data/problems/434.yml +32 -0
  382. data/data/problems/435.yml +21 -0
  383. data/data/problems/436.yml +21 -0
  384. data/data/problems/437.yml +22 -0
  385. data/data/problems/438.yml +29 -0
  386. data/data/problems/439.yml +17 -0
  387. data/data/problems/44.yml +16 -0
  388. data/data/problems/440.yml +21 -0
  389. data/data/problems/441.yml +23 -0
  390. data/data/problems/442.yml +9 -0
  391. data/data/problems/443.yml +13 -0
  392. data/data/problems/444.yml +28 -0
  393. data/data/problems/445.yml +37 -0
  394. data/data/problems/446.yml +29 -0
  395. data/data/problems/447.yml +31 -0
  396. data/data/problems/448.yml +14 -0
  397. data/data/problems/449.yml +17 -0
  398. data/data/problems/45.yml +15 -0
  399. data/data/problems/450.yml +26 -0
  400. data/data/problems/451.yml +15 -0
  401. data/data/problems/452.yml +8 -0
  402. data/data/problems/453.yml +16 -0
  403. data/data/problems/454.yml +17 -0
  404. data/data/problems/455.yml +16 -0
  405. data/data/problems/456.yml +15 -0
  406. data/data/problems/46.yml +18 -0
  407. data/data/problems/47.yml +21 -0
  408. data/data/problems/48.yml +7 -0
  409. data/data/problems/49.yml +10 -0
  410. data/data/problems/5.yml +8 -0
  411. data/data/problems/50.yml +10 -0
  412. data/data/problems/51.yml +15 -0
  413. data/data/problems/52.yml +8 -0
  414. data/data/problems/53.yml +28 -0
  415. data/data/problems/54.yml +43 -0
  416. data/data/problems/55.yml +21 -0
  417. data/data/problems/56.yml +11 -0
  418. data/data/problems/57.yml +15 -0
  419. data/data/problems/58.yml +22 -0
  420. data/data/problems/59.yml +23 -0
  421. data/data/problems/6.yml +13 -0
  422. data/data/problems/60.yml +10 -0
  423. data/data/problems/61.yml +30 -0
  424. data/data/problems/62.yml +9 -0
  425. data/data/problems/63.yml +7 -0
  426. data/data/problems/64.yml +130 -0
  427. data/data/problems/65.yml +62 -0
  428. data/data/problems/66.yml +27 -0
  429. data/data/problems/67.yml +17 -0
  430. data/data/problems/68.yml +23 -0
  431. data/data/problems/69.yml +14 -0
  432. data/data/problems/7.yml +6 -0
  433. data/data/problems/70.yml +16 -0
  434. data/data/problems/71.yml +17 -0
  435. data/data/problems/72.yml +16 -0
  436. data/data/problems/73.yml +16 -0
  437. data/data/problems/74.yml +41 -0
  438. data/data/problems/75.yml +16 -0
  439. data/data/problems/76.yml +8 -0
  440. data/data/problems/77.yml +8 -0
  441. data/data/problems/78.yml +12 -0
  442. data/data/problems/79.yml +11 -0
  443. data/data/problems/8.yml +6 -0
  444. data/data/problems/80.yml +11 -0
  445. data/data/problems/81.yml +19 -0
  446. data/data/problems/82.yml +19 -0
  447. data/data/problems/83.yml +23 -0
  448. data/data/problems/84.yml +63 -0
  449. data/data/problems/85.yml +9 -0
  450. data/data/problems/86.yml +15 -0
  451. data/data/problems/87.yml +12 -0
  452. data/data/problems/88.yml +53 -0
  453. data/data/problems/89.yml +18 -0
  454. data/data/problems/9.yml +13 -0
  455. data/data/problems/90.yml +23 -0
  456. data/data/problems/91.yml +19 -0
  457. data/data/problems/92.yml +29 -0
  458. data/data/problems/93.yml +21 -0
  459. data/data/problems/94.yml +11 -0
  460. data/data/problems/95.yml +23 -0
  461. data/data/problems/96.yml +46 -0
  462. data/data/problems/97.yml +14 -0
  463. data/data/problems/98.yml +16 -0
  464. data/data/problems/99.yml +16 -0
  465. data/euler-manager.gemspec +31 -0
  466. data/euler-manager.sublime-project +12 -0
  467. data/example/1/README.md +6 -0
  468. data/example/1/ruby/1.rb +5 -0
  469. data/example/1/scala/1.scala +9 -0
  470. data/example/2/README.md +9 -0
  471. data/example/2/python/2.py +5 -0
  472. data/example/2/python/euler.py +0 -0
  473. data/example/Eulerfile.rb +87 -0
  474. data/example/README.md +26 -0
  475. data/example/lib/euler.py +0 -0
  476. data/example/lib/euler.rb +0 -0
  477. data/example/lib/euler.scala +5 -0
  478. data/lib/euler.rb +190 -0
  479. data/lib/euler/errors.rb +7 -0
  480. data/lib/euler/languages.rb +12 -0
  481. data/lib/euler/languages/coffeescript.rb +25 -0
  482. data/lib/euler/languages/javascript.rb +25 -0
  483. data/lib/euler/languages/python.rb +27 -0
  484. data/lib/euler/languages/ruby.rb +25 -0
  485. data/lib/euler/languages/scala.rb +27 -0
  486. data/lib/euler/languages/templates/coffeescript.coffee +5 -0
  487. data/lib/euler/languages/templates/javascript.js +5 -0
  488. data/lib/euler/languages/templates/python.py +5 -0
  489. data/lib/euler/languages/templates/ruby.rb +5 -0
  490. data/lib/euler/languages/templates/scala.scala +9 -0
  491. data/lib/euler/problem.rb +60 -0
  492. data/lib/euler/solution.rb +98 -0
  493. data/lib/euler/version.rb +3 -0
  494. data/scripts/update_problems +68 -0
  495. data/spec/euler/problem_spec.rb +5 -0
  496. data/spec/euler/solution_spec.rb +69 -0
  497. data/spec/euler_spec.rb +27 -0
  498. data/spec/spec_helper.rb +3 -0
  499. metadata +644 -0
@@ -0,0 +1,15 @@
1
+ ---
2
+ :id: 272
3
+ :name: Modular Cubes, part 2
4
+ :url: http://projecteuler.net/problem=272
5
+ :content: "\r\n<p>\r\nFor a positive number <var>n</var>, define C(<var>n</var>) as
6
+ the number of the integers <var>x,</var> for which 1<img src=\"images/symbol_lt.gif\"
7
+ width=\"10\" height=\"10\" alt=\"&lt;\" border=\"0\" style=\"vertical-align:middle;\"><var>x</var><img
8
+ src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"&lt;\" border=\"0\"
9
+ style=\"vertical-align:middle;\"><var>n</var> and<br><var>x</var><sup>3</sup><img
10
+ src=\"images/symbol_cong.gif\" width=\"9\" height=\"11\" alt=\"≡\" border=\"0\"
11
+ style=\"vertical-align:middle;\">1 mod <var>n</var>.\r\n</p>\r\n<p>\r\nWhen <var>n</var>=91,
12
+ there are 8 possible values for <var>x</var>, namely : 9, 16, 22, 29, 53, 74, 79,
13
+ 81.<br>\r\nThus, C(91)=8.</p>\r\n<p>\r\nFind the sum of the positive numbers <var>n</var><img
14
+ src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">10<sup>11</sup>
15
+ for which C(<var>n</var>)=242.\r\n</p>"
@@ -0,0 +1,21 @@
1
+ ---
2
+ :id: 273
3
+ :name: Sum of Squares
4
+ :url: http://projecteuler.net/problem=273
5
+ :content: "\r\n<p>Consider equations of the form: <var>a</var><sup>2</sup> + <var>b</var><sup>2</sup>
6
+ = <var>N</var>, 0 <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\"
7
+ border=\"0\" style=\"vertical-align:middle;\"><var>a</var> <img src=\"images/symbol_le.gif\"
8
+ width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>b</var>,
9
+ <var>a</var>, <var>b</var> and <var>N</var> integer.</p>\r\n\r\n<p>For <var>N</var>=65
10
+ there are two solutions:</p>\r\n<p><var>a</var>=1, <var>b</var>=8 and <var>a</var>=4,
11
+ <var>b</var>=7.</p>\r\n<p>We call S(<var>N</var>) the sum of the values of <var>a</var>
12
+ of all solutions of <var>a</var><sup>2</sup> + <var>b</var><sup>2</sup> = <var>N</var>,
13
+ 0 <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
14
+ style=\"vertical-align:middle;\"><var>a</var> <img src=\"images/symbol_le.gif\"
15
+ width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>b</var>,
16
+ <var>a</var>, <var>b</var> and <var>N</var> integer.</p>\r\n<p>Thus S(65) = 1 +
17
+ 4 = 5.</p>\r\n<p>Find <img src=\"images/symbol_sum.gif\" width=\"11\" height=\"14\"
18
+ alt=\"∑\" border=\"0\" style=\"vertical-align:middle;\">S(<var>N</var>), for all
19
+ squarefree <var>N</var> only divisible by primes of the form 4<var>k</var>+1 with
20
+ 4<var>k</var>+1 <img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"&lt;\"
21
+ border=\"0\" style=\"vertical-align:middle;\"> 150.</p>\r\n\r\n"
@@ -0,0 +1,23 @@
1
+ ---
2
+ :id: 274
3
+ :name: Divisibility Multipliers
4
+ :url: http://projecteuler.net/problem=274
5
+ :content: "\r\n<p>For each integer <var>p</var> <img src=\"images/symbol_gt.gif\"
6
+ width=\"10\" height=\"10\" alt=\"&gt;\" border=\"0\" style=\"vertical-align:middle;\">
7
+ 1 coprime to 10 there is a positive <em>divisibility multiplier</em> <var>m</var>
8
+ <img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"&lt;\" border=\"0\"
9
+ style=\"vertical-align:middle;\"><var>p</var> which preserves divisibility by <var>p</var>
10
+ for the following function on any positive integer, <var>n</var>:</p>\r\n\r\n<p><var>f</var>(<var>n</var>)
11
+ = (all but the last digit of <var>n</var>) + (the last digit of <var>n</var>) *
12
+ <var>m</var></p>\r\n\r\n<p>That is, if <var>m</var> is the divisibility multiplier
13
+ for <var>p</var>, then <var>f</var>(<var>n</var>) is divisible by <var>p</var> if
14
+ and only if <var>n</var> is divisible by <var>p</var>.</p>\r\n\r\n<p>(When <var>n</var>
15
+ is much larger than <var>p</var>, <var>f</var>(<var>n</var>) will be less than <var>n</var>
16
+ and repeated application of <var>f</var> provides a multiplicative divisibility
17
+ test for <var>p</var>.)</p>\r\n\r\n<p>For example, the divisibility multiplier for
18
+ 113 is 34.</p>\r\n\r\n<p><var>f</var>(76275) = 7627 + 5 * 34 = 7797 : 76275 and
19
+ 7797 are both divisible by 113<br><var>f</var>(12345) = 1234 + 5 * 34 = 1404 : 12345
20
+ and 1404 are both not divisible by 113</p>\r\n\r\n<p>The sum of the divisibility
21
+ multipliers for the primes that are coprime to 10 and less than 1000 is 39517. What
22
+ is the sum of the divisibility multipliers for the primes that are coprime to 10
23
+ and less than 10<sup>7</sup>?</p>\r\n\r\n"
@@ -0,0 +1,19 @@
1
+ ---
2
+ :id: 275
3
+ :name: Balanced Sculptures
4
+ :url: http://projecteuler.net/problem=275
5
+ :content: "\r\n<p>Let us define a <i>balanced sculpture</i> of order <var>n</var>
6
+ as follows:\r\n</p>\n<ul>\n<li>A <dfn title=\"An arrangement of identical squares
7
+ connected through shared edges; holes are allowed.\">polyomino</dfn> made up of
8
+ <var>n</var>+1 tiles known as the <i>blocks</i> (<var>n</var> tiles)<br> and the
9
+ <i>plinth</i> (remaining tile);</li>\r\n<li>the plinth has its centre at position
10
+ (<var>x</var> = 0, <var>y</var> = 0);</li>\r\n<li>the blocks have <var>y</var>-coordinates
11
+ greater than zero (so the plinth is the unique lowest tile);</li>\r\n<li>the centre
12
+ of mass of all the blocks, combined, has <var>x</var>-coordinate equal to zero.</li>\r\n</ul>\n<p>When
13
+ counting the sculptures, any arrangements which are simply reflections about the
14
+ <var>y</var>-axis, are <u>not</u> counted as distinct. For example, the 18 balanced
15
+ sculptures of order 6 are shown below; note that each pair of mirror images (about
16
+ the <var>y</var>-axis) is counted as one sculpture:</p>\r\n<div align=\"center\"><img
17
+ src=\"project/images/p_275_sculptures2.gif\"></div>\r\n\r\n<p>There are 964 balanced
18
+ sculptures of order 10 and 360505 of order 15.<br>How many balanced sculptures are
19
+ there of order 18?</p>\r\n\r\n"
@@ -0,0 +1,11 @@
1
+ ---
2
+ :id: 276
3
+ :name: Primitive Triangles
4
+ :url: http://projecteuler.net/problem=276
5
+ :content: "\r\n<p>Consider the triangles with integer sides a, b and c with a <img
6
+ src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">
7
+ b <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
8
+ style=\"vertical-align:middle;\"> c.<br>\r\nAn integer sided triangle (a,b,c) is
9
+ called primitive if <dfn title=\" gcd(a,b,c)=gcd(a,gcd(b,c))\"> gcd(a,b,c)</dfn>=1.
10
+ <br>\r\nHow many primitive integer sided triangles exist with a perimeter not exceeding
11
+ 10 000 000?\r\n</p>\r\n\r\n\r\n\r\n\r\n\r\n"
@@ -0,0 +1,24 @@
1
+ ---
2
+ :id: 277
3
+ :name: A Modified Collatz sequence
4
+ :url: http://projecteuler.net/problem=277
5
+ :content: "\r\n<p>\r\nA modified Collatz sequence of integers is obtained from a starting
6
+ value a<sub>1</sub> in the following way:</p>\r\n<p>\r\n<var>a<sub>n+1</sub></var>
7
+ = <var>a<sub>n</sub></var>/3 if <var>a<sub>n</sub></var> is divisible by 3. We shall
8
+ denote this as a large downward step, \"D\".</p>\r\n<p>\r\n<var>a<sub>n+1</sub></var>
9
+ = (4<var>a<sub>n</sub></var> + 2)/3 if <var>a<sub>n</sub></var> divided by 3 gives
10
+ a remainder of 1. We shall denote this as an upward step, \"U\".\r\n</p>\r\n<p>\r\n<var>a<sub>n+1</sub></var>
11
+ = (2<var>a<sub>n</sub></var> - 1)/3 if <var>a<sub>n</sub></var> divided by 3 gives
12
+ a remainder of 2. We shall denote this as a small downward step, \"d\".\r\n</p>\r\n\r\n\r\n<p>\r\nThe
13
+ sequence terminates when some <var>a<sub>n</sub></var> = 1.\r\n</p>\r\n<p>\r\nGiven
14
+ any integer, we can list out the sequence of steps.<br>\r\nFor instance if <var>a</var><sub>1</sub>=231,
15
+ then the sequence {<var>a<sub>n</sub></var>}={231,77,51,17,11,7,10,14,9,3,1} corresponds
16
+ to the steps \"DdDddUUdDD\".\r\n</p>\r\n<p>\r\nOf course, there are other sequences
17
+ that begin with that same sequence \"DdDddUUdDD....\".<br>\r\nFor instance, if <var>a</var><sub>1</sub>=1004064,
18
+ then the sequence is DdDddUUdDDDdUDUUUdDdUUDDDUdDD.<br>\r\nIn fact, 1004064 is the
19
+ smallest possible <var>a</var><sub>1</sub><img src=\"images/symbol_gt.gif\" width=\"10\"
20
+ height=\"10\" alt=\"&gt;\" border=\"0\" style=\"vertical-align:middle;\"> 10<sup>6</sup>
21
+ that begins with the sequence DdDddUUdDD.\r\n</p>\r\n<p>\r\nWhat is the smallest
22
+ <var>a</var><sub>1</sub><img src=\"images/symbol_gt.gif\" width=\"10\" height=\"10\"
23
+ alt=\"&gt;\" border=\"0\" style=\"vertical-align:middle;\"> 10<sup>15</sup> that
24
+ begins with the sequence \"UDDDUdddDDUDDddDdDddDDUDDdUUDd\"?\r\n</p>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
@@ -0,0 +1,32 @@
1
+ ---
2
+ :id: 278
3
+ :name: Linear Combinations of Semiprimes
4
+ :url: http://projecteuler.net/problem=278
5
+ :content: "\r\n<p>\r\nGiven the values of integers 1 <img src=\"images/symbol_lt.gif\"
6
+ width=\"10\" height=\"10\" alt=\"&lt;\" border=\"0\" style=\"vertical-align:middle;\"><var>a</var><sub>1</sub><img
7
+ src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"&lt;\" border=\"0\"
8
+ style=\"vertical-align:middle;\"><var>a</var><sub>2</sub><img src=\"images/symbol_lt.gif\"
9
+ width=\"10\" height=\"10\" alt=\"&lt;\" border=\"0\" style=\"vertical-align:middle;\">...
10
+ <img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"&lt;\" border=\"0\"
11
+ style=\"vertical-align:middle;\"><var>a</var><sub><var>n</var></sub>, consider the
12
+ linear combination<br><var>q</var><sub>1</sub><var>a</var><sub>1</sub> + <var>q</var><sub>2</sub><var>a</var><sub>2</sub>
13
+ + ... + <var>q</var><sub><var>n</var></sub><var>a</var><sub><var>n</var></sub> =
14
+ <var>b</var>, using only integer values <var>q</var><sub><var>k</var></sub><img
15
+ src=\"images/symbol_ge.gif\" width=\"10\" height=\"12\" alt=\"≥\" border=\"0\" style=\"vertical-align:middle;\">
16
+ 0. \r\n</p>\r\n<p>\r\nNote that for a given set of <var>a</var><sub><var>k</var></sub>,
17
+ it may be that not all values of <var>b</var> are possible.<br>\r\nFor instance,
18
+ if <var>a</var><sub>1</sub> = 5 and <var>a</var><sub>2</sub> = 7, there are no <var>q</var><sub>1</sub><img
19
+ src=\"images/symbol_ge.gif\" width=\"10\" height=\"12\" alt=\"≥\" border=\"0\" style=\"vertical-align:middle;\">
20
+ 0 and <var>q</var><sub>2</sub><img src=\"images/symbol_ge.gif\" width=\"10\" height=\"12\"
21
+ alt=\"≥\" border=\"0\" style=\"vertical-align:middle;\"> 0 such that <var>b</var>
22
+ could be<br> \r\n1, 2, 3, 4, 6, 8, 9, 11, 13, 16, 18 or 23.\r\n<br>\r\nIn fact,
23
+ 23 is the largest impossible value of <var>b</var> for <var>a</var><sub>1</sub>
24
+ = 5 and <var>a</var><sub>2</sub> = 7.<br> We therefore call <var>f</var>(5, 7) =
25
+ 23.<br> Similarly, it can be shown that <var>f</var>(6, 10, 15)=29 and <var>f</var>(14,
26
+ 22, 77) = 195.\r\n</p>\r\n<p>\r\nFind <img src=\"images/symbol_sum.gif\" width=\"11\"
27
+ height=\"14\" alt=\"∑\" border=\"0\" style=\"vertical-align:middle;\"><var>f</var>(<var>p*q,p*r,q*r</var>),
28
+ where <var>p</var>, <var>q</var> and <var>r</var> are prime numbers and <var>p</var>
29
+ &amp;lt <var>q</var> <img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\"
30
+ alt=\"&lt;\" border=\"0\" style=\"vertical-align:middle;\"><var>r</var> <img src=\"images/symbol_lt.gif\"
31
+ width=\"10\" height=\"10\" alt=\"&lt;\" border=\"0\" style=\"vertical-align:middle;\">
32
+ 5000.\r\n\r\n</p>"
@@ -0,0 +1,6 @@
1
+ ---
2
+ :id: 279
3
+ :name: 'Triangles with integral sides and an integral angle '
4
+ :url: http://projecteuler.net/problem=279
5
+ :content: "\r\n<p>\r\nHow many triangles are there with integral sides, at least one
6
+ integral angle (measured in degrees), and a perimeter that does not exceed 10<sup>8</sup>?\r\n</p>\r\n\r\n\r\n"
@@ -0,0 +1,17 @@
1
+ ---
2
+ :id: 28
3
+ :name: Number spiral diagonals
4
+ :url: http://projecteuler.net/problem=28
5
+ :content: "\r\n<p>Starting with the number 1 and moving to the right in a clockwise
6
+ direction a 5 by 5 spiral is formed as follows:</p>\r\n<p style=\"text-align:center;font-family:courier
7
+ new;\"><span style=\"color:#ff0000;font-family:courier new;\"><b>21</b></span> 22
8
+ 23 24 <span style=\"color:#ff0000;font-family:courier new;\"><b>25</b></span><br>\r\n20
9
+  <span style=\"color:#ff0000;font-family:courier new;\"><b>7</b></span>  8  <span
10
+ style=\"color:#ff0000;font-family:courier new;\"><b>9</b></span> 10<br>\r\n19  6
11
+  <span style=\"color:#ff0000;font-family:courier new;\"><b>1</b></span>  2 11<br>\r\n18
12
+  <span style=\"color:#ff0000;font-family:courier new;\"><b>5</b></span>  4  <span
13
+ style=\"color:#ff0000;font-family:courier new;\"><b>3</b></span> 12<br><span style=\"color:#ff0000;font-family:courier
14
+ new;\"><b>17</b></span> 16 15 14 <span style=\"color:#ff0000;font-family:courier
15
+ new;\"><b>13</b></span></p>\r\n<p>It can be verified that the sum of the numbers
16
+ on the diagonals is 101.</p>\r\n<p>What is the sum of the numbers on the diagonals
17
+ in a 1001 by 1001 spiral formed in the same way?</p>\r\n\r\n"
@@ -0,0 +1,13 @@
1
+ ---
2
+ :id: 280
3
+ :name: Ant and seeds
4
+ :url: http://projecteuler.net/problem=280
5
+ :content: "\r\n<p>A laborious ant walks randomly on a 5x5 grid. The walk starts from
6
+ the central square. At each step, the ant moves to an adjacent square at random,
7
+ without leaving the grid; thus there are 2, 3 or 4 possible moves at each step depending
8
+ on the ant's position.</p>\r\n\r\n<p>At the start of the walk, a seed is placed
9
+ on each square of the lower row. When the ant isn't carrying a seed and reaches
10
+ a square of the lower row containing a seed, it will start to carry the seed. The
11
+ ant will drop the seed on the first empty square of the upper row it eventually
12
+ reaches.</p>\r\n\r\n<p>What's the expected number of steps until all seeds have
13
+ been dropped in the top row? <br>\r\nGive your answer rounded to 6 decimal places.</p>\r\n"
@@ -0,0 +1,17 @@
1
+ ---
2
+ :id: 281
3
+ :name: Pizza Toppings
4
+ :url: http://projecteuler.net/problem=281
5
+ :content: "\r\n<p>You are given a pizza (perfect circle) that has been cut into <var>m</var>·<var>n</var>
6
+ equal pieces and you want to have exactly one topping on each slice.</p>\r\n\r\n<p>Let
7
+ <var>f</var>(<var>m</var>,<var>n</var>) denote the number of ways you can have toppings
8
+ on the pizza with <var>m</var> different toppings (<var>m</var> <img src=\"images/symbol_ge.gif\"
9
+ width=\"10\" height=\"12\" alt=\"≥\" border=\"0\" style=\"vertical-align:middle;\"> 2),
10
+ using each topping on exactly <var>n</var> slices (<var>n</var> <img src=\"images/symbol_ge.gif\"
11
+ width=\"10\" height=\"12\" alt=\"≥\" border=\"0\" style=\"vertical-align:middle;\"> 1).
12
+ <br>Reflections are considered distinct, rotations are not. </p>\r\n\r\n<p>Thus,
13
+ for instance, <var>f</var>(2,1) = 1, <var>f</var>(2,2) = <var>f</var>(3,1) = 2 and
14
+ <var>f</var>(3,2) = 16. <br><var>f</var>(3,2) is shown below:</p>\r\n\r\n<div align=\"center\"><img
15
+ src=\"project/images/p_281_pizza.gif\"></div>\r\n\r\n<p>Find the sum of all <var>f</var>(<var>m</var>,<var>n</var>)
16
+ such that <var>f</var>(<var>m</var>,<var>n</var>) <img src=\"images/symbol_le.gif\"
17
+ width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"> 10<sup>15</sup>.</p>\r\n"
@@ -0,0 +1,10 @@
1
+ ---
2
+ :id: 282
3
+ :name: The Ackermann function
4
+ :url: http://projecteuler.net/problem=282
5
+ :content: "\r\n<p>\r\nFor non-negative integers <var>m</var>, <var>n</var>, the Ackermann
6
+ function <var>A</var>(<var>m</var>, <var>n</var>) is defined as follows:\r\n</p>\r\n<div
7
+ align=\"center\"><img src=\"project/images/p_282_formula.gif\"></div>\r\n<p>\r\nFor
8
+ example <var>A</var>(1, 0) = 2, <var>A</var>(2, 2) = 7 and <var>A</var>(3, 4) =
9
+ 125.\r\n</p>\r\n<p>\r\nFind <img src=\"project/images/p_282formula3.gif\" style=\"vertical-align:middle\"><var>A</var>(<var>n</var>,
10
+ <var>n</var>) and give your answer mod 14<sup>8</sup>.</p>\r\n\r\n"
@@ -0,0 +1,11 @@
1
+ ---
2
+ :id: 283
3
+ :name: Integer sided triangles for which the area/perimeter ratio is integral
4
+ :url: http://projecteuler.net/problem=283
5
+ :content: "\r\n<p>\r\nConsider the triangle with sides 6, 8 and 10. It can be seen
6
+ that the perimeter and the area are both equal to 24. \r\nSo the area/perimeter
7
+ ratio is equal to 1.<br>\r\nConsider also the triangle with sides 13, 14 and 15.
8
+ The perimeter equals 42 while the area is equal to 84. \r\nSo for this triangle
9
+ the area/perimeter ratio is equal to 2.\r\n</p>\r\n<p>\r\nFind the sum of the perimeters
10
+ of all integer sided triangles for which the area/perimeter ratios are equal to
11
+ positive integers not exceeding 1000.\r\n</p>\r\n\r\n"
@@ -0,0 +1,22 @@
1
+ ---
2
+ :id: 284
3
+ :name: Steady Squares
4
+ :url: http://projecteuler.net/problem=284
5
+ :content: "\r\n<p>The 3-digit number 376 in the decimal numbering system is an example
6
+ of numbers with the special property that its square ends with the same digits:
7
+ 376<sup>2</sup> = 141376. Let's call a number with this property a steady square.</p>\r\n\r\n<p>Steady
8
+ squares can also be observed in other numbering systems. In the base 14 numbering
9
+ system, the 3-digit number c37 is also a steady square: c37<sup>2</sup> = aa0c37,
10
+ and the sum of its digits is c+3+7=18 in the same numbering system. The letters
11
+ a, b, c and d are used for the 10, 11, 12 and 13 digits respectively, in a manner
12
+ similar to the hexadecimal numbering system.</p>\r\n\r\n<p>For 1 <img src=\"images/symbol_le.gif\"
13
+ width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">
14
+ n <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
15
+ style=\"vertical-align:middle;\"> 9, the sum of the digits of all the n-digit steady
16
+ squares in the base 14 numbering system is 2d8 (582 decimal). Steady squares with
17
+ leading 0's are not allowed.</p>\r\n\r\n<p>Find the sum of the digits of all the
18
+ n-digit steady squares in the base 14 numbering system for<br>\r\n1 <img src=\"images/symbol_le.gif\"
19
+ width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">
20
+ n <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
21
+ style=\"vertical-align:middle;\"> 10000 (decimal) and give your answer in the base
22
+ 14 system using lower case letters where necessary.</p>\r\n"
@@ -0,0 +1,17 @@
1
+ ---
2
+ :id: 285
3
+ :name: Pythagorean odds
4
+ :url: http://projecteuler.net/problem=285
5
+ :content: "\r\n<p>Albert chooses a positive integer <var>k</var>, then two real numbers
6
+ <var>a</var>, <var>b</var> are randomly chosen in the interval [0,1] with uniform
7
+ distribution.<br>\r\nThe square root of the sum (<var>k</var>·<var>a</var>+1)<sup>2</sup> + (<var>k</var>·<var>b</var>+1)<sup>2</sup>
8
+ is then computed and rounded to the nearest integer. If the result is equal to <var>k</var>,
9
+ he scores <var>k</var> points; otherwise he scores nothing.</p>\r\n\r\n<p>For example,
10
+ if <var>k</var> = 6, <var>a</var> = 0.2 and <var>b</var> = 0.85, then (<var>k</var>·<var>a</var>+1)<sup>2</sup> + (<var>k</var>·<var>b</var>+1)<sup>2</sup> = 42.05.<br>\r\nThe
11
+ square root of 42.05 is 6.484... and when rounded to the nearest integer, it becomes
12
+ 6.<br>\r\nThis is equal to <var>k</var>, so he scores 6 points.</p>\r\n\r\n<p>It
13
+ can be shown that if he plays 10 turns with <var>k</var> = 1, <var>k</var> = 2,
14
+ ..., <var>k</var> = 10, the expected value of his total score, rounded to five decimal
15
+ places, is 10.20914.</p>\r\n\r\n<p>If he plays 10<sup>5</sup> turns with <var>k</var> = 1,
16
+ <var>k</var> = 2, <var>k</var> = 3, ..., <var>k</var> = 10<sup>5</sup>, what is
17
+ the expected value of his total score, rounded to five decimal places?</p>\r\n"
@@ -0,0 +1,12 @@
1
+ ---
2
+ :id: 286
3
+ :name: Scoring probabilities
4
+ :url: http://projecteuler.net/problem=286
5
+ :content: "\r\n<p>Barbara is a mathematician and a basketball player. She has found
6
+ that the probability of scoring a point when shooting from a distance <var>x</var>
7
+ is exactly (1 - <sup><var>x</var></sup>/<sub><var>q</var></sub>), where <var>q</var>
8
+ is a real constant greater than 50.</p>\r\n\r\n<p>During each practice run, she
9
+ takes shots from distances <var>x</var> = 1, <var>x</var> = 2, ..., <var>x</var> = 50
10
+ and, according to her records, she has precisely a 2 % chance to score a total of
11
+ exactly 20 points.</p>\r\n\r\n<p>Find <var>q</var> and give your answer rounded
12
+ to 10 decimal places.</p>\r\n"
@@ -0,0 +1,36 @@
1
+ ---
2
+ :id: 287
3
+ :name: Quadtree encoding (a simple compression algorithm)
4
+ :url: http://projecteuler.net/problem=287
5
+ :content: "\r\n<p>The quadtree encoding allows us to describe a 2<sup><var>N</var></sup><img
6
+ src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
7
+ style=\"vertical-align:middle;\">2<sup><var>N</var></sup> black and white image
8
+ as a sequence of bits (0 and 1). Those sequences are to be read from left to right
9
+ like this:\r\n</p>\n<ul>\n<li>the first bit deals with the complete 2<sup><var>N</var></sup><img
10
+ src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
11
+ style=\"vertical-align:middle;\">2<sup><var>N</var></sup> region;</li>\r\n<li>\"0\"
12
+ denotes a split:\r\n<br>the current 2<sup><var>n</var></sup><img src=\"images/symbol_times.gif\"
13
+ width=\"9\" height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">2<sup><var>n</var></sup>
14
+ region is divided into 4 sub-regions of dimension 2<sup><var>n</var>-1</sup><img
15
+ src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
16
+ style=\"vertical-align:middle;\">2<sup><var>n</var>-1</sup>,<br>\r\nthe next bits
17
+ contains the description of the top left, top right, bottom left and bottom right
18
+ sub-regions - in that order;</li>\r\n<li>\"10\" indicates that the current region
19
+ contains only black pixels;</li>\r\n<li>\"11\" indicates that the current region
20
+ contains only white pixels.</li>\n</ul>\n<p>Consider the following 4<img src=\"images/symbol_times.gif\"
21
+ width=\"9\" height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">4
22
+ image (colored marks denote places where a split can occur):</p>\r\n<div align=\"center\"><img
23
+ src=\"project/images/p_287_quadtree.gif\"></div>\r\n<p>This image can be described
24
+ by several sequences, for example :<bp></bp>\r\n\"<span style=\"color:red;\"><b>0</b></span><span
25
+ style=\"color:blue;\"><b>0</b></span>10101010<span style=\"color:green;\"><b>0</b></span>1011111011<span
26
+ style=\"color:orange;\"><b>0</b></span>10101010\", of length 30, or<br>\r\n\"<span
27
+ style=\"color:red;\"><b>0</b></span>10<span style=\"color:green;\"><b>0</b></span>101111101110\",
28
+ of length 16, which is the minimal sequence for this image.</p>\r\n\r\n<p>For a
29
+ positive integer <var>N</var>, define <var>D<sub>N</sub></var> as the 2<sup><var>N</var></sup><img
30
+ src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
31
+ style=\"vertical-align:middle;\">2<sup><var>N</var></sup> image with the following
32
+ coloring scheme:\r\n</p>\n<ul>\n<li>the pixel with coordinates <var>x</var> = 0,
33
+ <var>y</var> = 0 corresponds to the bottom left pixel,</li>\r\n<li>if (<var>x</var> - 2<sup><var>N</var>-1</sup>)<sup>2</sup> + (<var>y</var> - 2<sup><var>N</var>-1</sup>)<sup>2</sup> <img
34
+ src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"> 2<sup>2<var>N</var>-2</sup>
35
+ then the pixel is black,</li>\r\n<li>otherwise the pixel is white.</li>\n</ul>\n<p>What
36
+ is the length of the minimal sequence describing <var>D</var><sub>24</sub> ?</p>\r\n"
@@ -0,0 +1,15 @@
1
+ ---
2
+ :id: 288
3
+ :name: An enormous factorial
4
+ :url: http://projecteuler.net/problem=288
5
+ :content: "\r\n<p>\r\nFor any prime <var>p</var> the number N(<var>p</var>,<var>q</var>)
6
+ is defined by\r\nN(<var>p</var>,<var>q</var>) = <img src=\"images/symbol_sum.gif\"
7
+ width=\"11\" height=\"14\" alt=\"∑\" border=\"0\" style=\"vertical-align:middle;\"><sub><var>n</var>=0
8
+ to <var>q</var></sub> T<sub><var>n</var></sub>*<var>p</var><sup><var>n</var></sup><br>
9
+ with T<sub><var>n</var></sub> generated by the following random number generator:</p>\r\n<p>\r\nS<sub>0</sub>
10
+ = 290797<br>\r\nS<sub><var>n</var>+1</sub> = S<sub><var>n</var></sub><sup>2</sup>
11
+ mod 50515093<br>\r\nT<sub><var>n</var></sub> = S<sub><var>n</var></sub> mod <var>p</var>\r\n</p>\r\n<p>\r\nLet
12
+ Nfac(<var>p</var>,<var>q</var>) be the factorial of N(<var>p</var>,<var>q</var>).<br>\r\nLet
13
+ NF(<var>p</var>,<var>q</var>) be the number of factors <var>p</var> in Nfac(<var>p</var>,<var>q</var>).\r\n</p>\r\n<p>\r\nYou
14
+ are given that NF(3,10000) mod 3<sup>20</sup>=624955285.\r\n</p>\r\n<p>\r\nFind
15
+ NF(61,10<sup>7</sup>) mod 61<sup>10</sup></p>\r\n\r\n \r\n\r\n\r\n"
@@ -0,0 +1,19 @@
1
+ ---
2
+ :id: 289
3
+ :name: Eulerian Cycles
4
+ :url: http://projecteuler.net/problem=289
5
+ :content: "\r\n<p>Let C(<var>x</var>,<var>y</var>) be a circle passing through the
6
+ points (<var>x</var>, <var>y</var>), (<var>x</var>, <var>y</var>+1), (<var>x</var>+1, <var>y</var>)
7
+ and (<var>x</var>+1, <var>y</var>+1).</p>\r\n\r\n<p>For positive integers m and
8
+ n, let E(<var>m</var>,<var>n</var>) be a configuration which consists of the <var>m</var>·<var>n</var>
9
+ circles:<br>\r\n{ C(<var>x</var>,<var>y</var>): 0 ≤ <var>x</var> m, 0 ≤ <var>y</var> n,
10
+ <var>x</var> and <var>y</var> are integers }</p>\r\n\r\n<p>An Eulerian cycle on
11
+ E(<var>m</var>,<var>n</var>) is a closed path that passes through each arc exactly
12
+ once.<br>\r\nMany such paths are possible on E(<var>m</var>,<var>n</var>), but we
13
+ are only interested in those which are not self-crossing: \r\nA non-crossing path
14
+ just touches itself at lattice points, but it never crosses itself.</p>\r\n\r\n<p>The
15
+ image below shows E(3,3) and an example of an Eulerian non-crossing path.<br></p>\n<div
16
+ align=\"center\"><img src=\"project/images/p_289_euler.gif\"></div>\r\n\r\n<p>Let
17
+ L(<var>m</var>,<var>n</var>) be the number of Eulerian non-crossing paths on E(<var>m</var>,<var>n</var>).<br>\r\nFor
18
+ example, L(1,2) = 2, L(2,2) = 37 and L(3,3) = 104290.</p>\r\n\r\n<p>Find L(6,10)
19
+ mod 10<sup>10</sup>.</p>\r\n"
@@ -0,0 +1,24 @@
1
+ ---
2
+ :id: 29
3
+ :name: Distinct powers
4
+ :url: http://projecteuler.net/problem=29
5
+ :content: "\r\n\n<p>Consider all integer combinations of <i>a</i><sup><i>b</i></sup>
6
+ for 2 <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
7
+ style=\"vertical-align:middle;\"><i>a</i> <img src=\"images/symbol_le.gif\" width=\"10\"
8
+ height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"> 5 and 2 <img
9
+ src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><i>b</i>
10
+ <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
11
+ style=\"vertical-align:middle;\"> 5:</p>\n<blockquote>2<sup>2</sup>=4, 2<sup>3</sup>=8,
12
+ 2<sup>4</sup>=16, 2<sup>5</sup>=32<br>\n3<sup>2</sup>=9, 3<sup>3</sup>=27, 3<sup>4</sup>=81,
13
+ 3<sup>5</sup>=243<br>\n4<sup>2</sup>=16, 4<sup>3</sup>=64, 4<sup>4</sup>=256, 4<sup>5</sup>=1024<br>\n5<sup>2</sup>=25,
14
+ 5<sup>3</sup>=125, 5<sup>4</sup>=625, 5<sup>5</sup>=3125<br>\n</blockquote>\n<p>If
15
+ they are then placed in numerical order, with any repeats removed, we get the following
16
+ sequence of 15 distinct terms:</p>\n<p style=\"text-align:center;\">4, 8, 9, 16,
17
+ 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125</p>\n<p>How many distinct terms
18
+ are in the sequence generated by <i>a</i><sup><i>b</i></sup> for 2 <img src=\"images/symbol_le.gif\"
19
+ width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><i>a</i>
20
+ <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
21
+ style=\"vertical-align:middle;\"> 100 and 2 <img src=\"images/symbol_le.gif\" width=\"10\"
22
+ height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><i>b</i> <img
23
+ src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">
24
+ 100?</p>\n\r\n"
@@ -0,0 +1,8 @@
1
+ ---
2
+ :id: 290
3
+ :name: Digital Signature
4
+ :url: http://projecteuler.net/problem=290
5
+ :content: "\r\n<p>How many integers 0 <img src=\"images/symbol_le.gif\" width=\"10\"
6
+ height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>n</var>
7
+ &amp;lt 10<sup>18</sup> have the property that the sum of the digits of <var>n</var>
8
+ equals the sum of digits of 137<var>n</var>?</p>\r\n"
@@ -0,0 +1,10 @@
1
+ ---
2
+ :id: 291
3
+ :name: Panaitopol Primes
4
+ :url: http://projecteuler.net/problem=291
5
+ :content: "\r\n<p>\r\nA prime number <var>p</var> is called a Panaitopol prime if
6
+ <img src=\"project/images/p_291_formula.gif\" style=\"vertical-align:middle\"> for
7
+ some positive integers<br><var>x</var> and <var>y</var>.\r\n</p>\r\n<p>\r\nFind
8
+ how many Panaitopol primes are less than 5<img src=\"images/symbol_times.gif\" width=\"9\"
9
+ height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">10<sup>15</sup>.\r\n</p>\r\n\r\n
10
+ \ \r\n"
@@ -0,0 +1,13 @@
1
+ ---
2
+ :id: 292
3
+ :name: Pythagorean Polygons
4
+ :url: http://projecteuler.net/problem=292
5
+ :content: "\r\n<p>We shall define a <i>pythagorean polygon</i> to be a <b>convex
6
+ polygon</b> with the following properties:<br></p>\n<ul>\n<li>there are at least
7
+ three vertices,</li>\r\n<li>no three vertices are aligned,</li>\r\n<li>each vertex
8
+ has <b>integer coordinates</b>,</li>\r\n<li>each edge has <b>integer length</b>.</li>\n</ul>\n<p>For
9
+ a given integer <var>n</var>, define P(<var>n</var>) as the number of distinct pythagorean
10
+ polygons for which the perimeter is <img src=\"images/symbol_le.gif\" width=\"10\"
11
+ height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"> <var>n</var>.<br>\r\nPythagorean
12
+ polygons should be considered distinct as long as none is a translation of another.</p>\r\n\r\n<p>You
13
+ are given that P(4) = 1, P(30) = 3655 and P(60) = 891045.<br>\r\nFind P(120).</p>\r\n"
@@ -0,0 +1,15 @@
1
+ ---
2
+ :id: 293
3
+ :name: Pseudo-Fortunate Numbers
4
+ :url: http://projecteuler.net/problem=293
5
+ :content: "\r\n<p>\r\nAn even positive integer N will be called admissible, if it
6
+ is a power of 2 or its distinct prime factors are consecutive primes.<br>\r\nThe
7
+ first twelve admissible numbers are 2,4,6,8,12,16,18,24,30,32,36,48.\r\n</p>\r\n<p>\r\nIf
8
+ N is admissible, the smallest integer M <img src=\"images/symbol_gt.gif\" width=\"10\"
9
+ height=\"10\" alt=\"&gt;\" border=\"0\" style=\"vertical-align:middle;\"> 1 such
10
+ that N+M is prime, will be called the pseudo-Fortunate number for N.\r\n</p>\r\n<p>\r\nFor
11
+ example, N=630 is admissible since it is even and its distinct prime factors are
12
+ the consecutive primes 2,3,5 and 7.<br> \r\nThe next prime number after 631 is 641;
13
+ hence, the pseudo-Fortunate number for 630 is M=11.<br>\r\nIt can also be seen that
14
+ the pseudo-Fortunate number for 16 is 3.\r\n</p>\r\n<p>\r\nFind the sum of all distinct
15
+ pseudo-Fortunate numbers for admissible numbers N less than 10<sup>9</sup>.\r\n</p>\r\n\r\n\r\n\r\n"