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.
- checksums.yaml +7 -0
- data/.gitignore +21 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +37 -0
- data/Rakefile +1 -0
- data/bin/euler +145 -0
- data/data/answers.yml +456 -0
- data/data/problems/1.yml +7 -0
- data/data/problems/10.yml +8 -0
- data/data/problems/100.yml +13 -0
- data/data/problems/101.yml +49 -0
- data/data/problems/102.yml +16 -0
- data/data/problems/103.yml +26 -0
- data/data/problems/104.yml +15 -0
- data/data/problems/105.yml +21 -0
- data/data/problems/106.yml +19 -0
- data/data/problems/107.yml +20 -0
- data/data/problems/108.yml +32 -0
- data/data/problems/109.yml +33 -0
- data/data/problems/11.yml +33 -0
- data/data/problems/110.yml +19 -0
- data/data/problems/111.yml +21 -0
- data/data/problems/112.yml +15 -0
- data/data/problems/113.yml +13 -0
- data/data/problems/114.yml +106 -0
- data/data/problems/115.yml +17 -0
- data/data/problems/116.yml +76 -0
- data/data/problems/117.yml +82 -0
- data/data/problems/118.yml +9 -0
- data/data/problems/119.yml +11 -0
- data/data/problems/12.yml +13 -0
- data/data/problems/120.yml +17 -0
- data/data/problems/121.yml +15 -0
- data/data/problems/122.yml +42 -0
- data/data/problems/123.yml +13 -0
- data/data/problems/124.yml +58 -0
- data/data/problems/125.yml +12 -0
- data/data/problems/126.yml +17 -0
- data/data/problems/127.yml +31 -0
- data/data/problems/128.yml +18 -0
- data/data/problems/129.yml +12 -0
- data/data/problems/13.yml +6 -0
- data/data/problems/130.yml +19 -0
- data/data/problems/131.yml +12 -0
- data/data/problems/132.yml +12 -0
- data/data/problems/133.yml +13 -0
- data/data/problems/134.yml +19 -0
- data/data/problems/135.yml +20 -0
- data/data/problems/136.yml +17 -0
- data/data/problems/137.yml +36 -0
- data/data/problems/138.yml +20 -0
- data/data/problems/139.yml +15 -0
- data/data/problems/14.yml +28 -0
- data/data/problems/140.yml +29 -0
- data/data/problems/141.yml +14 -0
- data/data/problems/142.yml +14 -0
- data/data/problems/143.yml +20 -0
- data/data/problems/144.yml +30 -0
- data/data/problems/145.yml +11 -0
- data/data/problems/146.yml +9 -0
- data/data/problems/147.yml +14 -0
- data/data/problems/148.yml +11 -0
- data/data/problems/149.yml +41 -0
- data/data/problems/15.yml +11 -0
- data/data/problems/150.yml +34 -0
- data/data/problems/151.yml +19 -0
- data/data/problems/152.yml +12 -0
- data/data/problems/153.yml +57 -0
- data/data/problems/154.yml +16 -0
- data/data/problems/155.yml +22 -0
- data/data/problems/156.yml +27 -0
- data/data/problems/157.yml +34 -0
- data/data/problems/158.yml +19 -0
- data/data/problems/159.yml +29 -0
- data/data/problems/16.yml +6 -0
- data/data/problems/160.yml +8 -0
- data/data/problems/161.yml +15 -0
- data/data/problems/162.yml +15 -0
- data/data/problems/163.yml +19 -0
- data/data/problems/164.yml +8 -0
- data/data/problems/165.yml +32 -0
- data/data/problems/166.yml +15 -0
- data/data/problems/167.yml +17 -0
- data/data/problems/168.yml +13 -0
- data/data/problems/169.yml +10 -0
- data/data/problems/17.yml +11 -0
- data/data/problems/170.yml +16 -0
- data/data/problems/171.yml +13 -0
- data/data/problems/172.yml +6 -0
- data/data/problems/173.yml +12 -0
- data/data/problems/174.yml +20 -0
- data/data/problems/175.yml +21 -0
- data/data/problems/176.yml +9 -0
- data/data/problems/177.yml +16 -0
- data/data/problems/178.yml +9 -0
- data/data/problems/179.yml +10 -0
- data/data/problems/18.yml +21 -0
- data/data/problems/180.yml +34 -0
- data/data/problems/181.yml +7 -0
- data/data/problems/182.yml +35 -0
- data/data/problems/183.yml +27 -0
- data/data/problems/184.yml +18 -0
- data/data/problems/185.yml +22 -0
- data/data/problems/186.yml +28 -0
- data/data/problems/187.yml +16 -0
- data/data/problems/188.yml +10 -0
- data/data/problems/189.yml +15 -0
- data/data/problems/19.yml +12 -0
- data/data/problems/190.yml +13 -0
- data/data/problems/191.yml +15 -0
- data/data/problems/192.yml +27 -0
- data/data/problems/193.yml +7 -0
- data/data/problems/194.yml +18 -0
- data/data/problems/195.yml +13 -0
- data/data/problems/196.yml +25 -0
- data/data/problems/197.yml +16 -0
- data/data/problems/198.yml +21 -0
- data/data/problems/199.yml +14 -0
- data/data/problems/2.yml +10 -0
- data/data/problems/20.yml +22 -0
- data/data/problems/200.yml +12 -0
- data/data/problems/201.yml +20 -0
- data/data/problems/202.yml +14 -0
- data/data/problems/203.yml +21 -0
- data/data/problems/204.yml +11 -0
- data/data/problems/205.yml +10 -0
- data/data/problems/206.yml +6 -0
- data/data/problems/207.yml +20 -0
- data/data/problems/208.yml +12 -0
- data/data/problems/209.yml +27 -0
- data/data/problems/21.yml +13 -0
- data/data/problems/210.yml +10 -0
- data/data/problems/211.yml +11 -0
- data/data/problems/212.yml +41 -0
- data/data/problems/213.yml +11 -0
- data/data/problems/214.yml +15 -0
- data/data/problems/215.yml +18 -0
- data/data/problems/216.yml +14 -0
- data/data/problems/217.yml +27 -0
- data/data/problems/218.yml +14 -0
- data/data/problems/219.yml +19 -0
- data/data/problems/22.yml +13 -0
- data/data/problems/220.yml +24 -0
- data/data/problems/221.yml +20 -0
- data/data/problems/222.yml +7 -0
- data/data/problems/223.yml +12 -0
- data/data/problems/224.yml +12 -0
- data/data/problems/225.yml +11 -0
- data/data/problems/226.yml +16 -0
- data/data/problems/227.yml +13 -0
- data/data/problems/228.yml +23 -0
- data/data/problems/229.yml +30 -0
- data/data/problems/23.yml +19 -0
- data/data/problems/230.yml +23 -0
- data/data/problems/231.yml +16 -0
- data/data/problems/232.yml +14 -0
- data/data/problems/233.yml +10 -0
- data/data/problems/234.yml +23 -0
- data/data/problems/235.yml +9 -0
- data/data/problems/236.yml +32 -0
- data/data/problems/237.yml +13 -0
- data/data/problems/238.yml +42 -0
- data/data/problems/239.yml +9 -0
- data/data/problems/24.yml +10 -0
- data/data/problems/240.yml +11 -0
- data/data/problems/241.yml +17 -0
- data/data/problems/242.yml +16 -0
- data/data/problems/243.yml +19 -0
- data/data/problems/244.yml +32 -0
- data/data/problems/245.yml +36 -0
- data/data/problems/246.yml +17 -0
- data/data/problems/247.yml +21 -0
- data/data/problems/248.yml +6 -0
- data/data/problems/249.yml +7 -0
- data/data/problems/25.yml +15 -0
- data/data/problems/250.yml +7 -0
- data/data/problems/251.yml +13 -0
- data/data/problems/252.yml +31 -0
- data/data/problems/253.yml +36 -0
- data/data/problems/254.yml +21 -0
- data/data/problems/255.yml +59 -0
- data/data/problems/256.yml +43 -0
- data/data/problems/257.yml +18 -0
- data/data/problems/258.yml +13 -0
- data/data/problems/259.yml +16 -0
- data/data/problems/26.yml +11 -0
- data/data/problems/260.yml +30 -0
- data/data/problems/261.yml +19 -0
- data/data/problems/262.yml +20 -0
- data/data/problems/263.yml +19 -0
- data/data/problems/264.yml +20 -0
- data/data/problems/265.yml +16 -0
- data/data/problems/266.yml +10 -0
- data/data/problems/267.yml +14 -0
- data/data/problems/268.yml +8 -0
- data/data/problems/269.yml +15 -0
- data/data/problems/27.yml +25 -0
- data/data/problems/270.yml +17 -0
- data/data/problems/271.yml +13 -0
- data/data/problems/272.yml +15 -0
- data/data/problems/273.yml +21 -0
- data/data/problems/274.yml +23 -0
- data/data/problems/275.yml +19 -0
- data/data/problems/276.yml +11 -0
- data/data/problems/277.yml +24 -0
- data/data/problems/278.yml +32 -0
- data/data/problems/279.yml +6 -0
- data/data/problems/28.yml +17 -0
- data/data/problems/280.yml +13 -0
- data/data/problems/281.yml +17 -0
- data/data/problems/282.yml +10 -0
- data/data/problems/283.yml +11 -0
- data/data/problems/284.yml +22 -0
- data/data/problems/285.yml +17 -0
- data/data/problems/286.yml +12 -0
- data/data/problems/287.yml +36 -0
- data/data/problems/288.yml +15 -0
- data/data/problems/289.yml +19 -0
- data/data/problems/29.yml +24 -0
- data/data/problems/290.yml +8 -0
- data/data/problems/291.yml +10 -0
- data/data/problems/292.yml +13 -0
- data/data/problems/293.yml +15 -0
- data/data/problems/294.yml +10 -0
- data/data/problems/295.yml +26 -0
- data/data/problems/296.yml +15 -0
- data/data/problems/297.yml +19 -0
- data/data/problems/298.yml +46 -0
- data/data/problems/299.yml +31 -0
- data/data/problems/3.yml +7 -0
- data/data/problems/30.yml +12 -0
- data/data/problems/300.yml +24 -0
- data/data/problems/301.yml +25 -0
- data/data/problems/302.yml +18 -0
- data/data/problems/303.yml +11 -0
- data/data/problems/304.yml +19 -0
- data/data/problems/305.yml +14 -0
- data/data/problems/306.yml +29 -0
- data/data/problems/307.yml +12 -0
- data/data/problems/308.yml +34 -0
- data/data/problems/309.yml +17 -0
- data/data/problems/31.yml +18 -0
- data/data/problems/310.yml +19 -0
- data/data/problems/311.yml +21 -0
- data/data/problems/312.yml +15 -0
- data/data/problems/313.yml +17 -0
- data/data/problems/314.yml +29 -0
- data/data/problems/315.yml +49 -0
- data/data/problems/316.yml +25 -0
- data/data/problems/317.yml +11 -0
- data/data/problems/318.yml +61 -0
- data/data/problems/319.yml +23 -0
- data/data/problems/32.yml +14 -0
- data/data/problems/320.yml +12 -0
- data/data/problems/321.yml +18 -0
- data/data/problems/322.yml +12 -0
- data/data/problems/323.yml +19 -0
- data/data/problems/324.yml +17 -0
- data/data/problems/325.yml +25 -0
- data/data/problems/326.yml +12 -0
- data/data/problems/327.yml +39 -0
- data/data/problems/328.yml +36 -0
- data/data/problems/329.yml +17 -0
- data/data/problems/33.yml +13 -0
- data/data/problems/330.yml +40 -0
- data/data/problems/331.yml +28 -0
- data/data/problems/332.yml +16 -0
- data/data/problems/333.yml +25 -0
- data/data/problems/334.yml +39 -0
- data/data/problems/335.yml +16 -0
- data/data/problems/336.yml +24 -0
- data/data/problems/337.yml +15 -0
- data/data/problems/338.yml +41 -0
- data/data/problems/339.yml +17 -0
- data/data/problems/34.yml +7 -0
- data/data/problems/340.yml +14 -0
- data/data/problems/341.yml +18 -0
- data/data/problems/342.yml +17 -0
- data/data/problems/343.yml +29 -0
- data/data/problems/344.yml +21 -0
- data/data/problems/345.yml +26 -0
- data/data/problems/346.yml +11 -0
- data/data/problems/347.yml +16 -0
- data/data/problems/348.yml +12 -0
- data/data/problems/349.yml +13 -0
- data/data/problems/35.yml +8 -0
- data/data/problems/350.yml +18 -0
- data/data/problems/351.yml +13 -0
- data/data/problems/352.yml +49 -0
- data/data/problems/353.yml +25 -0
- data/data/problems/354.yml +16 -0
- data/data/problems/355.yml +8 -0
- data/data/problems/356.yml +10 -0
- data/data/problems/357.yml +9 -0
- data/data/problems/358.yml +31 -0
- data/data/problems/359.yml +26 -0
- data/data/problems/36.yml +8 -0
- data/data/problems/360.yml +12 -0
- data/data/problems/361.yml +20 -0
- data/data/problems/362.yml +32 -0
- data/data/problems/363.yml +33 -0
- data/data/problems/364.yml +15 -0
- data/data/problems/365.yml +17 -0
- data/data/problems/366.yml +26 -0
- data/data/problems/367.yml +20 -0
- data/data/problems/368.yml +39 -0
- data/data/problems/369.yml +15 -0
- data/data/problems/37.yml +10 -0
- data/data/problems/370.yml +16 -0
- data/data/problems/371.yml +13 -0
- data/data/problems/372.yml +16 -0
- data/data/problems/373.yml +10 -0
- data/data/problems/374.yml +25 -0
- data/data/problems/375.yml +23 -0
- data/data/problems/376.yml +25 -0
- data/data/problems/377.yml +11 -0
- data/data/problems/378.yml +15 -0
- data/data/problems/379.yml +15 -0
- data/data/problems/38.yml +18 -0
- data/data/problems/380.yml +22 -0
- data/data/problems/381.yml +21 -0
- data/data/problems/382.yml +23 -0
- data/data/problems/383.yml +13 -0
- data/data/problems/384.yml +28 -0
- data/data/problems/385.yml +22 -0
- data/data/problems/386.yml +16 -0
- data/data/problems/387.yml +19 -0
- data/data/problems/388.yml +12 -0
- data/data/problems/389.yml +12 -0
- data/data/problems/39.yml +10 -0
- data/data/problems/390.yml +18 -0
- data/data/problems/391.yml +29 -0
- data/data/problems/392.yml +22 -0
- data/data/problems/393.yml +12 -0
- data/data/problems/394.yml +22 -0
- data/data/problems/395.yml +19 -0
- data/data/problems/396.yml +28 -0
- data/data/problems/397.yml +20 -0
- data/data/problems/398.yml +13 -0
- data/data/problems/399.yml +22 -0
- data/data/problems/4.yml +8 -0
- data/data/problems/40.yml +18 -0
- data/data/problems/400.yml +18 -0
- data/data/problems/401.yml +11 -0
- data/data/problems/402.yml +25 -0
- data/data/problems/403.yml +19 -0
- data/data/problems/404.yml +21 -0
- data/data/problems/405.yml +15 -0
- data/data/problems/406.yml +46 -0
- data/data/problems/407.yml +20 -0
- data/data/problems/408.yml +14 -0
- data/data/problems/409.yml +12 -0
- data/data/problems/41.yml +8 -0
- data/data/problems/410.yml +19 -0
- data/data/problems/411.yml +23 -0
- data/data/problems/412.yml +19 -0
- data/data/problems/413.yml +13 -0
- data/data/problems/414.yml +40 -0
- data/data/problems/415.yml +19 -0
- data/data/problems/416.yml +13 -0
- data/data/problems/417.yml +21 -0
- data/data/problems/418.yml +17 -0
- data/data/problems/419.yml +22 -0
- data/data/problems/42.yml +14 -0
- data/data/problems/420.yml +13 -0
- data/data/problems/421.yml +29 -0
- data/data/problems/422.yml +22 -0
- data/data/problems/423.yml +22 -0
- data/data/problems/424.yml +37 -0
- data/data/problems/425.yml +16 -0
- data/data/problems/426.yml +29 -0
- data/data/problems/427.yml +18 -0
- data/data/problems/428.yml +32 -0
- data/data/problems/429.yml +10 -0
- data/data/problems/43.yml +17 -0
- data/data/problems/430.yml +20 -0
- data/data/problems/431.yml +33 -0
- data/data/problems/432.yml +13 -0
- data/data/problems/433.yml +18 -0
- data/data/problems/434.yml +32 -0
- data/data/problems/435.yml +21 -0
- data/data/problems/436.yml +21 -0
- data/data/problems/437.yml +22 -0
- data/data/problems/438.yml +29 -0
- data/data/problems/439.yml +17 -0
- data/data/problems/44.yml +16 -0
- data/data/problems/440.yml +21 -0
- data/data/problems/441.yml +23 -0
- data/data/problems/442.yml +9 -0
- data/data/problems/443.yml +13 -0
- data/data/problems/444.yml +28 -0
- data/data/problems/445.yml +37 -0
- data/data/problems/446.yml +29 -0
- data/data/problems/447.yml +31 -0
- data/data/problems/448.yml +14 -0
- data/data/problems/449.yml +17 -0
- data/data/problems/45.yml +15 -0
- data/data/problems/450.yml +26 -0
- data/data/problems/451.yml +15 -0
- data/data/problems/452.yml +8 -0
- data/data/problems/453.yml +16 -0
- data/data/problems/454.yml +17 -0
- data/data/problems/455.yml +16 -0
- data/data/problems/456.yml +15 -0
- data/data/problems/46.yml +18 -0
- data/data/problems/47.yml +21 -0
- data/data/problems/48.yml +7 -0
- data/data/problems/49.yml +10 -0
- data/data/problems/5.yml +8 -0
- data/data/problems/50.yml +10 -0
- data/data/problems/51.yml +15 -0
- data/data/problems/52.yml +8 -0
- data/data/problems/53.yml +28 -0
- data/data/problems/54.yml +43 -0
- data/data/problems/55.yml +21 -0
- data/data/problems/56.yml +11 -0
- data/data/problems/57.yml +15 -0
- data/data/problems/58.yml +22 -0
- data/data/problems/59.yml +23 -0
- data/data/problems/6.yml +13 -0
- data/data/problems/60.yml +10 -0
- data/data/problems/61.yml +30 -0
- data/data/problems/62.yml +9 -0
- data/data/problems/63.yml +7 -0
- data/data/problems/64.yml +130 -0
- data/data/problems/65.yml +62 -0
- data/data/problems/66.yml +27 -0
- data/data/problems/67.yml +17 -0
- data/data/problems/68.yml +23 -0
- data/data/problems/69.yml +14 -0
- data/data/problems/7.yml +6 -0
- data/data/problems/70.yml +16 -0
- data/data/problems/71.yml +17 -0
- data/data/problems/72.yml +16 -0
- data/data/problems/73.yml +16 -0
- data/data/problems/74.yml +41 -0
- data/data/problems/75.yml +16 -0
- data/data/problems/76.yml +8 -0
- data/data/problems/77.yml +8 -0
- data/data/problems/78.yml +12 -0
- data/data/problems/79.yml +11 -0
- data/data/problems/8.yml +6 -0
- data/data/problems/80.yml +11 -0
- data/data/problems/81.yml +19 -0
- data/data/problems/82.yml +19 -0
- data/data/problems/83.yml +23 -0
- data/data/problems/84.yml +63 -0
- data/data/problems/85.yml +9 -0
- data/data/problems/86.yml +15 -0
- data/data/problems/87.yml +12 -0
- data/data/problems/88.yml +53 -0
- data/data/problems/89.yml +18 -0
- data/data/problems/9.yml +13 -0
- data/data/problems/90.yml +23 -0
- data/data/problems/91.yml +19 -0
- data/data/problems/92.yml +29 -0
- data/data/problems/93.yml +21 -0
- data/data/problems/94.yml +11 -0
- data/data/problems/95.yml +23 -0
- data/data/problems/96.yml +46 -0
- data/data/problems/97.yml +14 -0
- data/data/problems/98.yml +16 -0
- data/data/problems/99.yml +16 -0
- data/euler-manager.gemspec +31 -0
- data/euler-manager.sublime-project +12 -0
- data/example/1/README.md +6 -0
- data/example/1/ruby/1.rb +5 -0
- data/example/1/scala/1.scala +9 -0
- data/example/2/README.md +9 -0
- data/example/2/python/2.py +5 -0
- data/example/2/python/euler.py +0 -0
- data/example/Eulerfile.rb +87 -0
- data/example/README.md +26 -0
- data/example/lib/euler.py +0 -0
- data/example/lib/euler.rb +0 -0
- data/example/lib/euler.scala +5 -0
- data/lib/euler.rb +190 -0
- data/lib/euler/errors.rb +7 -0
- data/lib/euler/languages.rb +12 -0
- data/lib/euler/languages/coffeescript.rb +25 -0
- data/lib/euler/languages/javascript.rb +25 -0
- data/lib/euler/languages/python.rb +27 -0
- data/lib/euler/languages/ruby.rb +25 -0
- data/lib/euler/languages/scala.rb +27 -0
- data/lib/euler/languages/templates/coffeescript.coffee +5 -0
- data/lib/euler/languages/templates/javascript.js +5 -0
- data/lib/euler/languages/templates/python.py +5 -0
- data/lib/euler/languages/templates/ruby.rb +5 -0
- data/lib/euler/languages/templates/scala.scala +9 -0
- data/lib/euler/problem.rb +60 -0
- data/lib/euler/solution.rb +98 -0
- data/lib/euler/version.rb +3 -0
- data/scripts/update_problems +68 -0
- data/spec/euler/problem_spec.rb +5 -0
- data/spec/euler/solution_spec.rb +69 -0
- data/spec/euler_spec.rb +27 -0
- data/spec/spec_helper.rb +3 -0
- metadata +644 -0
@@ -0,0 +1,9 @@
|
|
1
|
+
---
|
2
|
+
:id: 85
|
3
|
+
:name: Counting rectangles
|
4
|
+
:url: http://projecteuler.net/problem=85
|
5
|
+
:content: "\r\n<p>By counting carefully it can be seen that a rectangular grid measuring
|
6
|
+
3 by 2 contains eighteen rectangles:</p>\r\n<div style=\"text-align:center;\">\r\n<img
|
7
|
+
src=\"project/images/p_085.gif\" alt=\"\">\n</div>\r\n<p>Although there exists no
|
8
|
+
rectangular grid that contains exactly two million rectangles, find the area of
|
9
|
+
the grid with the nearest solution.</p>\r\n\r\n"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
:id: 86
|
3
|
+
:name: Cuboid route
|
4
|
+
:url: http://projecteuler.net/problem=86
|
5
|
+
:content: "\r\n<p>A spider, S, sits in one corner of a cuboid room, measuring 6 by
|
6
|
+
5 by 3, and a fly, F, sits in the opposite corner. By travelling on the surfaces
|
7
|
+
of the room the shortest \"straight line\" distance from S to F is 10 and the path
|
8
|
+
is shown on the diagram.</p>\r\n<div style=\"text-align:center;\">\r\n<img src=\"project/images/p_086.gif\"
|
9
|
+
alt=\"\"><br>\n</div>\r\n<p>However, there are up to three \"shortest\" path candidates
|
10
|
+
for any given cuboid and the shortest route doesn't always have integer length.</p>\r\n<p>By
|
11
|
+
considering all cuboid rooms with integer dimensions, up to a maximum size of M
|
12
|
+
by M by M, there are exactly 2060 cuboids for which the shortest route has integer
|
13
|
+
length when M=100, and this is the least value of M for which the number of solutions
|
14
|
+
first exceeds two thousand; the number of solutions is 1975 when M=99.</p>\r\n<p>Find
|
15
|
+
the least value of M such that the number of solutions first exceeds one million.</p>\r\n\r\n"
|
@@ -0,0 +1,12 @@
|
|
1
|
+
---
|
2
|
+
:id: 87
|
3
|
+
:name: Prime power triples
|
4
|
+
:url: http://projecteuler.net/problem=87
|
5
|
+
:content: "\r\n\n<p>The smallest number expressible as the sum of a prime square,
|
6
|
+
prime cube, and prime fourth power is 28. In fact, there are exactly four numbers
|
7
|
+
below fifty that can be expressed in such a way:</p>\n<p style=\"margin-left:50px;\">28
|
8
|
+
= 2<sup>2</sup> + 2<sup>3</sup> + 2<sup>4</sup><br>\n33 = 3<sup>2</sup> + 2<sup>3</sup>
|
9
|
+
+ 2<sup>4</sup><br>\n49 = 5<sup>2</sup> + 2<sup>3</sup> + 2<sup>4</sup><br>\n47
|
10
|
+
= 2<sup>2</sup> + 3<sup>3</sup> + 2<sup>4</sup></p>\n<p>How many numbers below fifty
|
11
|
+
million can be expressed as the sum of a prime square, prime cube, and prime fourth
|
12
|
+
power?</p>\n\r\n"
|
@@ -0,0 +1,53 @@
|
|
1
|
+
---
|
2
|
+
:id: 88
|
3
|
+
:name: Product-sum numbers
|
4
|
+
:url: http://projecteuler.net/problem=88
|
5
|
+
:content: "\r\n\n<p>A natural number, N, that can be written as the sum and product
|
6
|
+
of a given set of at least two natural numbers, {<i>a</i><sub>1</sub>, <i>a</i><sub>2</sub>,
|
7
|
+
... , <i>a</i><sub><i>k</i></sub>} is called a product-sum number: N = <i>a</i><sub>1</sub>
|
8
|
+
+ <i>a</i><sub>2</sub> + ... + <i>a</i><sub><i>k</i></sub> = <i>a</i><sub>1</sub><img
|
9
|
+
src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
|
10
|
+
style=\"vertical-align:middle;\"><i>a</i><sub>2</sub><img src=\"images/symbol_times.gif\"
|
11
|
+
width=\"9\" height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">
|
12
|
+
... <img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
|
13
|
+
style=\"vertical-align:middle;\"><i>a</i><sub><i>k</i></sub>.</p>\n<p>For example,
|
14
|
+
6 = 1 + 2 + 3 = 1 <img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\"
|
15
|
+
alt=\"×\" border=\"0\" style=\"vertical-align:middle;\"> 2 <img src=\"images/symbol_times.gif\"
|
16
|
+
width=\"9\" height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">
|
17
|
+
3.</p>\n<p>For a given set of size, <i>k</i>, we shall call the smallest N with
|
18
|
+
this property a minimal product-sum number. The minimal product-sum numbers for
|
19
|
+
sets of size, <i>k</i> = 2, 3, 4, 5, and 6 are as follows.</p>\n<p style=\"margin-left:50px;\"><i>k</i>=2:
|
20
|
+
4 = 2 <img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
|
21
|
+
style=\"vertical-align:middle;\"> 2 = 2 + 2<br><i>k</i>=3: 6 = 1 <img src=\"images/symbol_times.gif\"
|
22
|
+
width=\"9\" height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">
|
23
|
+
2 <img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
|
24
|
+
style=\"vertical-align:middle;\"> 3 = 1 + 2 + 3<br><i>k</i>=4: 8 = 1 <img src=\"images/symbol_times.gif\"
|
25
|
+
width=\"9\" height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">
|
26
|
+
1 <img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
|
27
|
+
style=\"vertical-align:middle;\"> 2 <img src=\"images/symbol_times.gif\" width=\"9\"
|
28
|
+
height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\"> 4 = 1 + 1
|
29
|
+
+ 2 + 4<br><i>k</i>=5: 8 = 1 <img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\"
|
30
|
+
alt=\"×\" border=\"0\" style=\"vertical-align:middle;\"> 1 <img src=\"images/symbol_times.gif\"
|
31
|
+
width=\"9\" height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">
|
32
|
+
2 <img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
|
33
|
+
style=\"vertical-align:middle;\"> 2 <img src=\"images/symbol_times.gif\" width=\"9\"
|
34
|
+
height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\"> 2 = 1 + 1
|
35
|
+
+ 2 + 2 + 2<br><i>k</i>=6: 12 = 1 <img src=\"images/symbol_times.gif\" width=\"9\"
|
36
|
+
height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\"> 1 <img src=\"images/symbol_times.gif\"
|
37
|
+
width=\"9\" height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">
|
38
|
+
1 <img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
|
39
|
+
style=\"vertical-align:middle;\"> 1 <img src=\"images/symbol_times.gif\" width=\"9\"
|
40
|
+
height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\"> 2 <img src=\"images/symbol_times.gif\"
|
41
|
+
width=\"9\" height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">
|
42
|
+
6 = 1 + 1 + 1 + 1 + 2 + 6</p>\n<p>Hence for 2<img src=\"images/symbol_le.gif\" width=\"10\"
|
43
|
+
height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><i>k</i><img
|
44
|
+
src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">6,
|
45
|
+
the sum of all the minimal product-sum numbers is 4+6+8+12 = 30; note that 8 is
|
46
|
+
only counted once in the sum.</p>\n<p>In fact, as the complete set of minimal product-sum
|
47
|
+
numbers for 2<img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\"
|
48
|
+
border=\"0\" style=\"vertical-align:middle;\"><i>k</i><img src=\"images/symbol_le.gif\"
|
49
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">12
|
50
|
+
is {4, 6, 8, 12, 15, 16}, the sum is 61.</p>\n<p>What is the sum of all the minimal
|
51
|
+
product-sum numbers for 2<img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\"
|
52
|
+
alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><i>k</i><img src=\"images/symbol_le.gif\"
|
53
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">12000?</p>\n\r\n"
|
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
:id: 89
|
3
|
+
:name: Roman numerals
|
4
|
+
:url: http://projecteuler.net/problem=89
|
5
|
+
:content: "\r\n<p>The rules for writing Roman numerals allow for many ways of writing
|
6
|
+
each number (see <a href=\"about=roman_numerals\">About Roman Numerals...</a>).
|
7
|
+
However, there is always a \"best\" way of writing a particular number.</p>\r\n<p>For
|
8
|
+
example, the following represent all of the legitimate ways of writing the number
|
9
|
+
sixteen:</p>\r\n<p style=\"margin-left:50px;font-family:courier new,monospace;\">IIIIIIIIIIIIIIII<br>\r\nVIIIIIIIIIII<br>\r\nVVIIIIII<br>\r\nXIIIIII<br>\r\nVVVI<br>\r\nXVI</p>\r\n<p>The
|
10
|
+
last example being considered the most efficient, as it uses the least number of
|
11
|
+
numerals.</p>\r\n<p>The 11K text file, <a href=\"project/roman.txt\">roman.txt</a>
|
12
|
+
(right click and 'Save Link/Target As...'), contains one thousand numbers written
|
13
|
+
in valid, but not necessarily minimal, Roman numerals; that is, they are arranged
|
14
|
+
in descending units and obey the subtractive pair rule (see <a href=\"about=roman_numerals\">About
|
15
|
+
Roman Numerals...</a> for the definitive rules for this problem).</p>\r\n<p>Find
|
16
|
+
the number of characters saved by writing each of these in their minimal form.</p>\r\n<p
|
17
|
+
class=\"info\">Note: You can assume that all the Roman numerals in the file contain
|
18
|
+
no more than four consecutive identical units.</p>\r\n\r\n"
|
data/data/problems/9.yml
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
---
|
2
|
+
:id: 9
|
3
|
+
:name: Special Pythagorean triplet
|
4
|
+
:url: http://projecteuler.net/problem=9
|
5
|
+
:content: "\r\n<p>A Pythagorean triplet is a set of three natural numbers, <var>a</var>
|
6
|
+
<img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"<\" border=\"0\"
|
7
|
+
style=\"vertical-align:middle;\"><var>b</var> <img src=\"images/symbol_lt.gif\"
|
8
|
+
width=\"10\" height=\"10\" alt=\"<\" border=\"0\" style=\"vertical-align:middle;\"><var>c</var>,
|
9
|
+
for which,</p>\r\n<div style=\"text-align:center;\"> <var>a</var><sup>2</sup> +
|
10
|
+
<var>b</var><sup>2</sup> = <var>c</var><sup>2</sup>\n</div>\r\n<p>For example, 3<sup>2</sup>
|
11
|
+
+ 4<sup>2</sup> = 9 + 16 = 25 = 5<sup>2</sup>.</p>\r\n<p>There exists exactly one
|
12
|
+
Pythagorean triplet for which <var>a</var> + <var>b</var> + <var>c</var> = 1000.<br>Find
|
13
|
+
the product <var>abc</var>.</p>\r\n\r\n"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
---
|
2
|
+
:id: 90
|
3
|
+
:name: Cube digit pairs
|
4
|
+
:url: http://projecteuler.net/problem=90
|
5
|
+
:content: "\r\n<p>Each of the six faces on a cube has a different digit (0 to 9) written
|
6
|
+
on it; the same is done to a second cube. By placing the two cubes side-by-side
|
7
|
+
in different positions we can form a variety of 2-digit numbers.</p>\r\n\r\n<p>For
|
8
|
+
example, the square number 64 could be formed:</p>\r\n\r\n<div style=\"text-align:center;\">\r\n<img
|
9
|
+
src=\"project/images/p_090.gif\" alt=\"\"><br>\n</div>\r\n\r\n<p>In fact, by carefully
|
10
|
+
choosing the digits on both cubes it is possible to display all of the square numbers
|
11
|
+
below one-hundred: 01, 04, 09, 16, 25, 36, 49, 64, and 81.</p>\r\n\r\n<p>For example,
|
12
|
+
one way this can be achieved is by placing {0, 5, 6, 7, 8, 9} on one cube and {1,
|
13
|
+
2, 3, 4, 8, 9} on the other cube.</p>\r\n\r\n<p>However, for this problem we shall
|
14
|
+
allow the 6 or 9 to be turned upside-down so that an arrangement like {0, 5, 6,
|
15
|
+
7, 8, 9} and {1, 2, 3, 4, 6, 7} allows for all nine square numbers to be displayed;
|
16
|
+
otherwise it would be impossible to obtain 09.</p>\r\n\r\n<p>In determining a distinct
|
17
|
+
arrangement we are interested in the digits on each cube, not the order.</p>\r\n\r\n<p
|
18
|
+
style=\"margin-left:50px;\">{1, 2, 3, 4, 5, 6} is equivalent to {3, 6, 4, 1, 2,
|
19
|
+
5}<br>\r\n{1, 2, 3, 4, 5, 6} is distinct from {1, 2, 3, 4, 5, 9}</p>\r\n\r\n<p>But
|
20
|
+
because we are allowing 6 and 9 to be reversed, the two distinct sets in the last
|
21
|
+
example both represent the extended set {1, 2, 3, 4, 5, 6, 9} for the purpose of
|
22
|
+
forming 2-digit numbers.</p>\r\n\r\n<p>How many distinct arrangements of the two
|
23
|
+
cubes allow for all of the square numbers to be displayed?</p>\r\n"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
:id: 91
|
3
|
+
:name: Right triangles with integer coordinates
|
4
|
+
:url: http://projecteuler.net/problem=91
|
5
|
+
:content: "\r\n<p>The points P (<i>x</i><sub>1</sub>, <i>y</i><sub>1</sub>) and Q
|
6
|
+
(<i>x</i><sub>2</sub>, <i>y</i><sub>2</sub>) are plotted at integer co-ordinates
|
7
|
+
and are joined to the origin, O(0,0), to form ΔOPQ.</p>\r\n\r\n<div style=\"text-align:center;\">\r\n<img
|
8
|
+
src=\"project/images/p_091_1.gif\" alt=\"\"><br>\n</div>\r\n\r\n<p>There are exactly
|
9
|
+
fourteen triangles containing a right angle that can be formed when each co-ordinate
|
10
|
+
lies between 0 and 2 inclusive; that is,<br>0 <img src=\"images/symbol_le.gif\"
|
11
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><i>x</i><sub>1</sub>,
|
12
|
+
<i>y</i><sub>1</sub>, <i>x</i><sub>2</sub>, <i>y</i><sub>2</sub><img src=\"images/symbol_le.gif\"
|
13
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">
|
14
|
+
2.</p>\r\n\r\n<div style=\"text-align:center;\">\r\n<img src=\"project/images/p_091_2.gif\"
|
15
|
+
alt=\"\"><br>\n</div>\r\n\r\n<p>Given that 0 <img src=\"images/symbol_le.gif\" width=\"10\"
|
16
|
+
height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><i>x</i><sub>1</sub>,
|
17
|
+
<i>y</i><sub>1</sub>, <i>x</i><sub>2</sub>, <i>y</i><sub>2</sub><img src=\"images/symbol_le.gif\"
|
18
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">
|
19
|
+
50, how many right triangles can be formed?</p>\r\n"
|
@@ -0,0 +1,29 @@
|
|
1
|
+
---
|
2
|
+
:id: 92
|
3
|
+
:name: Square digit chains
|
4
|
+
:url: http://projecteuler.net/problem=92
|
5
|
+
:content: "\r\n\n<p>A number chain is created by continuously adding the square of
|
6
|
+
the digits in a number to form a new number until it has been seen before.</p>\n<p>For
|
7
|
+
example,</p>\n<p style=\"margin-left:50px;\">44 <img src=\"images/symbol_maps.gif\"
|
8
|
+
width=\"15\" height=\"7\" alt=\"→\" border=\"0\" style=\"vertical-align:middle;\">
|
9
|
+
32 <img src=\"images/symbol_maps.gif\" width=\"15\" height=\"7\" alt=\"→\" border=\"0\"
|
10
|
+
style=\"vertical-align:middle;\"> 13 <img src=\"images/symbol_maps.gif\" width=\"15\"
|
11
|
+
height=\"7\" alt=\"→\" border=\"0\" style=\"vertical-align:middle;\"> 10 <img src=\"images/symbol_maps.gif\"
|
12
|
+
width=\"15\" height=\"7\" alt=\"→\" border=\"0\" style=\"vertical-align:middle;\"><b>1</b>
|
13
|
+
<img src=\"images/symbol_maps.gif\" width=\"15\" height=\"7\" alt=\"→\" border=\"0\"
|
14
|
+
style=\"vertical-align:middle;\"><b>1</b><br>\n85 <img src=\"images/symbol_maps.gif\"
|
15
|
+
width=\"15\" height=\"7\" alt=\"→\" border=\"0\" style=\"vertical-align:middle;\"><b>89</b>
|
16
|
+
<img src=\"images/symbol_maps.gif\" width=\"15\" height=\"7\" alt=\"→\" border=\"0\"
|
17
|
+
style=\"vertical-align:middle;\"> 145 <img src=\"images/symbol_maps.gif\" width=\"15\"
|
18
|
+
height=\"7\" alt=\"→\" border=\"0\" style=\"vertical-align:middle;\"> 42 <img src=\"images/symbol_maps.gif\"
|
19
|
+
width=\"15\" height=\"7\" alt=\"→\" border=\"0\" style=\"vertical-align:middle;\">
|
20
|
+
20 <img src=\"images/symbol_maps.gif\" width=\"15\" height=\"7\" alt=\"→\" border=\"0\"
|
21
|
+
style=\"vertical-align:middle;\"> 4 <img src=\"images/symbol_maps.gif\" width=\"15\"
|
22
|
+
height=\"7\" alt=\"→\" border=\"0\" style=\"vertical-align:middle;\"> 16 <img src=\"images/symbol_maps.gif\"
|
23
|
+
width=\"15\" height=\"7\" alt=\"→\" border=\"0\" style=\"vertical-align:middle;\">
|
24
|
+
37 <img src=\"images/symbol_maps.gif\" width=\"15\" height=\"7\" alt=\"→\" border=\"0\"
|
25
|
+
style=\"vertical-align:middle;\"> 58 <img src=\"images/symbol_maps.gif\" width=\"15\"
|
26
|
+
height=\"7\" alt=\"→\" border=\"0\" style=\"vertical-align:middle;\"><b>89</b></p>\n<p>Therefore
|
27
|
+
any chain that arrives at 1 or 89 will become stuck in an endless loop. What is
|
28
|
+
most amazing is that EVERY starting number will eventually arrive at 1 or 89.</p>\n<p>How
|
29
|
+
many starting numbers below ten million will arrive at 89?</p>\n\r\n"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
---
|
2
|
+
:id: 93
|
3
|
+
:name: Arithmetic expressions
|
4
|
+
:url: http://projecteuler.net/problem=93
|
5
|
+
:content: "\r\n\n<p>By using each of the digits from the set, {1, 2, 3, 4}, exactly
|
6
|
+
once, and making use of the four arithmetic operations (+, <img src=\"images/symbol_minus.gif\"
|
7
|
+
width=\"9\" height=\"3\" alt=\"−\" border=\"0\" style=\"vertical-align:middle;\">,
|
8
|
+
*, /) and brackets/parentheses, it is possible to form different positive integer
|
9
|
+
targets.</p>\n<p>For example,</p>\n<p style=\"margin-left:50px;font-family:courier
|
10
|
+
new;\">8 = (4 * (1 + 3)) / 2<br>\n14 = 4 * (3 + 1 / 2)<br>\n19 = 4 * (2 + 3) <img
|
11
|
+
src=\"images/symbol_minus.gif\" width=\"9\" height=\"3\" alt=\"−\" border=\"0\"
|
12
|
+
style=\"vertical-align:middle;\"> 1<br>\n36 = 3 * 4 * (2 + 1)</p>\n<p>Note that
|
13
|
+
concatenations of the digits, like 12 + 34, are not allowed.</p>\n<p>Using the set,
|
14
|
+
{1, 2, 3, 4}, it is possible to obtain thirty-one different target numbers of which
|
15
|
+
36 is the maximum, and each of the numbers 1 to 28 can be obtained before encountering
|
16
|
+
the first non-expressible number.</p>\n<p>Find the set of four distinct digits,
|
17
|
+
<i>a</i> <img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"<\"
|
18
|
+
border=\"0\" style=\"vertical-align:middle;\"><i>b</i> &lt <i>c</i> <img src=\"images/symbol_lt.gif\"
|
19
|
+
width=\"10\" height=\"10\" alt=\"<\" border=\"0\" style=\"vertical-align:middle;\"><i>d</i>,
|
20
|
+
for which the longest set of consecutive positive integers, 1 to <i>n</i>, can be
|
21
|
+
obtained, giving your answer as a string: <i>abcd</i>.</p>\n\r\n"
|
@@ -0,0 +1,11 @@
|
|
1
|
+
---
|
2
|
+
:id: 94
|
3
|
+
:name: Almost equilateral triangles
|
4
|
+
:url: http://projecteuler.net/problem=94
|
5
|
+
:content: "\r\n<p>It is easily proved that no equilateral triangle exists with integral
|
6
|
+
length sides and integral area. However, the <i>almost equilateral triangle</i>
|
7
|
+
5-5-6 has an area of 12 square units.</p>\r\n<p>We shall define an <i>almost equilateral
|
8
|
+
triangle</i> to be a triangle for which two sides are equal and the third differs
|
9
|
+
by no more than one unit.</p>\r\n<p>Find the sum of the perimeters of all <i>almost
|
10
|
+
equilateral triangles</i> with integral side lengths and area and whose perimeters
|
11
|
+
do not exceed one billion (1,000,000,000).</p>\r\n\r\n"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
---
|
2
|
+
:id: 95
|
3
|
+
:name: Amicable chains
|
4
|
+
:url: http://projecteuler.net/problem=95
|
5
|
+
:content: "\r\n<p>The proper divisors of a number are all the divisors excluding the
|
6
|
+
number itself. For example, the proper divisors of 28 are 1, 2, 4, 7, and 14. As
|
7
|
+
the sum of these divisors is equal to 28, we call it a perfect number.</p>\r\n<p>Interestingly
|
8
|
+
the sum of the proper divisors of 220 is 284 and the sum of the proper divisors
|
9
|
+
of 284 is 220, forming a chain of two numbers. For this reason, 220 and 284 are
|
10
|
+
called an amicable pair.</p>\r\n<p>Perhaps less well known are longer chains. For
|
11
|
+
example, starting with 12496, we form a chain of five numbers:</p>\r\n<p style=\"text-align:center;\">12496
|
12
|
+
<img src=\"images/symbol_maps.gif\" width=\"15\" height=\"7\" alt=\"→\" border=\"0\"
|
13
|
+
style=\"vertical-align:middle;\"> 14288 <img src=\"images/symbol_maps.gif\" width=\"15\"
|
14
|
+
height=\"7\" alt=\"→\" border=\"0\" style=\"vertical-align:middle;\"> 15472 <img
|
15
|
+
src=\"images/symbol_maps.gif\" width=\"15\" height=\"7\" alt=\"→\" border=\"0\"
|
16
|
+
style=\"vertical-align:middle;\"> 14536 <img src=\"images/symbol_maps.gif\" width=\"15\"
|
17
|
+
height=\"7\" alt=\"→\" border=\"0\" style=\"vertical-align:middle;\"> 14264 (<img
|
18
|
+
src=\"images/symbol_maps.gif\" width=\"15\" height=\"7\" alt=\"→\" border=\"0\"
|
19
|
+
style=\"vertical-align:middle;\"> 12496 <img src=\"images/symbol_maps.gif\" width=\"15\"
|
20
|
+
height=\"7\" alt=\"→\" border=\"0\" style=\"vertical-align:middle;\"> ...)</p>\r\n<p>Since
|
21
|
+
this chain returns to its starting point, it is called an amicable chain.</p>\r\n<p>Find
|
22
|
+
the smallest member of the longest amicable chain with no element exceeding one
|
23
|
+
million.</p>\r\n\r\n"
|
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
:id: 96
|
3
|
+
:name: Su Doku
|
4
|
+
:url: http://projecteuler.net/problem=96
|
5
|
+
:content: "\r\n<p>Su Doku (Japanese meaning <i>number place</i>) is the name given
|
6
|
+
to a popular puzzle concept. Its origin is unclear, but credit must be attributed
|
7
|
+
to Leonhard Euler who invented a similar, and much more difficult, puzzle idea called
|
8
|
+
Latin Squares. The objective of Su Doku puzzles, however, is to replace the blanks
|
9
|
+
(or zeros) in a 9 by 9 grid in such that each row, column, and 3 by 3 box contains
|
10
|
+
each of the digits 1 to 9. Below is an example of a typical starting puzzle grid
|
11
|
+
and its solution grid.</p>\r\n<div style=\"text-align:center;\">\r\n<table border=\"0\"
|
12
|
+
cellpadding=\"0\" cellspacing=\"0\" align=\"center\"><tr>\n<td>\r\n<table cellpadding=\"5\"
|
13
|
+
cellspacing=\"0\" border=\"1\">\n<tr>\n<td style=\"font-family:courier new;font-size:14pt;\">0
|
14
|
+
0 3<br>9 0 0<br>0 0 1</td>\r\n<td style=\"font-family:courier new;font-size:14pt;\">0
|
15
|
+
2 0<br>3 0 5<br>8 0 6</td>\r\n<td style=\"font-family:courier new;font-size:14pt;\">6
|
16
|
+
0 0<br>0 0 1<br>4 0 0</td>\r\n</tr>\n<tr>\n<td style=\"font-family:courier new;font-size:14pt;\">0
|
17
|
+
0 8<br>7 0 0<br>0 0 6</td>\r\n<td style=\"font-family:courier new;font-size:14pt;\">1
|
18
|
+
0 2<br>0 0 0<br>7 0 8</td>\r\n<td style=\"font-family:courier new;font-size:14pt;\">9
|
19
|
+
0 0<br>0 0 8<br>2 0 0</td>\r\n</tr>\n<tr>\n<td style=\"font-family:courier new;font-size:14pt;\">0
|
20
|
+
0 2<br>8 0 0<br>0 0 5</td>\r\n<td style=\"font-family:courier new;font-size:14pt;\">6
|
21
|
+
0 9<br>2 0 3<br>0 1 0</td>\r\n<td style=\"font-family:courier new;font-size:14pt;\">5
|
22
|
+
0 0<br>0 0 9<br>3 0 0</td>\r\n</tr>\n</table>\n</td>\r\n<td width=\"50\">\n<img
|
23
|
+
src=\"images/spacer.gif\" width=\"50\" height=\"1\" alt=\"\"><br>\n</td>\r\n<td>\r\n<table
|
24
|
+
cellpadding=\"5\" cellspacing=\"0\" border=\"1\">\n<tr>\n<td style=\"font-family:courier
|
25
|
+
new;font-size:14pt;\">4 8 3<br>9 6 7<br>2 5 1</td>\r\n<td style=\"font-family:courier
|
26
|
+
new;font-size:14pt;\">9 2 1<br>3 4 5<br>8 7 6</td>\r\n<td style=\"font-family:courier
|
27
|
+
new;font-size:14pt;\">6 5 7<br>8 2 1<br>4 9 3</td>\r\n</tr>\n<tr>\n<td style=\"font-family:courier
|
28
|
+
new;font-size:14pt;\">5 4 8<br>7 2 9<br>1 3 6</td>\r\n<td style=\"font-family:courier
|
29
|
+
new;font-size:14pt;\">1 3 2<br>5 6 4<br>7 9 8</td>\r\n<td style=\"font-family:courier
|
30
|
+
new;font-size:14pt;\">9 7 6<br>1 3 8<br>2 4 5</td>\r\n</tr>\n<tr>\n<td style=\"font-family:courier
|
31
|
+
new;font-size:14pt;\">3 7 2<br>8 1 4<br>6 9 5</td>\r\n<td style=\"font-family:courier
|
32
|
+
new;font-size:14pt;\">6 8 9<br>2 5 3<br>4 1 7</td>\r\n<td style=\"font-family:courier
|
33
|
+
new;font-size:14pt;\">5 1 4<br>7 6 9<br>3 8 2</td>\r\n</tr>\n</table>\n</td>\r\n</tr></table>\n</div>\r\n<p>A
|
34
|
+
well constructed Su Doku puzzle has a unique solution and can be solved by logic,
|
35
|
+
although it may be necessary to employ \"guess and test\" methods in order to eliminate
|
36
|
+
options (there is much contested opinion over this). The complexity of the search
|
37
|
+
determines the difficulty of the puzzle; the example above is considered <i>easy</i>
|
38
|
+
because it can be solved by straight forward direct deduction.</p>\r\n<p>The 6K
|
39
|
+
text file, <a href=\"project/sudoku.txt\">sudoku.txt</a> (right click and 'Save
|
40
|
+
Link/Target As...'), contains fifty different Su Doku puzzles ranging in difficulty,
|
41
|
+
but all with unique solutions (the first puzzle in the file is the example above).</p>\r\n<p>By
|
42
|
+
solving all fifty puzzles find the sum of the 3-digit numbers found in the top left
|
43
|
+
corner of each solution grid; for example, 483 is the 3-digit number found in the
|
44
|
+
top left corner of the solution grid above.</p>\r\n<!--<p class='info'>Note: If
|
45
|
+
you're convinced that "guess and test" methods need not be employed please
|
46
|
+
tell how you would solve #6 and #46. (c;</p>-->\r\n\r\n"
|
@@ -0,0 +1,14 @@
|
|
1
|
+
---
|
2
|
+
:id: 97
|
3
|
+
:name: Large non-Mersenne prime
|
4
|
+
:url: http://projecteuler.net/problem=97
|
5
|
+
:content: "\r\n<p>The first known prime found to exceed one million digits was discovered
|
6
|
+
in 1999, and is a Mersenne prime of the form 2<sup>6972593</sup><img src=\"images/symbol_minus.gif\"
|
7
|
+
width=\"9\" height=\"3\" alt=\"−\" border=\"0\" style=\"vertical-align:middle;\">1;
|
8
|
+
it contains exactly 2,098,960 digits. Subsequently other Mersenne primes, of the
|
9
|
+
form 2<sup><i>p</i></sup><img src=\"images/symbol_minus.gif\" width=\"9\" height=\"3\"
|
10
|
+
alt=\"−\" border=\"0\" style=\"vertical-align:middle;\">1, have been found which
|
11
|
+
contain more digits.</p>\r\n<p>However, in 2004 there was found a massive non-Mersenne
|
12
|
+
prime which contains 2,357,207 digits: 28433<img src=\"images/symbol_times.gif\"
|
13
|
+
width=\"9\" height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">2<sup>7830457</sup>+1.</p>\r\n<p>Find
|
14
|
+
the last ten digits of this prime number.</p>\r\n\r\n"
|
@@ -0,0 +1,16 @@
|
|
1
|
+
---
|
2
|
+
:id: 98
|
3
|
+
:name: Anagramic squares
|
4
|
+
:url: http://projecteuler.net/problem=98
|
5
|
+
:content: "\r\n<p>By replacing each of the letters in the word CARE with 1, 2, 9,
|
6
|
+
and 6 respectively, we form a square number: 1296 = 36<sup>2</sup>. What is remarkable
|
7
|
+
is that, by using the same digital substitutions, the anagram, RACE, also forms
|
8
|
+
a square number: 9216 = 96<sup>2</sup>. We shall call CARE (and RACE) a square anagram
|
9
|
+
word pair and specify further that leading zeroes are not permitted, neither may
|
10
|
+
a different letter have the same digital value as another letter.</p>\r\n<p>Using
|
11
|
+
<a href=\"project/words.txt\">words.txt</a> (right click and 'Save Link/Target As...'),
|
12
|
+
a 16K text file containing nearly two-thousand common English words, find all the
|
13
|
+
square anagram word pairs (a palindromic word is NOT considered to be an anagram
|
14
|
+
of itself).</p>\r\n<p>What is the largest square number formed by any member of
|
15
|
+
such a pair?</p>\r\n<p class=\"info\">NOTE: All anagrams formed must be contained
|
16
|
+
in the given text file.</p>\r\n\r\n"
|
@@ -0,0 +1,16 @@
|
|
1
|
+
---
|
2
|
+
:id: 99
|
3
|
+
:name: Largest exponential
|
4
|
+
:url: http://projecteuler.net/problem=99
|
5
|
+
:content: "\r\n\n<p>Comparing two numbers written in index form like 2<sup>11</sup>
|
6
|
+
and 3<sup>7</sup> is not difficult, as any calculator would confirm that 2<sup>11</sup>
|
7
|
+
= 2048 <img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"<\"
|
8
|
+
border=\"0\" style=\"vertical-align:middle;\"> 3<sup>7</sup> = 2187.</p>\n<p>However,
|
9
|
+
confirming that 632382<sup>518061</sup><img src=\"images/symbol_gt.gif\" width=\"10\"
|
10
|
+
height=\"10\" alt=\">\" border=\"0\" style=\"vertical-align:middle;\"> 519432<sup>525806</sup>
|
11
|
+
would be much more difficult, as both numbers contain over three million digits.</p>\n<p>Using
|
12
|
+
<a href=\"project/base_exp.txt\">base_exp.txt</a> (right click and 'Save Link/Target
|
13
|
+
As...'), a 22K text file containing one thousand lines with a base/exponent pair
|
14
|
+
on each line, determine which line number has the greatest numerical value.</p>\n<p
|
15
|
+
class=\"info\">NOTE: The first two lines in the file represent the numbers in the
|
16
|
+
example given above.</p>\n\r\n"
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'euler/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'euler-manager'
|
8
|
+
spec.version = Euler::VERSION
|
9
|
+
spec.authors = ['William Yaworsky']
|
10
|
+
spec.email = ['wj.px01@gmail.com']
|
11
|
+
spec.summary = %q{Manage and test project Euler problems from your command line.}
|
12
|
+
# spec.description = %q{This gem provides a framework for solving project Euler problems. You can test}
|
13
|
+
spec.homepage = 'https://github.com/yaworsw/euler-manager'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_dependency 'commander'
|
22
|
+
spec.add_dependency 'colorize'
|
23
|
+
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.5'
|
25
|
+
spec.add_development_dependency 'rake'
|
26
|
+
|
27
|
+
spec.add_development_dependency 'rspec'
|
28
|
+
spec.add_development_dependency 'fakefs', '~> 0.5.2'
|
29
|
+
|
30
|
+
spec.add_development_dependency 'nokogiri'
|
31
|
+
end
|
data/example/1/README.md
ADDED
data/example/1/ruby/1.rb
ADDED
data/example/2/README.md
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# [Even Fibonacci numbers](http://projecteuler.net/problem=2)
|
2
|
+
|
3
|
+
|
4
|
+
<p>Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:</p>
|
5
|
+
<p style="text-align:center;">1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...</p>
|
6
|
+
<p>By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.</p>
|
7
|
+
<!--
|
8
|
+
Note: This problem has been changed recently, please check that you are using the right parameters.
|
9
|
+
-->
|