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,21 @@
|
|
1
|
+
---
|
2
|
+
:id: 311
|
3
|
+
:name: Biclinic Integral Quadrilaterals
|
4
|
+
:url: http://projecteuler.net/problem=311
|
5
|
+
:content: "\r\n<p>ABCD is a convex, integer sided quadrilateral with 1 <img src=\"images/symbol_le.gif\"
|
6
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">
|
7
|
+
AB <img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"<\" border=\"0\"
|
8
|
+
style=\"vertical-align:middle;\"> BC <img src=\"images/symbol_lt.gif\" width=\"10\"
|
9
|
+
height=\"10\" alt=\"<\" border=\"0\" style=\"vertical-align:middle;\"> CD <img
|
10
|
+
src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"<\" border=\"0\"
|
11
|
+
style=\"vertical-align:middle;\"> AD.<br>\r\nBD has integer length. O is the midpoint
|
12
|
+
of BD. AO has integer length.<br>\r\nWe'll call ABCD a <i>biclinic integral quadrilateral</i>
|
13
|
+
if AO = CO <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\"
|
14
|
+
border=\"0\" style=\"vertical-align:middle;\"> BO = DO.<br></p>\r\n\r\n<p>For example,
|
15
|
+
the following quadrilateral is a biclinic integral quadrilateral:<br>\r\nAB = 19,
|
16
|
+
BC = 29, CD = 37, AD = 43, BD = 48 and AO = CO = 23.\r\n</p>\r\n\r\n<div align=\"center\"><img
|
17
|
+
src=\"project/images/p_311_biclinic.gif\"></div>\r\n\r\n<p>Let B(<var>N</var>) be
|
18
|
+
the number of distinct biclinic integral quadrilaterals ABCD that satisfy AB<sup>2</sup>+BC<sup>2</sup>+CD<sup>2</sup>+AD<sup>2</sup><img
|
19
|
+
src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>N</var>.<br>\r\nWe
|
20
|
+
can verify that B(10 000) = 49 and B(1 000 000) = 38239.\r\n</p>\r\n\r\n<p>Find
|
21
|
+
B(10 000 000 000).\r\n</p>\r\n\r\n"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
:id: 312
|
3
|
+
:name: "Cyclic paths on Sierpiński graphs\r\n"
|
4
|
+
:url: http://projecteuler.net/problem=312
|
5
|
+
:content: "\r\n<p>- A <b>Sierpiński graph</b> of order-1 (<var>S</var><sub>1</sub>)
|
6
|
+
is an equilateral triangle.<br>\r\n- <var>S</var><sub><var>n</var>+1</sub> is obtained
|
7
|
+
from <var>S</var><sub><var>n</var></sub> by positioning three copies of <var>S</var><sub><var>n</var></sub>
|
8
|
+
so that every pair of copies has one common corner.\r\n</p>\r\n\r\n<div align=\"center\"><img
|
9
|
+
src=\"project/images/p_312_sierpinskyAt.gif\"></div>\r\n\r\n<p>Let C(<var>n</var>)
|
10
|
+
be the number of cycles that pass exactly once through all the vertices of <var>S</var><sub><var>n</var></sub>.<br>\r\nFor
|
11
|
+
example, C(3) = 8 because eight such cycles can be drawn on <var>S</var><sub>3</sub>,
|
12
|
+
as shown below:\r\n</p>\r\n\r\n<div align=\"center\"><img src=\"project/images/p_312_sierpinsky8t.gif\"></div>\r\n\r\n<p>It
|
13
|
+
can also be verified that :<br>\r\nC(1) = C(2) = 1<br>\r\nC(5) = 71328803586048<br>\r\nC(10
|
14
|
+
000) mod 10<sup>8</sup> = 37652224<br>\r\nC(10 000) mod 13<sup>8</sup> = 617720485<br></p>\r\n\r\n<p>Find
|
15
|
+
C(C(C(10 000))) mod 13<sup>8</sup>.\r\n</p>\r\n\r\n\r\n"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
:id: 313
|
3
|
+
:name: Sliding game
|
4
|
+
:url: http://projecteuler.net/problem=313
|
5
|
+
:content: "\r\n<p>In a sliding game a counter may slide horizontally or vertically
|
6
|
+
into an empty space. The objective of the game is to move the red counter from the
|
7
|
+
top left corner of a grid to the bottom right corner; the space always starts in
|
8
|
+
the bottom right corner. For example, the following sequence of pictures show how
|
9
|
+
the game can be completed in five moves on a 2 by 2 grid.</p>\r\n\r\n<div align=\"center\"><img
|
10
|
+
src=\"project/images/p_313_sliding_game_1.gif\"></div>\r\n\r\n<p>Let S(m,n) represent
|
11
|
+
the minimum number of moves to complete the game on an m by n grid. For example,
|
12
|
+
it can be verified that S(5,4) = 25.</p>\r\n\r\n<div align=\"center\"><img src=\"project/images/p_313_sliding_game_2.gif\"></div>\r\n\r\n<p>There
|
13
|
+
are exactly 5482 grids for which S(m,n) = p<sup>2</sup>, where p <img src=\"images/symbol_lt.gif\"
|
14
|
+
width=\"10\" height=\"10\" alt=\"<\" border=\"0\" style=\"vertical-align:middle;\">
|
15
|
+
100 is prime.</p>\r\n\r\n<p>How many grids does S(m,n) = p<sup>2</sup>, where p
|
16
|
+
<img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"<\" border=\"0\"
|
17
|
+
style=\"vertical-align:middle;\"> 10<sup>6</sup> is prime?</p>\r\n"
|
@@ -0,0 +1,29 @@
|
|
1
|
+
---
|
2
|
+
:id: 314
|
3
|
+
:name: The Mouse on the Moon
|
4
|
+
:url: http://projecteuler.net/problem=314
|
5
|
+
:content: "\r\n<p>\r\nThe moon has been opened up, and land can be obtained for free,
|
6
|
+
but there is a catch. You have to build a wall around the land that you stake out,
|
7
|
+
and building a wall on the moon is expensive. Every country has been allotted a
|
8
|
+
500 m by 500 m square area, but they will possess only that area which they wall
|
9
|
+
in. 251001 posts have been placed in a rectangular grid with 1 meter spacing. The
|
10
|
+
wall must be a closed series of straight lines, each line running from post to post.\r\n</p>\r\n<p>\r\nThe
|
11
|
+
bigger countries of course have built a 2000 m wall enclosing the entire 250 000
|
12
|
+
m<sup>2</sup> area. The <a href=\"http://en.wikipedia.org/wiki/Grand_Fenwick\">Duchy
|
13
|
+
of Grand Fenwick</a>, has a tighter budget, and has asked you (their Royal Programmer)
|
14
|
+
to compute what shape would get best maximum enclosed-area/wall-length ratio.\r\n</p>\r\n<p>\r\nYou
|
15
|
+
have done some preliminary calculations on a sheet of paper.\r\nFor a 2000 meter
|
16
|
+
wall enclosing the 250 000 m<sup>2</sup> area the\r\nenclosed-area/wall-length ratio
|
17
|
+
is 125.<br>\r\nAlthough not allowed , but to get an idea if this is anything better:
|
18
|
+
\ if you place a circle inside the square area touching the four sides the area
|
19
|
+
will be equal to π*250<sup>2</sup> m<sup>2</sup> and the perimeter will be π*500
|
20
|
+
m, so the enclosed-area/wall-length ratio will also be 125.\r\n</p>\r\n<p>\r\nHowever,
|
21
|
+
if you cut off from the square four triangles with sides 75 m, 75 m and 75<img src=\"images/symbol_radic.gif\"
|
22
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">2
|
23
|
+
m the total area becomes 238750 m<sup>2</sup> and the perimeter becomes 1400+300<img
|
24
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
25
|
+
style=\"vertical-align:middle;\">2 m. So this gives an enclosed-area/wall-length
|
26
|
+
ratio of 130.87, which is significantly better.\r\n</p>\r\n<div align=\"center\"><img
|
27
|
+
src=\"project/images/p_314_landgrab.gif\"></div>\r\n<p>\r\nFind the maximum enclosed-area/wall-length
|
28
|
+
ratio.<br>\r\nGive your answer rounded to 8 places behind the decimal point in the
|
29
|
+
form abc.defghijk.\r\n</p>\r\n\r\n\r\n\r\n"
|
@@ -0,0 +1,49 @@
|
|
1
|
+
---
|
2
|
+
:id: 315
|
3
|
+
:name: Digital root clocks
|
4
|
+
:url: http://projecteuler.net/problem=315
|
5
|
+
:content: "\r\n<p></p>\n<div align=\"center\"><img src=\"project/images/p_315_clocks.gif\"></div>\r\n\r\n<p>Sam
|
6
|
+
and Max are asked to transform two digital clocks into two \"digital root\" clocks.<br>\r\nA
|
7
|
+
digital root clock is a digital clock that calculates digital roots step by step.</p>\r\n\r\n<p>When
|
8
|
+
a clock is fed a number, it will show it and then it will start the calculation,
|
9
|
+
showing all the intermediate values until it gets to the result.<br>\r\nFor example,
|
10
|
+
if the clock is fed the number 137, it will show: \"<b>137</b>\" <img src=\"images/symbol_maps.gif\"
|
11
|
+
width=\"15\" height=\"7\" alt=\"→\" border=\"0\" style=\"vertical-align:middle;\">
|
12
|
+
\"<b>11</b>\" <img src=\"images/symbol_maps.gif\" width=\"15\" height=\"7\" alt=\"→\"
|
13
|
+
border=\"0\" style=\"vertical-align:middle;\"> \"<b>2</b>\" and then it will go
|
14
|
+
black, waiting for the next number.</p>\r\n\r\n<p>Every digital number consists
|
15
|
+
of some light segments: three horizontal (top, middle, bottom) and four vertical
|
16
|
+
(top-left, top-right, bottom-left, bottom-right).<br>\r\nNumber \"<b>1</b>\" is
|
17
|
+
made of vertical top-right and bottom-right, number \"<b>4</b>\" is made by middle
|
18
|
+
horizontal and vertical top-left, top-right and bottom-right. Number \"<b>8</b>\"
|
19
|
+
lights them all.</p>\r\n\r\n<p>The clocks consume energy only when segments are
|
20
|
+
turned on/off.<br>\r\nTo turn on a \"<b>2</b>\" will cost 5 transitions, while a
|
21
|
+
\"<b>7</b>\" will cost only 4 transitions.</p>\r\n\r\n<p>Sam and Max built two different
|
22
|
+
clocks.</p>\r\n\r\n<p>Sam's clock is fed e.g. number 137: the clock shows \"<b>137</b>\",
|
23
|
+
then the panel is turned off, then the next number (\"<b>11</b>\") is turned on,
|
24
|
+
then the panel is turned off again and finally the last number (\"<b>2</b>\") is
|
25
|
+
turned on and, after some time, off.<br>\r\nFor the example, with number 137, Sam's
|
26
|
+
clock requires:<br></p>\n<table>\n<tr>\n<td>\"<b>137</b>\"</td>\r\n<td>:</td>\r\n<td>(2
|
27
|
+
+ 5 + 4) <img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\"
|
28
|
+
border=\"0\" style=\"vertical-align:middle;\"> 2 = 22 transitions (\"<b>137</b>\"
|
29
|
+
on/off).</td>\r\n</tr>\n<tr>\n<td>\"<b>11</b>\"</td>\r\n<td>:</td>\r\n<td>(2 + 2)
|
30
|
+
<img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
|
31
|
+
style=\"vertical-align:middle;\"> 2 = 8 transitions (\"<b>11</b>\" on/off).</td>\r\n</tr>\n<tr>\n<td>\"<b>2</b>\"</td>\r\n<td>:</td>\r\n<td>(5)
|
32
|
+
<img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
|
33
|
+
style=\"vertical-align:middle;\"> 2 = 10 transitions (\"<b>2</b>\" on/off).</td>\r\n</tr>\n</table>\r\nFor
|
34
|
+
a grand total of 40 transitions.\r\n\r\n<p>Max's clock works differently. Instead
|
35
|
+
of turning off the whole panel, it is smart enough to turn off only those segments
|
36
|
+
that won't be needed for the next number.<br>\r\nFor number 137, Max's clock requires:<br></p>\n<table>\n<tr>\n<td>\"<b>137</b>\"<br><br>\n</td>\r\n<td>:<br><br>\n</td>\r\n<td>2
|
37
|
+
+ 5 + 4 = 11 transitions (\"<b>137</b>\" on)<br>\r\n7 transitions (to turn off the
|
38
|
+
segments that are not needed for number \"<b>11</b>\").</td>\r\n</tr>\n<tr>\n<td>\"<b>11</b>\"<br><br><br>\n</td>\r\n<td>:<br><br><br>\n</td>\r\n<td>0
|
39
|
+
transitions (number \"<b>11</b>\" is already turned on correctly)<br>\r\n3 transitions
|
40
|
+
(to turn off the first \"<b>1</b>\" and the bottom part of the second \"<b>1</b>\";
|
41
|
+
<br>\r\nthe top part is common with number \"<b>2</b>\").</td>\r\n</tr>\n<tr>\n<td>\"<b>2</b>\"<br><br>\n</td>\r\n<td>:<br><br>\n</td>\r\n<td>4
|
42
|
+
tansitions (to turn on the remaining segments in order to get a \"<b>2</b>\")<br>\r\n5
|
43
|
+
transitions (to turn off number \"<b>2</b>\").</td>\r\n</tr>\n</table>\r\nFor a
|
44
|
+
grand total of 30 transitions.\r\n\r\n<p>Of course, Max's clock consumes less power
|
45
|
+
than Sam's one.<br>\r\nThe two clocks are fed all the prime numbers between A =
|
46
|
+
10<sup>7</sup> and B = 2<img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\"
|
47
|
+
alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">10<sup>7</sup>. <br>\r\nFind
|
48
|
+
the difference between the total number of transitions needed by Sam's clock and
|
49
|
+
that needed by Max's one.</p>\r\n\r\n"
|
@@ -0,0 +1,25 @@
|
|
1
|
+
---
|
2
|
+
:id: 316
|
3
|
+
:name: Numbers in decimal expansions
|
4
|
+
:url: http://projecteuler.net/problem=316
|
5
|
+
:content: "\r\n<p>Let <var>p</var> = <var>p<sub><font size=\"-2\">1</font></sub> p<sub><font
|
6
|
+
size=\"-2\">2</font></sub> p<sub><font size=\"-2\">3</font></sub></var> ... be an
|
7
|
+
infinite sequence of random digits, selected from {0,1,2,3,4,5,6,7,8,9} with equal
|
8
|
+
probability.<br>\r\nIt can be seen that <var>p</var> corresponds to the real number
|
9
|
+
0.<var>p<sub><font size=\"-2\">1</font></sub> p<sub><font size=\"-2\">2</font></sub>
|
10
|
+
p<sub><font size=\"-2\">3</font></sub></var> .... <br>\r\nIt can also be seen that
|
11
|
+
choosing a random real number from the interval [0,1) is equivalent to choosing
|
12
|
+
an infinite sequence of random digits selected from {0,1,2,3,4,5,6,7,8,9} with equal
|
13
|
+
probability.</p>\r\n\r\n<p>For any positive integer <var>n</var> with <var>d</var>
|
14
|
+
decimal digits, let <var>k</var> be the smallest index such that <br><var>p<sub><small>k</small>,
|
15
|
+
</sub></var><var>p<sub><small>k+1</small></sub></var>, ...<var>p<sub><small>k+d-1</small></sub></var>
|
16
|
+
are the decimal digits of <var>n</var>, in the same order.<br>\r\nAlso, let <var>g</var>(<var>n</var>)
|
17
|
+
be the expected value of <var>k</var>; it can be proven that <var>g</var>(<var>n</var>)
|
18
|
+
is always finite and, interestingly, always an integer number.</p>\r\n\r\n<p>For
|
19
|
+
example, if <var>n</var> = 535, then<br>\r\nfor <var>p</var> = 31415926<b>535</b>897....,
|
20
|
+
we get <var>k</var> = 9<br>\r\nfor <var>p</var> = 35528714365004956000049084876408468<b>535</b>4...,
|
21
|
+
we get <var>k</var> = 36<br>\r\netc and we find that <var>g</var>(535) = 1008.</p>\r\n\r\n<p>Given
|
22
|
+
that <img style=\"vertical-align:middle\" src=\"project/images/p_316_decexp1.gif\">,
|
23
|
+
find <img style=\"vertical-align:middle\" src=\"project/images/p_316_decexp2.gif\"></p>\r\n\r\n<u><i>Note</i></u>:
|
24
|
+
<img style=\"vertical-align:middle\" src=\"project/images/p_316_decexp3.gif\"> represents
|
25
|
+
the floor function.\r\n"
|
@@ -0,0 +1,11 @@
|
|
1
|
+
---
|
2
|
+
:id: 317
|
3
|
+
:name: Firecracker
|
4
|
+
:url: http://projecteuler.net/problem=317
|
5
|
+
:content: "\r\n<p>\r\nA firecracker explodes at a height of 100 m above level ground.
|
6
|
+
It breaks into a large number of very small fragments, which move in every direction;
|
7
|
+
all of them have the same initial velocity of 20 m/s.\r\n</p>\r\n<p>\r\nWe assume
|
8
|
+
that the fragments move without air resistance, in a uniform gravitational field
|
9
|
+
with g=9.81 m/s<sup>2</sup>.\r\n</p>\r\n<p>\r\nFind the volume (in m<sup>3</sup>)
|
10
|
+
of the region through which the fragments move before reaching the ground. \r\nGive
|
11
|
+
your answer rounded to four decimal places.\r\n</p>\r\n\r\n\r\n\r\n"
|
@@ -0,0 +1,61 @@
|
|
1
|
+
---
|
2
|
+
:id: 318
|
3
|
+
:name: 2011 nines
|
4
|
+
:url: http://projecteuler.net/problem=318
|
5
|
+
:content: "\r\n<p>\r\nConsider the real number <img src=\"images/symbol_radic.gif\"
|
6
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">2+<img
|
7
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
8
|
+
style=\"vertical-align:middle;\">3.<br>\r\nWhen we calculate the even powers of
|
9
|
+
<img src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
10
|
+
style=\"vertical-align:middle;\">2+<img src=\"images/symbol_radic.gif\" width=\"14\"
|
11
|
+
height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">3\r\nwe get:<br>\r\n(<img
|
12
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
13
|
+
style=\"vertical-align:middle;\">2+<img src=\"images/symbol_radic.gif\" width=\"14\"
|
14
|
+
height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">3)<sup>2</sup>
|
15
|
+
= 9.898979485566356...<br>\r\n(<img src=\"images/symbol_radic.gif\" width=\"14\"
|
16
|
+
height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">2+<img src=\"images/symbol_radic.gif\"
|
17
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">3)<sup>4</sup>
|
18
|
+
= 97.98979485566356...<br>\r\n(<img src=\"images/symbol_radic.gif\" width=\"14\"
|
19
|
+
height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">2+<img src=\"images/symbol_radic.gif\"
|
20
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">3)<sup>6</sup>
|
21
|
+
= 969.998969071069263...<br>\r\n(<img src=\"images/symbol_radic.gif\" width=\"14\"
|
22
|
+
height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">2+<img src=\"images/symbol_radic.gif\"
|
23
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">3)<sup>8</sup>
|
24
|
+
= 9601.99989585502907...<br>\r\n(<img src=\"images/symbol_radic.gif\" width=\"14\"
|
25
|
+
height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">2+<img src=\"images/symbol_radic.gif\"
|
26
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">3)<sup>10</sup>
|
27
|
+
= 95049.999989479221...<br>\r\n(<img src=\"images/symbol_radic.gif\" width=\"14\"
|
28
|
+
height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">2+<img src=\"images/symbol_radic.gif\"
|
29
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">3)<sup>12</sup>
|
30
|
+
= 940897.9999989371855...<br>\r\n(<img src=\"images/symbol_radic.gif\" width=\"14\"
|
31
|
+
height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">2+<img src=\"images/symbol_radic.gif\"
|
32
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">3)<sup>14</sup>
|
33
|
+
= 9313929.99999989263...<br>\r\n(<img src=\"images/symbol_radic.gif\" width=\"14\"
|
34
|
+
height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">2+<img src=\"images/symbol_radic.gif\"
|
35
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">3)<sup>16</sup>
|
36
|
+
= 92198401.99999998915...<br></p>\r\n<p>\r\nIt looks like that the number of consecutive
|
37
|
+
nines at the beginning of the fractional part of these powers is non-decreasing.<br>\r\nIn
|
38
|
+
fact it can be proven that the fractional part of (<img src=\"images/symbol_radic.gif\"
|
39
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">2+<img
|
40
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
41
|
+
style=\"vertical-align:middle;\">3)<sup>2n</sup> approaches 1 for large n.\r\n</p>\r\n<p>\r\nConsider
|
42
|
+
all real numbers of the form <img src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\"
|
43
|
+
alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">p+<img src=\"images/symbol_radic.gif\"
|
44
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">q
|
45
|
+
with p and q positive integers and p<img src=\"images/symbol_lt.gif\" width=\"10\"
|
46
|
+
height=\"10\" alt=\"<\" border=\"0\" style=\"vertical-align:middle;\">q, such
|
47
|
+
that the fractional part \r\nof (<img src=\"images/symbol_radic.gif\" width=\"14\"
|
48
|
+
height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">p+<img src=\"images/symbol_radic.gif\"
|
49
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">q)<sup>2n</sup>
|
50
|
+
approaches 1 for large n.\r\n</p>\r\n<p>\r\nLet C(p,q,n) be the number of consecutive
|
51
|
+
nines at the beginning of the fractional part of <br> (<img src=\"images/symbol_radic.gif\"
|
52
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\">p+<img
|
53
|
+
src=\"images/symbol_radic.gif\" width=\"14\" height=\"16\" alt=\"√\" border=\"0\"
|
54
|
+
style=\"vertical-align:middle;\">q)<sup>2n</sup>.\r\n</p>\r\n<p>\r\nLet N(p,q) be
|
55
|
+
the minimal value of n such that C(p,q,n) <img src=\"images/symbol_ge.gif\" width=\"10\"
|
56
|
+
height=\"12\" alt=\"≥\" border=\"0\" style=\"vertical-align:middle;\"> 2011.\r\n</p>\r\n<p>\r\nFind
|
57
|
+
<img src=\"images/symbol_sum.gif\" width=\"11\" height=\"14\" alt=\"∑\" border=\"0\"
|
58
|
+
style=\"vertical-align:middle;\">N(p,q) for p+q <img src=\"images/symbol_le.gif\"
|
59
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">
|
60
|
+
2011.\r\n</p>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
|
61
|
+
\r\n\r\n\r\n"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
---
|
2
|
+
:id: 319
|
3
|
+
:name: Bounded Sequences
|
4
|
+
:url: http://projecteuler.net/problem=319
|
5
|
+
:content: "\r\n<p>\r\nLet <var>x</var><sub>1</sub>, <var>x</var><sub>2</sub>,...,
|
6
|
+
<var>x<sub>n</sub></var> be a sequence of length <var>n</var> such that:\r\n</p>\n<ul>\n<li>\n<var>x</var><sub>1</sub>
|
7
|
+
= 2</li>\r\n<li>for all 1 <img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\"
|
8
|
+
alt=\"<\" border=\"0\" style=\"vertical-align:middle;\"><var>i</var> <img src=\"images/symbol_le.gif\"
|
9
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>n</var>
|
10
|
+
: <var>x</var><sub><var>i</var>-<i>1</i></sub><img src=\"images/symbol_lt.gif\"
|
11
|
+
width=\"10\" height=\"10\" alt=\"<\" border=\"0\" style=\"vertical-align:middle;\"><var>x<sub>i</sub></var>\n</li>\r\n<li>for
|
12
|
+
all <var>i</var> and <var>j</var> with 1 <img src=\"images/symbol_le.gif\" width=\"10\"
|
13
|
+
height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>i</var>,
|
14
|
+
<var>j</var> <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\"
|
15
|
+
border=\"0\" style=\"vertical-align:middle;\"><var>n</var> : (<var>x<sub>i</sub></var>)<var><sup>
|
16
|
+
j</sup></var> <img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"<\"
|
17
|
+
border=\"0\" style=\"vertical-align:middle;\"> (<var>x<sub>j</sub></var> + 1)<var><sup>i</sup></var>\n</li>\r\n</ul>\n<p>\r\nThere
|
18
|
+
are only five such sequences of length 2, namely:\r\n{2,4}, {2,5}, {2,6}, {2,7}
|
19
|
+
and {2,8}.<br>\r\nThere are 293 such sequences of length 5; three examples are given
|
20
|
+
below:<br>\r\n{2,5,11,25,55}, {2,6,14,36,88}, {2,8,22,64,181}.\r\n</p>\r\n<p>\r\nLet
|
21
|
+
<var>t</var>(<var>n</var>) denote the number of such sequences of length <var>n</var>.<br>\r\nYou
|
22
|
+
are given that <var>t</var>(10) = 86195 and <var>t</var>(20) = 5227991891.\r\n</p>\r\n<p>\r\nFind
|
23
|
+
<var>t</var>(10<sup>10</sup>) and give your answer modulo 10<sup>9</sup>.\r\n</p>\r\n\r\n\r\n"
|
@@ -0,0 +1,14 @@
|
|
1
|
+
---
|
2
|
+
:id: 32
|
3
|
+
:name: Pandigital products
|
4
|
+
:url: http://projecteuler.net/problem=32
|
5
|
+
:content: "\r\n<p>We shall say that an <var>n</var>-digit number is pandigital if
|
6
|
+
it makes use of all the digits 1 to <var>n</var> exactly once; for example, the
|
7
|
+
5-digit number, 15234, is 1 through 5 pandigital.</p>\r\n\r\n<p>The product 7254
|
8
|
+
is unusual, as the identity, 39 <img src=\"images/symbol_times.gif\" width=\"9\"
|
9
|
+
height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\"> 186 = 7254,
|
10
|
+
containing multiplicand, multiplier, and product is 1 through 9 pandigital.</p>\r\n\r\n<p>Find
|
11
|
+
the sum of all products whose multiplicand/multiplier/product identity can be written
|
12
|
+
as a 1 through 9 pandigital.</p>\r\n\r\n<div class=\"info\">HINT: Some products
|
13
|
+
can be obtained in more than one way so be sure to only include it once in your
|
14
|
+
sum.</div>\r\n\r\n"
|
@@ -0,0 +1,12 @@
|
|
1
|
+
---
|
2
|
+
:id: 320
|
3
|
+
:name: Factorials divisible by a huge integer
|
4
|
+
:url: http://projecteuler.net/problem=320
|
5
|
+
:content: "\r\n<p>\r\nLet N(<var>i</var>) be the smallest integer <var>n</var> such
|
6
|
+
that <var>n</var>! is divisible by (<var>i</var>!)<sup>1234567890</sup></p>\r\n<p>\r\nLet
|
7
|
+
S(<var>u</var>)=<img src=\"images/symbol_sum.gif\" width=\"11\" height=\"14\" alt=\"∑\"
|
8
|
+
border=\"0\" style=\"vertical-align:middle;\">N(<var>i</var>) for 10 <img src=\"images/symbol_le.gif\"
|
9
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>i</var>
|
10
|
+
<img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
|
11
|
+
style=\"vertical-align:middle;\"><var>u</var>.\r\n</p>\r\n<p>\r\nS(1000)=614538266565663.\r\n</p>\r\n<p>\r\nFind
|
12
|
+
S(1 000 000) mod 10<sup>18</sup>.\r\n</p>\r\n\r\n\r\n"
|
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
:id: 321
|
3
|
+
:name: Swapping Counters
|
4
|
+
:url: http://projecteuler.net/problem=321
|
5
|
+
:content: "\r\n<p>A horizontal row comprising of 2<var>n</var> + 1 squares has <var>n</var>
|
6
|
+
red counters placed at one end and <var>n</var> blue counters at the other end,
|
7
|
+
being separated by a single empty square in the centre. For example, when <var>n</var>
|
8
|
+
= 3.</p>\r\n\r\n<p></p>\n<div align=\"center\"><img src=\"project/images/p_321_swapping_counters_1.gif\"></div>\r\n\r\n<p>A
|
9
|
+
counter can move from one square to the next (slide) or can jump over another counter
|
10
|
+
(hop) as long as the square next to that counter is unoccupied.</p>\r\n\r\n<p></p>\n<div
|
11
|
+
align=\"center\"><img src=\"project/images/p_321_swapping_counters_2.gif\"></div>\r\n\r\n<p>Let
|
12
|
+
M(<var>n</var>) represent the minimum number of moves/actions to completely reverse
|
13
|
+
the positions of the coloured counters; that is, move all the red counters to the
|
14
|
+
right and all the blue counters to the left.</p>\r\n<p>It can be verified M(3) =
|
15
|
+
15, which also happens to be a triangle number.</p>\r\n\r\n<p>If we create a sequence
|
16
|
+
based on the values of <var>n</var> for which M(<var>n</var>) is a triangle number
|
17
|
+
then the first five terms would be:\r\n<br>1, 3, 10, 22, and 63, and their sum would
|
18
|
+
be 99.</p>\r\n\r\n<p>Find the sum of the first forty terms of this sequence.</p>\r\n"
|
@@ -0,0 +1,12 @@
|
|
1
|
+
---
|
2
|
+
:id: 322
|
3
|
+
:name: Binomial coefficients divisible by 10
|
4
|
+
:url: http://projecteuler.net/problem=322
|
5
|
+
:content: "\r\n<p>\r\nLet T(<var>m</var>, <var>n</var>) be the number of the binomial
|
6
|
+
coefficients <sup><var>i</var></sup>C<sub><var>n</var></sub> that are divisible
|
7
|
+
by 10 for <var>n</var> <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\"
|
8
|
+
alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>i</var> <img src=\"images/symbol_lt.gif\"
|
9
|
+
width=\"10\" height=\"10\" alt=\"<\" border=\"0\" style=\"vertical-align:middle;\"><var>m</var>(<var>i</var>,
|
10
|
+
<var>m</var> and <var>n</var> are positive integers).<br>\r\nYou are given that
|
11
|
+
T(10<sup>9</sup>, 10<sup>7</sup>-10) = 989697000.\r\n</p>\r\n<p>\r\nFind T(10<sup>18</sup>,
|
12
|
+
10<sup>12</sup>-10).\r\n</p>\r\n"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
:id: 323
|
3
|
+
:name: Bitwise-OR operations on random integers
|
4
|
+
:url: http://projecteuler.net/problem=323
|
5
|
+
:content: "\r\n<p>Let <var>y</var><sub>0</sub>, <var>y</var><sub>1</sub>, <var>y</var><sub>2</sub>,...
|
6
|
+
be a sequence of random unsigned 32 bit integers<br>\r\n(i.e. 0 <img src=\"images/symbol_le.gif\"
|
7
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>y<sub>i</sub></var>
|
8
|
+
<img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"<\" border=\"0\"
|
9
|
+
style=\"vertical-align:middle;\"> 2<sup>32</sup>, every value equally likely).</p>\r\n<p>For
|
10
|
+
the sequence <var>x<sub>i</sub></var> the following recursion is given:<br></p>\n<ul>\n<li>\n<var>x</var><sub>0</sub>
|
11
|
+
= 0 and</li>\r\n<li>\n<var>x<sub>i</sub></var> = <var>x</var><sub><var>i</var>-<i>1</i></sub><b>|</b>
|
12
|
+
<var>y</var><sub><var>i</var>-<i>1</i></sub>, for <var>i</var> <img src=\"images/symbol_gt.gif\"
|
13
|
+
width=\"10\" height=\"10\" alt=\">\" border=\"0\" style=\"vertical-align:middle;\">
|
14
|
+
0. ( <b>|</b> is the bitwise-OR operator)</li>\r\n</ul>\n<p>It can be seen that
|
15
|
+
eventually there will be an index N such that <var>x<sub>i</sub></var> = 2<sup>32</sup>
|
16
|
+
-1 (a bit-pattern of all ones) for all <var>i</var> <img src=\"images/symbol_ge.gif\"
|
17
|
+
width=\"10\" height=\"12\" alt=\"≥\" border=\"0\" style=\"vertical-align:middle;\">
|
18
|
+
N.</p>\r\n\r\n<p>Find the expected value of N. <br>\r\nGive your answer rounded
|
19
|
+
to 10 digits after the decimal point.</p>\r\n"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
:id: 324
|
3
|
+
:name: Building a tower
|
4
|
+
:url: http://projecteuler.net/problem=324
|
5
|
+
:content: "\r\n<p>Let <var>f</var>(<var>n</var>) represent the number of ways one
|
6
|
+
can fill a 3<img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\"
|
7
|
+
border=\"0\" style=\"vertical-align:middle;\">3<img src=\"images/symbol_times.gif\"
|
8
|
+
width=\"9\" height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\"><var>n</var>
|
9
|
+
tower with blocks of 2<img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\"
|
10
|
+
alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">1<img src=\"images/symbol_times.gif\"
|
11
|
+
width=\"9\" height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">1.
|
12
|
+
<br>You're allowed to rotate the blocks in any way you like; however, rotations,
|
13
|
+
reflections etc of the tower itself are counted as distinct.</p>\r\n<p>For example
|
14
|
+
(with <var>q</var> = 100000007) :<br><var>f</var>(2) = 229,<br><var>f</var>(4) =
|
15
|
+
117805,<br><var>f</var>(10) mod <var>q</var> = 96149360,<br><var>f</var>(10<sup>3</sup>)
|
16
|
+
mod <var>q</var> = 24806056,<br><var>f</var>(10<sup>6</sup>) mod <var>q</var> =
|
17
|
+
30808124.</p>\r\n\r\n<p>Find <var>f</var>(10<sup>10000</sup>) mod 100000007.</p>\r\n"
|
@@ -0,0 +1,25 @@
|
|
1
|
+
---
|
2
|
+
:id: 325
|
3
|
+
:name: Stone Game II
|
4
|
+
:url: http://projecteuler.net/problem=325
|
5
|
+
:content: "\r\n<p>\r\nA game is played with two piles of stones and two players. At
|
6
|
+
her turn, a player removes a number of stones from the larger pile. The number of
|
7
|
+
stones she removes must be a positive multiple of the number of stones in the smaller
|
8
|
+
pile.\r\n</p>\r\n\r\n<p>\r\nE.g., let the ordered pair(6,14) describe a configuration
|
9
|
+
with 6 stones in the smaller pile and 14 stones in the larger pile, then the first
|
10
|
+
player can remove 6 or 12 stones from the larger pile.\r\n</p>\r\n\r\n<p>\r\nThe
|
11
|
+
player taking all the stones from a pile wins the game.\r\n</p>\r\n\r\n<p>\r\nA
|
12
|
+
<i>winning configuration</i> is one where the first player can force a win. For
|
13
|
+
example, (1,5), (2,6) and (3,12) are winning configurations because the first player
|
14
|
+
can immediately remove all stones in the second pile.\r\n</p>\r\n\r\n<p>\r\nA <i>losing
|
15
|
+
configuration</i> is one where the second player can force a win, no matter what
|
16
|
+
the first player does. For example, (2,3) and (3,4) are losing configurations: any
|
17
|
+
legal move leaves a winning configuration for the second player.\r\n</p>\r\n\r\n<p>\r\nDefine
|
18
|
+
S(<var>N</var>) as the sum of (<var>x</var><sub><var>i</var></sub>+<var>y</var><sub><var>i</var></sub>)
|
19
|
+
for all losing configurations (<var>x</var><sub><var>i</var></sub>,<var>y</var><sub><var>i</var></sub>),
|
20
|
+
0 <img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"<\" border=\"0\"
|
21
|
+
style=\"vertical-align:middle;\"><var>x</var><sub><var>i</var></sub><img src=\"images/symbol_lt.gif\"
|
22
|
+
width=\"10\" height=\"10\" alt=\"<\" border=\"0\" style=\"vertical-align:middle;\"><var>y</var><sub><var>i</var></sub><img
|
23
|
+
src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>N</var>.
|
24
|
+
We can verify that S(10) = 211 and S(10<sup>4</sup>) = 230312207313.\r\n</p>\r\n\r\n<p>\r\nFind
|
25
|
+
S(10<sup>16</sup>) mod 7<sup>10</sup>.\r\n</p>\r\n"
|
@@ -0,0 +1,12 @@
|
|
1
|
+
---
|
2
|
+
:id: 326
|
3
|
+
:name: Modulo Summations
|
4
|
+
:url: http://projecteuler.net/problem=326
|
5
|
+
:content: "\r\n<p>\r\nLet <var>a<sub>n</sub></var> be a sequence recursively defined
|
6
|
+
by: <img src=\"project/images/p_326_formula1.gif\" style=\"vertical-align:\r\nmiddle;\">.
|
7
|
+
\r\n</p>\r\n<p>\r\nSo the first 10 elements of <var>a<sub>n</sub></var> are: 1,1,0,3,0,3,5,4,1,9.\r\n</p>\r\n<p>Let
|
8
|
+
<var>f</var>(<var>N,M</var>) represent the number of pairs (<var>p,q</var>) such
|
9
|
+
that: </p>\n<div align=\"center\"><img src=\"project/images/p_326_formula2.gif\"></div>\r\n\r\n<p>\r\nIt
|
10
|
+
can be seen that <var>f</var>(10,10)=4 with the pairs (3,3), (5,5), (7,9) and (9,10).\r\n</p>\r\n<p>\r\nYou
|
11
|
+
are also given that <var>f</var>(10<sup>4</sup>,10<sup>3</sup>)=97158.</p>\r\n<p>\r\nFind
|
12
|
+
<var>f</var>(10<sup>12</sup>,10<sup>6</sup>).\r\n</p>\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n"
|
@@ -0,0 +1,39 @@
|
|
1
|
+
---
|
2
|
+
:id: 327
|
3
|
+
:name: Rooms of Doom
|
4
|
+
:url: http://projecteuler.net/problem=327
|
5
|
+
:content: "\r\n<p>A series of three rooms are connected to each other by automatic
|
6
|
+
doors.</p>\r\n\r\n<div align=\"center\"><img src=\"http://projecteuler.net/project/images/p_327_rooms_of_doom.gif\"></div>\r\n\r\n<p>Each
|
7
|
+
door is operated by a security card. Once you enter a room the door automatically
|
8
|
+
closes and that security card cannot be used again. A machine at the start will
|
9
|
+
dispense an unlimited number of cards, but each room (including the starting room)
|
10
|
+
contains scanners and if they detect that you are holding more than three security
|
11
|
+
cards or if they detect an unattended security card on the floor, then all the doors
|
12
|
+
will become permanently locked. However, each room contains a box where you may
|
13
|
+
safely store any number of security cards for use at a later stage.</p>\r\n\r\n<p>If
|
14
|
+
you simply tried to travel through the rooms one at a time then as you entered room
|
15
|
+
3 you would have used all three cards and would be trapped in that room forever!</p>\r\n\r\n<p>However,
|
16
|
+
if you make use of the storage boxes, then escape is possible. For example, you
|
17
|
+
could enter room 1 using your first card, place one card in the storage box, and
|
18
|
+
use your third card to exit the room back to the start. Then after collecting three
|
19
|
+
more cards from the dispensing machine you could use one to enter room 1 and collect
|
20
|
+
the card you placed in the box a moment ago. You now have three cards again and
|
21
|
+
will be able to travel through the remaining three doors. This method allows you
|
22
|
+
to travel through all three rooms using six security cards in total.</p>\r\n\r\n<p>It
|
23
|
+
is possible to travel through six rooms using a total of 123 security cards while
|
24
|
+
carrying a maximum of 3 cards.</p>\r\n\r\n<p>Let <var>C</var> be the maximum number
|
25
|
+
of cards which can be carried at any time.</p>\r\n<p>Let <var>R</var> be the number
|
26
|
+
of rooms to travel through.</p>\r\n<p>Let M(<var>C</var>,<var>R</var>) be the minimum
|
27
|
+
number of cards required from the dispensing machine to travel through <var>R</var>
|
28
|
+
rooms carrying up to a maximum of <var>C</var> cards at any time.</p>\r\n\r\n<p>For
|
29
|
+
example, M(3,6)=123 and M(4,6)=23.<br>And, ΣM(<var>C</var>,6)=146 for 3 <img src=\"images/symbol_le.gif\"
|
30
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>C</var>
|
31
|
+
<img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
|
32
|
+
style=\"vertical-align:middle;\"> 4.</p>\r\n\r\n\r\n<p>You are given that ΣM(<var>C</var>,10)=10382
|
33
|
+
for 3 <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
|
34
|
+
style=\"vertical-align:middle;\"><var>C</var> <img src=\"images/symbol_le.gif\"
|
35
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">
|
36
|
+
10.</p>\r\n\r\n<p>Find ΣM(<var>C</var>,30) for 3 <img src=\"images/symbol_le.gif\"
|
37
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>C</var>
|
38
|
+
<img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
|
39
|
+
style=\"vertical-align:middle;\"> 40.</p>\r\n\r\n\r\n"
|