euler-manager 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- 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,7 @@
|
|
1
|
+
---
|
2
|
+
:id: 48
|
3
|
+
:name: Self powers
|
4
|
+
:url: http://projecteuler.net/problem=48
|
5
|
+
:content: "\r\n\n<p>The series, 1<sup>1</sup> + 2<sup>2</sup> + 3<sup>3</sup> + ...
|
6
|
+
+ 10<sup>10</sup> = 10405071317.</p>\n<p>Find the last ten digits of the series,
|
7
|
+
1<sup>1</sup> + 2<sup>2</sup> + 3<sup>3</sup> + ... + 1000<sup>1000</sup>.</p>\n\r\n"
|
@@ -0,0 +1,10 @@
|
|
1
|
+
---
|
2
|
+
:id: 49
|
3
|
+
:name: Prime permutations
|
4
|
+
:url: http://projecteuler.net/problem=49
|
5
|
+
:content: "\r\n<p>The arithmetic sequence, 1487, 4817, 8147, in which each of the
|
6
|
+
terms increases by 3330, is unusual in two ways: (i) each of the three terms are
|
7
|
+
prime, and, (ii) each of the 4-digit numbers are permutations of one another.</p>\r\n<p>There
|
8
|
+
are no arithmetic sequences made up of three 1-, 2-, or 3-digit primes, exhibiting
|
9
|
+
this property, but there is one other 4-digit increasing sequence.</p>\r\n<p>What
|
10
|
+
12-digit number do you form by concatenating the three terms in this sequence?</p>\r\n\r\n"
|
data/data/problems/5.yml
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
---
|
2
|
+
:id: 5
|
3
|
+
:name: Smallest multiple
|
4
|
+
:url: http://projecteuler.net/problem=5
|
5
|
+
:content: "\r\n<p>2520 is the smallest number that can be divided by each of the numbers
|
6
|
+
from 1 to 10 without any remainder.</p>\r\n<p>What is the smallest positive number
|
7
|
+
that is <dfn title=\"divisible with no remainder\">evenly divisible</dfn> by all
|
8
|
+
of the numbers from 1 to 20?</p>\r\n\r\n"
|
@@ -0,0 +1,10 @@
|
|
1
|
+
---
|
2
|
+
:id: 50
|
3
|
+
:name: Consecutive prime sum
|
4
|
+
:url: http://projecteuler.net/problem=50
|
5
|
+
:content: "\r\n\n<p>The prime 41, can be written as the sum of six consecutive primes:</p>\n<div
|
6
|
+
style=\"text-align:center;\">41 = 2 + 3 + 5 + 7 + 11 + 13</div>\n<p>This is the
|
7
|
+
longest sum of consecutive primes that adds to a prime below one-hundred.</p>\n<p>The
|
8
|
+
longest sum of consecutive primes below one-thousand that adds to a prime, contains
|
9
|
+
21 terms, and is equal to 953.</p>\n<p>Which prime, below one-million, can be written
|
10
|
+
as the sum of the most consecutive primes?</p>\n\r\n"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
:id: 51
|
3
|
+
:name: Prime digit replacements
|
4
|
+
:url: http://projecteuler.net/problem=51
|
5
|
+
:content: "\r\n<!--<p>By replacing the 1<sup>st</sup> digit of *57, it turns out that
|
6
|
+
six of the possible values: 157, 257, 457, 557, 757, and 857, are all prime.</p>
|
7
|
+
-->\r\n<p>By replacing the 1<sup>st</sup> digit of the 2-digit number *3, it turns
|
8
|
+
out that six of the nine possible values: 13, 23, 43, 53, 73, and 83, are all prime.</p>\r\n<p>By
|
9
|
+
replacing the 3<sup>rd</sup> and 4<sup>th</sup> digits of 56**3 with the same digit,
|
10
|
+
this 5-digit number is the first example having seven primes among the ten generated
|
11
|
+
numbers, yielding the family: 56003, 56113, 56333, 56443, 56663, 56773, and 56993.
|
12
|
+
Consequently 56003, being the first member of this family, is the smallest prime
|
13
|
+
with this property.</p>\r\n<p>Find the smallest prime which, by replacing part of
|
14
|
+
the number (not necessarily adjacent digits) with the same digit, is part of an
|
15
|
+
eight prime value family.</p>\r\n\r\n"
|
@@ -0,0 +1,8 @@
|
|
1
|
+
---
|
2
|
+
:id: 52
|
3
|
+
:name: Permuted multiples
|
4
|
+
:url: http://projecteuler.net/problem=52
|
5
|
+
:content: "\r\n\n<p>It can be seen that the number, 125874, and its double, 251748,
|
6
|
+
contain exactly the same digits, but in a different order.</p>\n<p>Find the smallest
|
7
|
+
positive integer, <i>x</i>, such that 2<i>x</i>, 3<i>x</i>, 4<i>x</i>, 5<i>x</i>,
|
8
|
+
and 6<i>x</i>, contain the same digits.</p>\n\r\n"
|
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
:id: 53
|
3
|
+
:name: Combinatoric selections
|
4
|
+
:url: http://projecteuler.net/problem=53
|
5
|
+
:content: "\r\n<p>There are exactly ten ways of selecting three from five, 12345:</p>\r\n<p
|
6
|
+
style=\"text-align:center;\">123, 124, 125, 134, 135, 145, 234, 235, 245, and 345</p>\r\n<p>In
|
7
|
+
combinatorics, we use the notation, <sup>5</sup>C<sub>3</sub> = 10.</p>\r\n<p>In
|
8
|
+
general,</p>\r\n<div style=\"text-align:center;\">\r\n<table><tr>\n<td>\n<sup><var>n</var></sup>C<sub><var>r</var></sub>
|
9
|
+
= </td>\r\n<td><div style=\"text-align:center;\">\n<var>n</var>!<br><span style=\"border-top:1px
|
10
|
+
solid #000;\"><var>r</var>!(<var>n<img src=\"images/symbol_minus.gif\" width=\"9\"
|
11
|
+
height=\"3\" alt=\"−\" border=\"0\" style=\"vertical-align:middle;\">r</var>)!</span>\n</div></td>\r\n<td>,where
|
12
|
+
<var>r</var> <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\"
|
13
|
+
border=\"0\" style=\"vertical-align:middle;\"><var>n</var>, <var>n</var>! = <var>n</var><img
|
14
|
+
src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
|
15
|
+
style=\"vertical-align:middle;\">(<var>n</var><img src=\"images/symbol_minus.gif\"
|
16
|
+
width=\"9\" height=\"3\" alt=\"−\" border=\"0\" style=\"vertical-align:middle;\">1)<img
|
17
|
+
src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
|
18
|
+
style=\"vertical-align:middle;\">...<img src=\"images/symbol_times.gif\" width=\"9\"
|
19
|
+
height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">3<img src=\"images/symbol_times.gif\"
|
20
|
+
width=\"9\" height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">2<img
|
21
|
+
src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
|
22
|
+
style=\"vertical-align:middle;\">1, and 0! = 1.</td>\r\n</tr></table>\n</div>\r\n<p>It
|
23
|
+
is not until <var>n</var> = 23, that a value exceeds one-million: <sup>23</sup>C<sub>10</sub>
|
24
|
+
= 1144066.</p>\r\n<p>How many, not necessarily distinct, values of <sup><var>n</var></sup>C<sub><var>r</var></sub>,
|
25
|
+
for 1 <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
|
26
|
+
style=\"vertical-align:middle;\"><var>n</var> <img src=\"images/symbol_le.gif\"
|
27
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">
|
28
|
+
100, are greater than one-million?</p>\r\n\r\n"
|
@@ -0,0 +1,43 @@
|
|
1
|
+
---
|
2
|
+
:id: 54
|
3
|
+
:name: Poker hands
|
4
|
+
:url: http://projecteuler.net/problem=54
|
5
|
+
:content: "\r\n<p>In the card game poker, a hand consists of five cards and are ranked,
|
6
|
+
from lowest to highest, in the following way:</p>\r\n<ul>\n<li>\n<b>High Card</b>:
|
7
|
+
Highest value card.</li>\r\n<li>\n<b>One Pair</b>: Two cards of the same value.</li>\r\n<li>\n<b>Two
|
8
|
+
Pairs</b>: Two different pairs.</li>\r\n<li>\n<b>Three of a Kind</b>: Three cards
|
9
|
+
of the same value.</li>\r\n<li>\n<b>Straight</b>: All cards are consecutive values.</li>\r\n<li>\n<b>Flush</b>:
|
10
|
+
All cards of the same suit.</li>\r\n<li>\n<b>Full House</b>: Three of a kind and
|
11
|
+
a pair.</li>\r\n<li>\n<b>Four of a Kind</b>: Four cards of the same value.</li>\r\n<li>\n<b>Straight
|
12
|
+
Flush</b>: All cards are consecutive values of same suit.</li>\r\n<li>\n<b>Royal
|
13
|
+
Flush</b>: Ten, Jack, Queen, King, Ace, in same suit.</li>\r\n</ul>\n<p>The cards
|
14
|
+
are valued in the order:<br>2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King, Ace.</p>\r\n<p>If
|
15
|
+
two players have the same ranked hands then the rank made up of the highest value
|
16
|
+
wins; for example, a pair of eights beats a pair of fives (see example 1 below).
|
17
|
+
But if two ranks tie, for example, both players have a pair of queens, then highest
|
18
|
+
cards in each hand are compared (see example 4 below); if the highest cards tie
|
19
|
+
then the next highest cards are compared, and so on.</p>\r\n<p>Consider the following
|
20
|
+
five hands dealt to two players:</p>\r\n<div style=\"text-align:center;\">\r\n<table>\n<tr>\n<td><b>Hand</b></td>\n<td> </td>\n<td><b>Player
|
21
|
+
1</b></td>\n<td> </td>\n<td><b>Player 2</b></td>\n<td> </td>\n<td><b>Winner</b></td>\r\n</tr>\n<tr>\n<td
|
22
|
+
style=\"vertical-align:top;\"><b>1</b></td>\n<td> </td>\n<td>5H 5C 6S 7S KD<br><div
|
23
|
+
class=\"info\">Pair of Fives</div>\n</td>\n<td> </td>\n<td>2C 3S 8S 8D TD<br><div
|
24
|
+
class=\"info\">Pair of Eights</div>\n</td>\n<td> </td>\n<td style=\"vertical-align:top;\">Player
|
25
|
+
2</td>\r\n</tr>\n<tr>\n<td style=\"vertical-align:top;\"><b>2</b></td>\n<td> </td>\n<td>5D
|
26
|
+
8C 9S JS AC<br><div class=\"info\">Highest card Ace</div>\n</td>\n<td> </td>\n<td>2C
|
27
|
+
5C 7D 8S QH<br><div class=\"info\">Highest card Queen</div>\n</td>\n<td> </td>\n<td
|
28
|
+
style=\"vertical-align:top;\">Player 1</td>\r\n</tr>\n<tr>\n<td style=\"vertical-align:top;\"><b>3</b></td>\n<td> </td>\n<td>2D
|
29
|
+
9C AS AH AC<br><div class=\"info\">Three Aces</div>\n</td>\n<td> </td>\n<td>3D 6D
|
30
|
+
7D TD QD<br><div class=\"info\">Flush with Diamonds</div>\n</td>\n<td> </td>\n<td
|
31
|
+
style=\"vertical-align:top;\">Player 2</td>\r\n</tr>\n<tr>\n<td style=\"vertical-align:top;\"><b>4</b></td>\n<td> </td>\n<td>4D
|
32
|
+
6S 9H QH QC<br><div class=\"info\">Pair of Queens<br>Highest card Nine</div>\n</td>\n<td> </td>\n<td>3D
|
33
|
+
6D 7H QD QS<br><div class=\"info\">Pair of Queens<br>Highest card Seven</div>\n</td>\n<td> </td>\n<td
|
34
|
+
style=\"vertical-align:top;\">Player 1</td>\r\n</tr>\n<tr>\n<td style=\"vertical-align:top;\"><b>5</b></td>\n<td> </td>\n<td>2H
|
35
|
+
2D 4C 4D 4S<br><div class=\"info\">Full House<br>With Three Fours</div>\n</td>\n<td> </td>\n<td>3C
|
36
|
+
3D 3S 9S 9D<br><div class=\"info\">Full House<br>with Three Threes</div>\n</td>\n<td> </td>\n<td
|
37
|
+
style=\"vertical-align:top;\">Player 1</td>\r\n</tr>\n</table>\n</div>\r\n<p>The
|
38
|
+
file, <a href=\"project/poker.txt\">poker.txt</a>, contains one-thousand random
|
39
|
+
hands dealt to two players. Each line of the file contains ten cards (separated
|
40
|
+
by a single space): the first five are Player 1's cards and the last five are Player
|
41
|
+
2's cards. You can assume that all hands are valid (no invalid characters or repeated
|
42
|
+
cards), each player's hand is in no specific order, and in each hand there is a
|
43
|
+
clear winner.</p>\r\n<p>How many hands does Player 1 win?</p>\r\n"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
---
|
2
|
+
:id: 55
|
3
|
+
:name: Lychrel numbers
|
4
|
+
:url: http://projecteuler.net/problem=55
|
5
|
+
:content: "\r\n<p>If we take 47, reverse and add, 47 + 74 = 121, which is palindromic.</p>\r\n<p>Not
|
6
|
+
all numbers produce palindromes so quickly. For example,</p>\r\n<p style=\"margin-left:50px;\">349
|
7
|
+
+ 943 = 1292,<br>\r\n1292 + 2921 = 4213<br>\r\n4213 + 3124 = 7337</p>\r\n<p>That
|
8
|
+
is, 349 took three iterations to arrive at a palindrome.</p>\r\n<p>Although no one
|
9
|
+
has proved it yet, it is thought that some numbers, like 196, never produce a palindrome.
|
10
|
+
A number that never forms a palindrome through the reverse and add process is called
|
11
|
+
a Lychrel number. Due to the theoretical nature of these numbers, and for the purpose
|
12
|
+
of this problem, we shall assume that a number is Lychrel until proven otherwise.
|
13
|
+
In addition you are given that for every number below ten-thousand, it will either
|
14
|
+
(i) become a palindrome in less than fifty iterations, or, (ii) no one, with all
|
15
|
+
the computing power that exists, has managed so far to map it to a palindrome. In
|
16
|
+
fact, 10677 is the first number to be shown to require over fifty iterations before
|
17
|
+
producing a palindrome: 4668731596684224866951378664 (53 iterations, 28-digits).</p>\r\n<p>Surprisingly,
|
18
|
+
there are palindromic numbers that are themselves Lychrel numbers; the first example
|
19
|
+
is 4994.</p>\r\n<p>How many Lychrel numbers are there below ten-thousand?</p>\r\n<p
|
20
|
+
class=\"info\">NOTE: Wording was modified slightly on 24 April 2007 to emphasise
|
21
|
+
the theoretical nature of Lychrel numbers.</p>\r\n"
|
@@ -0,0 +1,11 @@
|
|
1
|
+
---
|
2
|
+
:id: 56
|
3
|
+
:name: Powerful digit sum
|
4
|
+
:url: http://projecteuler.net/problem=56
|
5
|
+
:content: "\r\n\n<p>A googol (10<sup>100</sup>) is a massive number: one followed
|
6
|
+
by one-hundred zeros; 100<sup>100</sup> is almost unimaginably large: one followed
|
7
|
+
by two-hundred zeros. Despite their size, the sum of the digits in each number is
|
8
|
+
only 1.</p>\n<p>Considering natural numbers of the form, <i>a<sup>b</sup></i>, where
|
9
|
+
<i>a, b</i> <img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"<\"
|
10
|
+
border=\"0\" style=\"vertical-align:middle;\"> 100, what is the maximum digital
|
11
|
+
sum?</p>\n\r\n"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
:id: 57
|
3
|
+
:name: Square root convergents
|
4
|
+
:url: http://projecteuler.net/problem=57
|
5
|
+
:content: "\r\n<p>It is possible to show that the square root of two can be expressed
|
6
|
+
as an infinite continued fraction.</p>\r\n<p style=\"text-align:center;\"><img src=\"images/symbol_radic.gif\"
|
7
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">
|
8
|
+
2 = 1 + 1/(2 + 1/(2 + 1/(2 + ... ))) = 1.414213...</p>\r\n<p>By expanding this for
|
9
|
+
the first four iterations, we get:</p>\r\n<p>1 + 1/2 = 3/2 = 1.5<br>\r\n1 + 1/(2
|
10
|
+
+ 1/2) = 7/5 = 1.4<br>\r\n1 + 1/(2 + 1/(2 + 1/2)) = 17/12 = 1.41666...<br>\r\n1
|
11
|
+
+ 1/(2 + 1/(2 + 1/(2 + 1/2))) = 41/29 = 1.41379...<br></p>\r\n<p>The next three
|
12
|
+
expansions are 99/70, 239/169, and 577/408, but the eighth expansion, 1393/985,
|
13
|
+
is the first example where the number of digits in the numerator exceeds the number
|
14
|
+
of digits in the denominator.</p>\r\n<p>In the first one-thousand expansions, how
|
15
|
+
many fractions contain a numerator with more digits than denominator?</p>\r\n\r\n"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
---
|
2
|
+
:id: 58
|
3
|
+
:name: Spiral primes
|
4
|
+
:url: http://projecteuler.net/problem=58
|
5
|
+
:content: "\r\n<p>Starting with 1 and spiralling anticlockwise in the following way,
|
6
|
+
a square spiral with side length 7 is formed.</p>\r\n<p style=\"text-align:center;font-family:courier
|
7
|
+
new;\"><span style=\"color:#ff0000;font-family:courier new;\"><b>37</b></span> 36
|
8
|
+
35 34 33 32 <span style=\"color:#ff0000;font-family:courier new;\"><b>31</b></span><br>\r\n38
|
9
|
+
<span style=\"color:#ff0000;font-family:courier new;\"><b>17</b></span> 16 15 14
|
10
|
+
<span style=\"color:#ff0000;font-family:courier new;\"><b>13</b></span> 30<br>\r\n39
|
11
|
+
18 <span style=\"color:#ff0000;font-family:courier new;\"> <b>5</b></span> 4 <span
|
12
|
+
style=\"color:#ff0000;font-family:courier new;\"> <b>3</b></span> 12 29<br>\r\n40
|
13
|
+
19 6 1 2 11 28<br>\r\n41 20 <span style=\"color:#ff0000;font-family:courier new;\"> <b>7</b></span>
|
14
|
+
8 9 10 27<br>\r\n42 21 22 23 24 25 26<br><span style=\"color:#ff0000;font-family:courier
|
15
|
+
new;\"><b>43</b></span> 44 45 46 47 48 49</p>\r\n<p>It is interesting to note that
|
16
|
+
the odd squares lie along the bottom right diagonal, but what is more interesting
|
17
|
+
is that 8 out of the 13 numbers lying along both diagonals are prime; that is, a
|
18
|
+
ratio of 8/13 <img src=\"images/symbol_asymp.gif\" width=\"11\" height=\"9\" alt=\"≈\"
|
19
|
+
border=\"0\" style=\"vertical-align:middle;\"> 62%.</p>\r\n<p>If one complete new
|
20
|
+
layer is wrapped around the spiral above, a square spiral with side length 9 will
|
21
|
+
be formed. If this process is continued, what is the side length of the square spiral
|
22
|
+
for which the ratio of primes along both diagonals first falls below 10%?</p>\r\n\r\n"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
---
|
2
|
+
:id: 59
|
3
|
+
:name: XOR decryption
|
4
|
+
:url: http://projecteuler.net/problem=59
|
5
|
+
:content: "\r\n\n<p>Each character on a computer is assigned a unique code and the
|
6
|
+
preferred standard is ASCII (American Standard Code for Information Interchange).
|
7
|
+
For example, uppercase A = 65, asterisk (*) = 42, and lowercase k = 107.</p>\n<p>A
|
8
|
+
modern encryption method is to take a text file, convert the bytes to ASCII, then
|
9
|
+
XOR each byte with a given value, taken from a secret key. The advantage with the
|
10
|
+
XOR function is that using the same encryption key on the cipher text, restores
|
11
|
+
the plain text; for example, 65 XOR 42 = 107, then 107 XOR 42 = 65.</p>\n<p>For
|
12
|
+
unbreakable encryption, the key is the same length as the plain text message, and
|
13
|
+
the key is made up of random bytes. The user would keep the encrypted message and
|
14
|
+
the encryption key in different locations, and without both \"halves\", it is impossible
|
15
|
+
to decrypt the message.</p>\n<p>Unfortunately, this method is impractical for most
|
16
|
+
users, so the modified method is to use a password as a key. If the password is
|
17
|
+
shorter than the message, which is likely, the key is repeated cyclically throughout
|
18
|
+
the message. The balance for this method is using a sufficiently long password key
|
19
|
+
for security, but short enough to be memorable.</p>\n<p>Your task has been made
|
20
|
+
easy, as the encryption key consists of three lower case characters. Using <a href=\"project/cipher1.txt\">cipher1.txt</a>
|
21
|
+
(right click and 'Save Link/Target As...'), a file containing the encrypted ASCII
|
22
|
+
codes, and the knowledge that the plain text must contain common English words,
|
23
|
+
decrypt the message and find the sum of the ASCII values in the original text.</p>\n\r\n"
|
data/data/problems/6.yml
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
---
|
2
|
+
:id: 6
|
3
|
+
:name: Sum square difference
|
4
|
+
:url: http://projecteuler.net/problem=6
|
5
|
+
:content: "\r\n<p>The sum of the squares of the first ten natural numbers is,</p>\r\n<div
|
6
|
+
style=\"text-align:center\">1<sup>2</sup> + 2<sup>2</sup> + ... + 10<sup>2</sup>
|
7
|
+
= 385</div>\r\n<p>The square of the sum of the first ten natural numbers is,</p>\r\n<div
|
8
|
+
style=\"text-align:center\">(1 + 2 + ... + 10)<sup>2</sup> = 55<sup>2</sup> = 3025</div>\r\n<p>Hence
|
9
|
+
the difference between the sum of the squares of the first ten natural numbers and
|
10
|
+
the square of the sum is 3025 <img src=\"images/symbol_minus.gif\" width=\"9\" height=\"3\"
|
11
|
+
alt=\"−\" border=\"0\" style=\"vertical-align:middle;\"> 385 = 2640.</p>\r\n<p>Find
|
12
|
+
the difference between the sum of the squares of the first one hundred natural numbers
|
13
|
+
and the square of the sum.</p>\r\n\r\n"
|
@@ -0,0 +1,10 @@
|
|
1
|
+
---
|
2
|
+
:id: 60
|
3
|
+
:name: Prime pair sets
|
4
|
+
:url: http://projecteuler.net/problem=60
|
5
|
+
:content: "\r\n\n<p>The primes 3, 7, 109, and 673, are quite remarkable. By taking
|
6
|
+
any two primes and concatenating them in any order the result will always be prime.
|
7
|
+
For example, taking 7 and 109, both 7109 and 1097 are prime. The sum of these four
|
8
|
+
primes, 792, represents the lowest sum for a set of four primes with this property.</p>\n<p>Find
|
9
|
+
the lowest sum for a set of five primes for which any two primes concatenate to
|
10
|
+
produce another prime.</p>\n\r\n"
|
@@ -0,0 +1,30 @@
|
|
1
|
+
---
|
2
|
+
:id: 61
|
3
|
+
:name: Cyclical figurate numbers
|
4
|
+
:url: http://projecteuler.net/problem=61
|
5
|
+
:content: "\r\n<p>Triangle, square, pentagonal, hexagonal, heptagonal, and octagonal
|
6
|
+
numbers are all figurate (polygonal) numbers and are generated by the following
|
7
|
+
formulae:</p>\r\n<table>\n<tr>\n<td>Triangle</td>\r\n<td> </td>\r\n<td>P<sub>3,<i>n</i></sub>=<i>n</i>(<i>n</i>+1)/2</td>\r\n<td> </td>\r\n<td>1,
|
8
|
+
3, 6, 10, 15, ...</td>\r\n</tr>\n<tr>\n<td>Square</td>\r\n<td> </td>\r\n<td>P<sub>4,<i>n</i></sub>=<i>n</i><sup>2</sup>\n</td>\r\n<td> </td>\r\n<td>1,
|
9
|
+
4, 9, 16, 25, ...</td>\r\n</tr>\n<tr>\n<td>Pentagonal</td>\r\n<td> </td>\r\n<td>P<sub>5,<i>n</i></sub>=<i>n</i>(3<i>n</i><img
|
10
|
+
src=\"images/symbol_minus.gif\" width=\"9\" height=\"3\" alt=\"−\" border=\"0\"
|
11
|
+
style=\"vertical-align:middle;\">1)/2</td>\r\n<td> </td>\r\n<td>1, 5, 12, 22, 35,
|
12
|
+
...</td>\r\n</tr>\n<tr>\n<td>Hexagonal</td>\r\n<td> </td>\r\n<td>P<sub>6,<i>n</i></sub>=<i>n</i>(2<i>n</i><img
|
13
|
+
src=\"images/symbol_minus.gif\" width=\"9\" height=\"3\" alt=\"−\" border=\"0\"
|
14
|
+
style=\"vertical-align:middle;\">1)</td>\r\n<td> </td>\r\n<td>1, 6, 15, 28, 45,
|
15
|
+
...</td>\r\n</tr>\n<tr>\n<td>Heptagonal</td>\r\n<td> </td>\r\n<td>P<sub>7,<i>n</i></sub>=<i>n</i>(5<i>n</i><img
|
16
|
+
src=\"images/symbol_minus.gif\" width=\"9\" height=\"3\" alt=\"−\" border=\"0\"
|
17
|
+
style=\"vertical-align:middle;\">3)/2</td>\r\n<td> </td>\r\n<td>1, 7, 18, 34, 55,
|
18
|
+
...</td>\r\n</tr>\n<tr>\n<td>Octagonal</td>\r\n<td> </td>\r\n<td>P<sub>8,<i>n</i></sub>=<i>n</i>(3<i>n</i><img
|
19
|
+
src=\"images/symbol_minus.gif\" width=\"9\" height=\"3\" alt=\"−\" border=\"0\"
|
20
|
+
style=\"vertical-align:middle;\">2)</td>\r\n<td> </td>\r\n<td>1, 8, 21, 40, 65,
|
21
|
+
...</td>\r\n</tr>\n</table>\n<p>The ordered set of three 4-digit numbers: 8128,
|
22
|
+
2882, 8281, has three interesting properties.</p>\r\n<ol>\n<li>The set is cyclic,
|
23
|
+
in that the last two digits of each number is the first two digits of the next number
|
24
|
+
(including the last number with the first).</li>\r\n<li>Each polygonal type: triangle
|
25
|
+
(P<sub>3,127</sub>=8128), square (P<sub>4,91</sub>=8281), and pentagonal (P<sub>5,44</sub>=2882),
|
26
|
+
is represented by a different number in the set.</li>\r\n<li>This is the only set
|
27
|
+
of 4-digit numbers with this property.</li>\r\n</ol>\n<p>Find the sum of the only
|
28
|
+
ordered set of six cyclic 4-digit numbers for which each polygonal type: triangle,
|
29
|
+
square, pentagonal, hexagonal, heptagonal, and octagonal, is represented by a different
|
30
|
+
number in the set.</p>\r\n\r\n"
|
@@ -0,0 +1,9 @@
|
|
1
|
+
---
|
2
|
+
:id: 62
|
3
|
+
:name: Cubic permutations
|
4
|
+
:url: http://projecteuler.net/problem=62
|
5
|
+
:content: "\r\n<p>The cube, 41063625 (345<sup>3</sup>), can be permuted to produce
|
6
|
+
two other cubes: 56623104 (384<sup>3</sup>) and 66430125 (405<sup>3</sup>). In fact,
|
7
|
+
41063625 is the smallest cube which has exactly three permutations of its digits
|
8
|
+
which are also cube.</p>\r\n<p>Find the smallest cube for which exactly five permutations
|
9
|
+
of its digits are cube.</p>\r\n\r\n"
|
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
:id: 63
|
3
|
+
:name: Powerful digit counts
|
4
|
+
:url: http://projecteuler.net/problem=63
|
5
|
+
:content: "\r\n\n<p>The 5-digit number, 16807=7<sup>5</sup>, is also a fifth power.
|
6
|
+
Similarly, the 9-digit number, 134217728=8<sup>9</sup>, is a ninth power.</p>\n<p>How
|
7
|
+
many <i>n</i>-digit positive integers exist which are also an <i>n</i>th power?</p>\n\r\n"
|
@@ -0,0 +1,130 @@
|
|
1
|
+
---
|
2
|
+
:id: 64
|
3
|
+
:name: Odd period square roots
|
4
|
+
:url: http://projecteuler.net/problem=64
|
5
|
+
:content: "\r\n<p>All square roots are periodic when written as continued fractions
|
6
|
+
and can be written in the form:</p>\r\n<div style=\"margin-left:20px;\">\r\n<table
|
7
|
+
border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n<td>\n<img src=\"images/symbol_radic.gif\"
|
8
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\"><var>N</var>
|
9
|
+
= <var>a</var><sub>0</sub> +</td>\r\n<td colspan=\"3\" style=\"border-bottom:1px
|
10
|
+
solid #000;\"><div style=\"text-align:center;\">1</div></td>\r\n</tr>\n<tr>\n<td> </td>\r\n<td>\n<var>a</var><sub>1</sub>
|
11
|
+
+</td>\r\n<td colspan=\"2\" style=\"border-bottom:1px solid #000;\"><div style=\"text-align:center;\">1</div></td>\r\n</tr>\n<tr>\n<td> </td>\r\n<td> </td>\r\n<td>\n<var>a</var><sub>2</sub>
|
12
|
+
+</td>\r\n<td style=\"border-bottom:1px solid #000;\"><div style=\"text-align:center;\">1</div></td>\r\n</tr>\n<tr>\n<td> </td>\r\n<td> </td>\r\n<td> </td>\r\n<td>\n<var>a</var><sub>3</sub>
|
13
|
+
+ ...</td>\r\n</tr>\n</table>\n</div>\r\n<p>For example, let us consider <img src=\"images/symbol_radic.gif\"
|
14
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">23:</p>\r\n<div
|
15
|
+
style=\"margin-left:20px;\">\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n<td>\n<img
|
16
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
17
|
+
style=\"vertical-align:middle;\">23 = 4 + <img src=\"images/symbol_radic.gif\" width=\"14\"
|
18
|
+
height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">23 — 4 = 4
|
19
|
+
+ </td>\r\n<td style=\"border-bottom:1px solid #000;\"><div style=\"text-align:center;\">1</div></td>\r\n<td> =
|
20
|
+
4 + </td>\r\n<td colspan=\"2\" style=\"border-bottom:1px solid #000;\"><div style=\"text-align:center;\">1</div></td>\r\n</tr>\n<tr>\n<td> </td>\r\n<td><div
|
21
|
+
style=\"text-align:center;\">1<br><span style=\"border-top:1px solid #000;\"><img
|
22
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
23
|
+
style=\"vertical-align:middle;\">23—4</span>\n</div></td>\r\n<td> </td>\r\n<td>1
|
24
|
+
+ </td>\r\n<td><div style=\"text-align:center;\">\n<span style=\"border-bottom:1px
|
25
|
+
solid #000;\"><img src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\"
|
26
|
+
border=\"0\" style=\"vertical-align:middle;\">23 – 3</span><br>7</div></td>\r\n</tr>\n</table>\n</div>\r\n<p>If
|
27
|
+
we continue we would get the following expansion:</p>\r\n<div style=\"margin-left:20px;\">\r\n<table
|
28
|
+
border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n<td>\n<img src=\"images/symbol_radic.gif\"
|
29
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">23
|
30
|
+
= 4 +</td>\r\n<td colspan=\"4\" style=\"border-bottom:1px solid #000;\"><div style=\"text-align:center;\">1</div></td>\r\n</tr>\n<tr>\n<td> </td>\r\n<td>1
|
31
|
+
+</td>\r\n<td colspan=\"3\" style=\"border-bottom:1px solid #000;\"><div style=\"text-align:center;\">1</div></td>\r\n</tr>\n<tr>\n<td> </td>\r\n<td> </td>\r\n<td>3
|
32
|
+
+</td>\r\n<td colspan=\"2\" style=\"border-bottom:1px solid #000;\"><div style=\"text-align:center;\">1</div></td>\r\n</tr>\n<tr>\n<td> </td>\r\n<td> </td>\r\n<td> </td>\r\n<td>1
|
33
|
+
+</td>\r\n<td style=\"border-bottom:1px solid #000;\"><div style=\"text-align:center;\">1</div></td>\r\n</tr>\n<tr>\n<td> </td>\r\n<td> </td>\r\n<td> </td>\r\n<td> </td>\r\n<td>8
|
34
|
+
+ ...</td>\r\n</tr>\n</table>\n</div>\r\n<p>The process can be summarised as follows:</p>\r\n<div
|
35
|
+
style=\"margin-left:20px;\">\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n<td>\n<var>a</var><sub>0</sub>
|
36
|
+
= 4,</td>\r\n<td> </td>\r\n<td><div style=\"text-align:center;\">1<br><span style=\"border-top:1px
|
37
|
+
solid #000;\"><img src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\"
|
38
|
+
border=\"0\" style=\"vertical-align:middle;\">23—4</span>\n</div></td>\r\n<td> = </td>\r\n<td><div
|
39
|
+
style=\"text-align:center;\">\n<span style=\"border-bottom:1px solid #000;\"><img
|
40
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
41
|
+
style=\"vertical-align:middle;\">23+4</span><br>7</div></td>\r\n<td> = 1 + </td>\r\n<td><div
|
42
|
+
style=\"text-align:center;\">\n<span style=\"border-bottom:1px solid #000;\"><img
|
43
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
44
|
+
style=\"vertical-align:middle;\">23—3</span><br>7</div></td>\r\n</tr>\n<tr>\n<td>\n<var>a</var><sub>1</sub>
|
45
|
+
= 1,</td>\r\n<td> </td>\r\n<td><div style=\"text-align:center;\">7<br><span style=\"border-top:1px
|
46
|
+
solid #000;\"><img src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\"
|
47
|
+
border=\"0\" style=\"vertical-align:middle;\">23—3</span>\n</div></td>\r\n<td> = </td>\r\n<td><div
|
48
|
+
style=\"text-align:center;\">\n<span style=\"border-bottom:1px solid #000;\">7(<img
|
49
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
50
|
+
style=\"vertical-align:middle;\">23+3)</span><br>14</div></td>\r\n<td> = 3 + </td>\r\n<td><div
|
51
|
+
style=\"text-align:center;\">\n<span style=\"border-bottom:1px solid #000;\"><img
|
52
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
53
|
+
style=\"vertical-align:middle;\">23—3</span><br>2</div></td>\r\n</tr>\n<tr>\n<td>\n<var>a</var><sub>2</sub>
|
54
|
+
= 3,</td>\r\n<td> </td>\r\n<td><div style=\"text-align:center;\">2<br><span style=\"border-top:1px
|
55
|
+
solid #000;\"><img src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\"
|
56
|
+
border=\"0\" style=\"vertical-align:middle;\">23—3</span>\n</div></td>\r\n<td> = </td>\r\n<td><div
|
57
|
+
style=\"text-align:center;\">\n<span style=\"border-bottom:1px solid #000;\">2(<img
|
58
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
59
|
+
style=\"vertical-align:middle;\">23+3)</span><br>14</div></td>\r\n<td> = 1 + </td>\r\n<td><div
|
60
|
+
style=\"text-align:center;\">\n<span style=\"border-bottom:1px solid #000;\"><img
|
61
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
62
|
+
style=\"vertical-align:middle;\">23—4</span><br>7</div></td>\r\n</tr>\n<tr>\n<td>\n<var>a</var><sub>3</sub>
|
63
|
+
= 1,</td>\r\n<td> </td>\r\n<td><div style=\"text-align:center;\">7<br><span style=\"border-top:1px
|
64
|
+
solid #000;\"><img src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\"
|
65
|
+
border=\"0\" style=\"vertical-align:middle;\">23—4</span>\n</div></td>\r\n<td> = </td>\r\n<td><div
|
66
|
+
style=\"text-align:center;\">\n<span style=\"border-bottom:1px solid #000;\">7(<img
|
67
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
68
|
+
style=\"vertical-align:middle;\">23+4)</span><br>7</div></td>\r\n<td> = 8 + </td>\r\n<td>\n<img
|
69
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
70
|
+
style=\"vertical-align:middle;\">23—4</td>\r\n</tr>\n<tr>\n<td>\n<var>a</var><sub>4</sub>
|
71
|
+
= 8,</td>\r\n<td> </td>\r\n<td><div style=\"text-align:center;\">1<br><span style=\"border-top:1px
|
72
|
+
solid #000;\"><img src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\"
|
73
|
+
border=\"0\" style=\"vertical-align:middle;\">23—4</span>\n</div></td>\r\n<td> = </td>\r\n<td><div
|
74
|
+
style=\"text-align:center;\">\n<span style=\"border-bottom:1px solid #000;\"><img
|
75
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
76
|
+
style=\"vertical-align:middle;\">23+4</span><br>7</div></td>\r\n<td> = 1 + </td>\r\n<td><div
|
77
|
+
style=\"text-align:center;\">\n<span style=\"border-bottom:1px solid #000;\"><img
|
78
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
79
|
+
style=\"vertical-align:middle;\">23—3</span><br>7</div></td>\r\n</tr>\n<tr>\n<td>\n<var>a</var><sub>5</sub>
|
80
|
+
= 1,</td>\r\n<td> </td>\r\n<td><div style=\"text-align:center;\">7<br><span style=\"border-top:1px
|
81
|
+
solid #000;\"><img src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\"
|
82
|
+
border=\"0\" style=\"vertical-align:middle;\">23—3</span>\n</div></td>\r\n<td> = </td>\r\n<td><div
|
83
|
+
style=\"text-align:center;\">\n<span style=\"border-bottom:1px solid #000;\">7(<img
|
84
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
85
|
+
style=\"vertical-align:middle;\">23+3)</span><br>14</div></td>\r\n<td> = 3 + </td>\r\n<td><div
|
86
|
+
style=\"text-align:center;\">\n<span style=\"border-bottom:1px solid #000;\"><img
|
87
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
88
|
+
style=\"vertical-align:middle;\">23—3</span><br>2</div></td>\r\n</tr>\n<tr>\n<td>\n<var>a</var><sub>6</sub>
|
89
|
+
= 3,</td>\r\n<td> </td>\r\n<td><div style=\"text-align:center;\">2<br><span style=\"border-top:1px
|
90
|
+
solid #000;\"><img src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\"
|
91
|
+
border=\"0\" style=\"vertical-align:middle;\">23—3</span>\n</div></td>\r\n<td> = </td>\r\n<td><div
|
92
|
+
style=\"text-align:center;\">\n<span style=\"border-bottom:1px solid #000;\">2(<img
|
93
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
94
|
+
style=\"vertical-align:middle;\">23+3)</span><br>14</div></td>\r\n<td> = 1 + </td>\r\n<td><div
|
95
|
+
style=\"text-align:center;\">\n<span style=\"border-bottom:1px solid #000;\"><img
|
96
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
97
|
+
style=\"vertical-align:middle;\">23—4</span><br>7</div></td>\r\n</tr>\n<tr>\n<td>\n<var>a</var><sub>7</sub>
|
98
|
+
= 1,</td>\r\n<td> </td>\r\n<td><div style=\"text-align:center;\">7<br><span style=\"border-top:1px
|
99
|
+
solid #000;\"><img src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\"
|
100
|
+
border=\"0\" style=\"vertical-align:middle;\">23—4</span>\n</div></td>\r\n<td> = </td>\r\n<td><div
|
101
|
+
style=\"text-align:center;\">\n<span style=\"border-bottom:1px solid #000;\">7(<img
|
102
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
103
|
+
style=\"vertical-align:middle;\">23+4)</span><br>7</div></td>\r\n<td> = 8 + </td>\r\n<td>\n<img
|
104
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
105
|
+
style=\"vertical-align:middle;\">23—4</td>\r\n</tr>\n</table>\n</div>\r\n<p>It can
|
106
|
+
be seen that the sequence is repeating. For conciseness, we use the notation <img
|
107
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
108
|
+
style=\"vertical-align:middle;\">23 = [4;(1,3,1,8)], to indicate that the block
|
109
|
+
(1,3,1,8) repeats indefinitely.</p>\r\n\r\n<p>The first ten continued fraction representations
|
110
|
+
of (irrational) square roots are:</p>\r\n<p style=\"margin-left:20px;\"><img src=\"images/symbol_radic.gif\"
|
111
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">2=[1;(2)],
|
112
|
+
period=1<br><img src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\"
|
113
|
+
border=\"0\" style=\"vertical-align:middle;\">3=[1;(1,2)], period=2<br><img src=\"images/symbol_radic.gif\"
|
114
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">5=[2;(4)],
|
115
|
+
period=1<br><img src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\"
|
116
|
+
border=\"0\" style=\"vertical-align:middle;\">6=[2;(2,4)], period=2<br><img src=\"images/symbol_radic.gif\"
|
117
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">7=[2;(1,1,1,4)],
|
118
|
+
period=4<br><img src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\"
|
119
|
+
border=\"0\" style=\"vertical-align:middle;\">8=[2;(1,4)], period=2<br><img src=\"images/symbol_radic.gif\"
|
120
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">10=[3;(6)],
|
121
|
+
period=1<br><img src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\"
|
122
|
+
border=\"0\" style=\"vertical-align:middle;\">11=[3;(3,6)], period=2<br><img src=\"images/symbol_radic.gif\"
|
123
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">12=
|
124
|
+
[3;(2,6)], period=2<br><img src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\"
|
125
|
+
alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">13=[3;(1,1,1,1,6)], period=5</p>\r\n<p>Exactly
|
126
|
+
four continued fractions, for <var>N</var> <img src=\"images/symbol_le.gif\" width=\"10\"
|
127
|
+
height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"> 13, have
|
128
|
+
an odd period.</p>\r\n<p>How many continued fractions for <var>N</var> <img src=\"images/symbol_le.gif\"
|
129
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">
|
130
|
+
10000 have an odd period?</p>\r\n"
|