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,10 @@
|
|
1
|
+
---
|
2
|
+
:id: 233
|
3
|
+
:name: Lattice points on a circle
|
4
|
+
:url: http://projecteuler.net/problem=233
|
5
|
+
:content: "\r\n<p>Let <var>f</var>(<var>N</var>) be the number of points with integer
|
6
|
+
coordinates that are on a circle passing through (0,0), (<var>N</var>,0),(0,<var>N</var>),
|
7
|
+
and (<var>N</var>,<var>N</var>).</p>\r\n<p>It can be shown that <var>f</var>(10000) = 36.</p>\r\n\r\n<p>What
|
8
|
+
is the sum of all positive integers <var>N</var> <img src=\"images/symbol_le.gif\"
|
9
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"> 10<sup>11</sup>
|
10
|
+
such that <var>f</var>(<var>N</var>) = 420 ?</p>\r\n"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
---
|
2
|
+
:id: 234
|
3
|
+
:name: Semidivisible numbers
|
4
|
+
:url: http://projecteuler.net/problem=234
|
5
|
+
:content: "\r\n<p>For an integer <var>n</var> <img src=\"images/symbol_ge.gif\" width=\"10\"
|
6
|
+
height=\"12\" alt=\"≥\" border=\"0\" style=\"vertical-align:middle;\"> 4, we define
|
7
|
+
the <i>lower prime square root</i> of <var>n</var>, denoted by lps(<var>n</var>),
|
8
|
+
as the largest prime <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\"
|
9
|
+
alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><img src=\"images/symbol_radic.gif\"
|
10
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\"><var>n</var>
|
11
|
+
and the <i>upper prime square root</i> of <var>n</var>, ups(<var>n</var>), as the
|
12
|
+
smallest prime <img src=\"images/symbol_ge.gif\" width=\"10\" height=\"12\" alt=\"≥\"
|
13
|
+
border=\"0\" style=\"vertical-align:middle;\"><img src=\"images/symbol_radic.gif\"
|
14
|
+
width=\"14\" height=\"16\" alt=\"√\" border=\"0\" style=\"vertical-align:middle;\"><var>n</var>.</p>\r\n<p>So,
|
15
|
+
for example, lps(4) = 2 = ups(4), lps(1000) = 31, ups(1000) = 37.<br>\r\nLet us
|
16
|
+
call an integer <var>n</var> <img src=\"images/symbol_ge.gif\" width=\"10\" height=\"12\"
|
17
|
+
alt=\"≥\" border=\"0\" style=\"vertical-align:middle;\"> 4 <i>semidivisible</i>,
|
18
|
+
if one of lps(<var>n</var>) and ups(<var>n</var>) divides <var>n</var>, but not
|
19
|
+
both.</p>\r\n\r\n<p>The sum of the semidivisible numbers not exceeding 15 is 30,
|
20
|
+
the numbers are 8, 10 and 12.<br> 15 is not semidivisible because it is a multiple
|
21
|
+
of both lps(15) = 3 and ups(15) = 5.<br>\r\nAs a further example, the sum of the
|
22
|
+
92 semidivisible numbers up to 1000 is 34825.</p>\r\n\r\n<p>What is the sum of all
|
23
|
+
semidivisible numbers not exceeding 999966663333 ?</p>\r\n"
|
@@ -0,0 +1,9 @@
|
|
1
|
+
---
|
2
|
+
:id: 235
|
3
|
+
:name: An Arithmetic Geometric sequence
|
4
|
+
:url: http://projecteuler.net/problem=235
|
5
|
+
:content: "\r\n<p>\r\nGiven is the arithmetic-geometric sequence u(<var>k</var>) =
|
6
|
+
(900-3<var>k</var>)<var>r</var><sup><var>k</var>-1</sup>.<br>\r\nLet s(<var>n</var>)
|
7
|
+
= Σ<sub><var>k</var>=1...<var>n</var></sub>u(<var>k</var>).\r\n</p>\r\n<p>\r\nFind
|
8
|
+
the value of <var>r</var> for which s(5000) = -600,000,000,000.\r\n</p>\r\n<p>\r\nGive
|
9
|
+
your answer rounded to 12 places behind the decimal point.\r\n</p>\r\n\r\n\r\n\r\n"
|
@@ -0,0 +1,32 @@
|
|
1
|
+
---
|
2
|
+
:id: 236
|
3
|
+
:name: Luxury Hampers
|
4
|
+
:url: http://projecteuler.net/problem=236
|
5
|
+
:content: "\r\n<style type=\"text/css\">\r\ntable.p236, table.p236 th, table.p236
|
6
|
+
td {\r\n border-width: 1px 1px 1px 1px;\r\n border-style: solid solid solid solid;\r\n
|
7
|
+
\ border-color: black black black black;\r\n text-align:right;\r\n -moz-border-radius:
|
8
|
+
0px 0px 0px 0px;\r\n}\r\ntable.p236 {\r\n border-spacing: 1px;\r\n border-collapse:
|
9
|
+
separate;\r\n background-color: rgb(224,237,252);\r\n}\r\ntable.p236 th, table.p236
|
10
|
+
td {\r\n padding: 1px 6px 1px 6px;\r\n}\r\ntable.p236 th { background-color: rgb(193,218,249);
|
11
|
+
}\r\ntable.p236 td { background-color: rgb(255,255,255); }\r\n</style>\n<p>Suppliers
|
12
|
+
'A' and 'B' provided the following numbers of products for the luxury hamper market:</p>\r\n\r\n<p></p>\n<center><table
|
13
|
+
class=\"p236\">\n<tr>\n<th>Product</th>\n<th style=\"text-align:center\">'A'</th>\n<th
|
14
|
+
style=\"text-align:center\">'B'</th>\n</tr>\n<tr>\n<td>Beluga Caviar</td>\n<td>5248</td>\n<td>640</td>\n</tr>\n<tr>\n<td>Christmas
|
15
|
+
Cake</td>\n<td>1312</td>\n<td>1888</td>\n</tr>\n<tr>\n<td>Gammon Joint</td>\n<td>2624</td>\n<td>3776</td>\n</tr>\n<tr>\n<td>Vintage
|
16
|
+
Port</td>\n<td>5760</td>\n<td>3776</td>\n</tr>\n<tr>\n<td>Champagne Truffles</td>\n<td>3936</td>\n<td>5664</td>\n</tr>\n</table></center>\r\n\r\n<p>Although
|
17
|
+
the suppliers try very hard to ship their goods in perfect condition, there is inevitably
|
18
|
+
some spoilage - <i>i.e.</i> products gone bad.</p>\r\n\r\n<p>The suppliers compare
|
19
|
+
their performance using two types of statistic:</p>\n<ul>\n<li>The five <i>per-product
|
20
|
+
spoilage rates</i> for each supplier are equal to the number of products gone bad
|
21
|
+
divided by the number of products supplied, for each of the five products in turn.</li>\r\n
|
22
|
+
\ <li>The <i>overall spoilage rate</i> for each supplier is equal to the total number
|
23
|
+
of products gone bad divided by the total number of products provided by that supplier.</li>\n</ul>\n<p>To
|
24
|
+
their surprise, the suppliers found that each of the five per-product spoilage rates
|
25
|
+
was worse (higher) for 'B' than for 'A' by the same factor (ratio of spoilage rates),
|
26
|
+
<var>m</var>>1; and yet, paradoxically, the overall spoilage rate was worse for
|
27
|
+
'A' than for 'B', also by a factor of <var>m</var>.</p>\r\n\r\n<p>There are thirty-five
|
28
|
+
<var>m</var><img src=\"images/symbol_gt.gif\" width=\"10\" height=\"10\" alt=\">\"
|
29
|
+
border=\"0\" style=\"vertical-align:middle;\">1 for which this surprising result
|
30
|
+
could have occurred, the smallest of which is 1476/1475.</p>\r\n\r\n<p>What's the
|
31
|
+
largest possible value of <var>m</var>?<br>\r\nGive your answer as a fraction reduced
|
32
|
+
to its lowest terms, in the form <var>u</var>/<var>v</var>.</p>\r\n"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
---
|
2
|
+
:id: 237
|
3
|
+
:name: Tours on a 4 x n playing board
|
4
|
+
:url: http://projecteuler.net/problem=237
|
5
|
+
:content: "\r\n<p>Let T(<i>n</i>) be the number of tours over a 4 <img src=\"images/symbol_times.gif\"
|
6
|
+
width=\"9\" height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\"><i>n</i>
|
7
|
+
playing board such that:</p>\r\n<ul>\n<li>The tour starts in the top left corner.</li>\r\n<li>The
|
8
|
+
tour consists of moves that are up, down, left, or right one square.</li>\r\n<li>The
|
9
|
+
tour visits each square exactly once.</li>\r\n<li>The tour ends in the bottom left
|
10
|
+
corner.</li>\r\n</ul>\n<p>The diagram shows one tour over a 4 <img src=\"images/symbol_times.gif\"
|
11
|
+
width=\"9\" height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">
|
12
|
+
10 board:</p>\r\n\r\n<div style=\"text-align:center;\">\r\n<img src=\"project/images/p_237.gif\"
|
13
|
+
alt=\"\">\n</div>\r\n\r\n<p>T(10) is 2329. What is T(10<sup>12</sup>) modulo 10<sup>8</sup>?</p>\r\n"
|
@@ -0,0 +1,42 @@
|
|
1
|
+
---
|
2
|
+
:id: 238
|
3
|
+
:name: Infinite string tour
|
4
|
+
:url: http://projecteuler.net/problem=238
|
5
|
+
:content: "\r\n<style type=\"text/css\">\r\ntable.p238 td { padding: 0px 3px 0px 3px;
|
6
|
+
}\r\n</style>\n<p>Create a sequence of numbers using the \"Blum Blum Shub\" pseudo-random
|
7
|
+
number generator:</p>\r\n\r\n<center><table class=\"p238\">\n<tr>\n<td style=\"text-align:right\">\n<var>s</var><sub>0</sub>\n</td>\r\n
|
8
|
+
\ <td>=</td>\r\n <td>14025256</td>\r\n </tr>\n<tr>\n<td>\n<var>s</var><sub><var>n</var>+1</sub>\n</td>\r\n
|
9
|
+
\ <td>=</td>\r\n <td>\n<var>s</var><sub><var>n</var></sub><sup>2</sup> mod
|
10
|
+
20300713</td>\r\n </tr>\n</table></center>\r\n\r\n<p>Concatenate these numbers
|
11
|
+
<var>s</var><sub>0</sub><var>s</var><sub>1</sub><var>s</var><sub>2</sub>… to create
|
12
|
+
a string <var>w</var> of infinite length.<br>\r\nThen, <var>w</var> = <span style=\"font-family:courier
|
13
|
+
new;font-size:12pt;color:#0000ff;\">14025256741014958470038053646…</span></p>\r\n\r\n<p>For
|
14
|
+
a positive integer <var>k</var>, if no substring of <var>w</var> exists with a sum
|
15
|
+
of digits equal to <var>k</var>, <var>p</var>(<var>k</var>) is defined to be zero.
|
16
|
+
If at least one substring of <var>w</var> exists with a sum of digits equal to <var>k</var>,
|
17
|
+
we define <var>p</var>(<var>k</var>) = <var>z</var>, where <var>z</var> is the starting
|
18
|
+
position of the earliest such substring.</p>\r\n\r\n<p>For instance:</p>\r\n\r\n<p>The
|
19
|
+
substrings <span style=\"font-family:courier new;font-size:12pt;color:#0000ff;\">1</span>,
|
20
|
+
<span style=\"font-family:courier new;font-size:12pt;color:#0000ff;\">14</span>,
|
21
|
+
<span style=\"font-family:courier new;font-size:12pt;color:#0000ff;\">1402</span>,
|
22
|
+
… <br>\r\nwith respective sums of digits equal to 1, 5, 7, …<br>\r\nstart at position
|
23
|
+
<b>1</b>, hence <var>p</var>(1) = <var>p</var>(5) = <var>p</var>(7) = … = <b>1</b>.</p>\r\n\r\n<p>The
|
24
|
+
substrings <span style=\"font-family:courier new;font-size:12pt;color:#0000ff;\">4</span>,
|
25
|
+
<span style=\"font-family:courier new;font-size:12pt;color:#0000ff;\">402</span>,
|
26
|
+
<span style=\"font-family:courier new;font-size:12pt;color:#0000ff;\">4025</span>,
|
27
|
+
…<br>\r\nwith respective sums of digits equal to 4, 6, 11, …<br>\r\nstart at position
|
28
|
+
<b>2</b>, hence <var>p</var>(4) = <var>p</var>(6) = <var>p</var>(11) = … = <b>2</b>.</p>\r\n\r\n<p>The
|
29
|
+
substrings <span style=\"font-family:courier new;font-size:12pt;color:#0000ff;\">02</span>,
|
30
|
+
<span style=\"font-family:courier new;font-size:12pt;color:#0000ff;\">0252</span>,
|
31
|
+
…<br>\r\nwith respective sums of digits equal to 2, 9, …<br>\r\nstart at position
|
32
|
+
<b>3</b>, hence <var>p</var>(2) = <var>p</var>(9) = … = <b>3</b>.</p>\n<p>\r\n\r\n</p>\n<p>Note
|
33
|
+
that substring <span style=\"font-family:courier new;font-size:12pt;color:#0000ff;\">025</span>
|
34
|
+
starting at position <b>3</b>, has a sum of digits equal to 7, but there was an
|
35
|
+
earlier substring (starting at position <b>1</b>) with a sum of digits equal to
|
36
|
+
7, so <var>p</var>(7) = 1, <i>not</i> 3.</p>\r\n\r\n<p>We can verify that, for 0 k <img
|
37
|
+
src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"> 10<sup>3</sup>,
|
38
|
+
<img src=\"images/symbol_sum.gif\" width=\"11\" height=\"14\" alt=\"∑\" border=\"0\"
|
39
|
+
style=\"vertical-align:middle;\"> <var>p</var>(<var>k</var>) = 4742.</p>\r\n\r\n<p>Find
|
40
|
+
<img src=\"images/symbol_sum.gif\" width=\"11\" height=\"14\" alt=\"∑\" border=\"0\"
|
41
|
+
style=\"vertical-align:middle;\"> <var>p</var>(<var>k</var>), for 0 k <img src=\"images/symbol_le.gif\"
|
42
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"> 2·10<sup>15</sup>.</p>\r\n"
|
@@ -0,0 +1,9 @@
|
|
1
|
+
---
|
2
|
+
:id: 239
|
3
|
+
:name: Twenty-two Foolish Primes
|
4
|
+
:url: http://projecteuler.net/problem=239
|
5
|
+
:content: "\r\n<p>A set of disks numbered 1 through 100 are placed in a line in random
|
6
|
+
order.</p>\r\n\r\n<p>What is the probability that we have a partial derangement
|
7
|
+
such that exactly 22 prime number discs are found away from their natural positions?<br>\r\n(Any
|
8
|
+
number of non-prime disks may also be found in or out of their natural positions.)</p>\r\n\r\n<p>Give
|
9
|
+
your answer rounded to 12 places behind the decimal point in the form 0.abcdefghijkl.</p>\r\n\r\n"
|
@@ -0,0 +1,10 @@
|
|
1
|
+
---
|
2
|
+
:id: 24
|
3
|
+
:name: Lexicographic permutations
|
4
|
+
:url: http://projecteuler.net/problem=24
|
5
|
+
:content: "\r\n<p>A permutation is an ordered arrangement of objects. For example,
|
6
|
+
3124 is one possible permutation of the digits 1, 2, 3 and 4. If all of the permutations
|
7
|
+
are listed numerically or alphabetically, we call it lexicographic order. The lexicographic
|
8
|
+
permutations of 0, 1 and 2 are:</p>\r\n<p style=\"text-align:center;\">012 021
|
9
|
+
102 120 201 210</p>\r\n<p>What is the millionth lexicographic permutation
|
10
|
+
of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9?</p>\r\n\r\n"
|
@@ -0,0 +1,11 @@
|
|
1
|
+
---
|
2
|
+
:id: 240
|
3
|
+
:name: Top Dice
|
4
|
+
:url: http://projecteuler.net/problem=240
|
5
|
+
:content: "\r\n<p>There are 1111 ways in which five 6-sided dice (sides numbered 1
|
6
|
+
to 6) can be rolled so that the top three sum to 15. Some examples are:\r\n\r\n<br><br>\r\nD<sub>1</sub>,D<sub>2</sub>,D<sub>3</sub>,D<sub>4</sub>,D<sub>5</sub>
|
7
|
+
= 4,3,6,3,5\r\n<br>\r\nD<sub>1</sub>,D<sub>2</sub>,D<sub>3</sub>,D<sub>4</sub>,D<sub>5</sub>
|
8
|
+
= 4,3,3,5,6\r\n<br>\r\nD<sub>1</sub>,D<sub>2</sub>,D<sub>3</sub>,D<sub>4</sub>,D<sub>5</sub>
|
9
|
+
= 3,3,3,6,6\r\n<br>\r\nD<sub>1</sub>,D<sub>2</sub>,D<sub>3</sub>,D<sub>4</sub>,D<sub>5</sub>
|
10
|
+
= 6,6,3,3,3\r\n<br><br>\r\nIn how many ways can twenty 12-sided dice (sides numbered
|
11
|
+
1 to 12) be rolled so that the top ten sum to 70?</p>\r\n"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
:id: 241
|
3
|
+
:name: Perfection Quotients
|
4
|
+
:url: http://projecteuler.net/problem=241
|
5
|
+
:content: "\r\n<p>For a positive integer <var>n</var>, let σ(<var>n</var>) be the
|
6
|
+
sum of all divisors of <var>n</var>, so e.g. σ(6) = 1 + 2 + 3 + 6 = 12.\r\n</p>\r\n\r\n<p>A
|
7
|
+
perfect number, as you probably know, is a number with σ(<var>n</var>) = 2<var>n</var>.</p>\r\n\r\n<p></p>\n<div
|
8
|
+
style=\"text-align:left;\">\r\n<table><tr>\n<td>Let us define the <b>perfection
|
9
|
+
quotient</b> of a positive integer as</td>\n<td>\n<var>p</var>(<var>n</var>)</td>\n<td>= </td>\r\n<td><div
|
10
|
+
style=\"text-align:center;\">σ(<var>n</var>)<br><img src=\"images/blackdot.gif\"
|
11
|
+
width=\"30\" height=\"1\" alt=\"\"><br><var>n</var>\n</div></td>\r\n<td>.</td>\r\n</tr></table>\n</div>\r\n\r\n<!--\r\n<p>Let
|
12
|
+
us define the <b>perfection quotient</b> of a positive integer as <var>p</var>(<var>n</var>)
|
13
|
+
= <font \"size=4\"> <sup>σ(<var>n</var>)</sup>⁄<sub><var>n</var></sub></font>.</p>\r\n-->\r\n<p>Find
|
14
|
+
the sum of all positive integers <var>n</var> <img src=\"images/symbol_le.gif\"
|
15
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">
|
16
|
+
10<sup>18</sup> for which <var>p</var>(<var>n</var>) has the form <var>k</var> +
|
17
|
+
<sup>1</sup>⁄<sub>2</sub>, where <var>k</var> is an integer.</p>\r\n\r\n"
|
@@ -0,0 +1,16 @@
|
|
1
|
+
---
|
2
|
+
:id: 242
|
3
|
+
:name: Odd Triplets
|
4
|
+
:url: http://projecteuler.net/problem=242
|
5
|
+
:content: "\r\n<p>Given the set {1,2,...,<var>n</var>}, we define <var>f</var>(<var>n</var>,<var>k</var>)
|
6
|
+
as the number of its <var>k</var>-element subsets with an odd sum of elements. For
|
7
|
+
example, <var>f</var>(5,3) = 4, since the set {1,2,3,4,5} has four 3-element subsets
|
8
|
+
having an odd sum of elements, i.e.: {1,2,4}, {1,3,5}, {2,3,4} and {2,4,5}.</p>\r\n\r\n<p>When
|
9
|
+
all three values <var>n</var>, <var>k</var> and <var>f</var>(<var>n</var>,<var>k</var>)
|
10
|
+
are odd, we say that they make <br>\r\nan <i>odd-triplet</i> [<var>n</var>,<var>k</var>,<var>f</var>(<var>n</var>,<var>k</var>)].</p>\r\n\r\n<p>There
|
11
|
+
are exactly five odd-triplets with <var>n</var> <img src=\"images/symbol_le.gif\"
|
12
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"> 10,
|
13
|
+
namely:<br>\r\n[1,1,<var>f</var>(1,1) = 1], [5,1,<var>f</var>(5,1) = 3], [5,5,<var>f</var>(5,5) = 1],
|
14
|
+
[9,1,<var>f</var>(9,1) = 5] and [9,9,<var>f</var>(9,9) = 1].</p>\r\n\r\n<p>How many
|
15
|
+
odd-triplets are there with <var>n</var> <img src=\"images/symbol_le.gif\" width=\"10\"
|
16
|
+
height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"> 10<sup>12</sup> ?</p>\r\n"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
:id: 243
|
3
|
+
:name: Resilience
|
4
|
+
:url: http://projecteuler.net/problem=243
|
5
|
+
:content: "\r\n<p> </p>\r\n<p>A positive fraction whose numerator is less than its
|
6
|
+
denominator is called a proper fraction.<br>\r\nFor any denominator, <var>d</var>,
|
7
|
+
there will be <var>d</var><img src=\"images/symbol_minus.gif\" width=\"9\" height=\"3\"
|
8
|
+
alt=\"−\" border=\"0\" style=\"vertical-align:middle;\">1 proper fractions; for
|
9
|
+
example, with <var>d</var> = 12:<br><sup>1</sup>/<sub>12</sub> , <sup>2</sup>/<sub>12</sub>
|
10
|
+
, <sup>3</sup>/<sub>12</sub> , <sup>4</sup>/<sub>12</sub> , <sup>5</sup>/<sub>12</sub>
|
11
|
+
, <sup>6</sup>/<sub>12</sub> , <sup>7</sup>/<sub>12</sub> , <sup>8</sup>/<sub>12</sub>
|
12
|
+
, <sup>9</sup>/<sub>12</sub> , <sup>10</sup>/<sub>12</sub> , <sup>11</sup>/<sub>12</sub>
|
13
|
+
.\r\n</p>\r\n\r\n<p>We shall call a fraction that cannot be cancelled down a <i>resilient
|
14
|
+
fraction</i>.<br>\r\nFurthermore we shall define the <i>resilience</i> of a denominator,
|
15
|
+
<var>R</var>(<var>d</var>), to be the ratio of its proper fractions that are resilient;
|
16
|
+
for example, <var>R</var>(12) = <sup>4</sup>/<sub>11</sub> .<br>\r\nIn fact, <var>d</var> = 12
|
17
|
+
is the smallest denominator having a resilience <var>R</var>(<var>d</var>) 4/<sub>10</sub>
|
18
|
+
.</p>\r\n\r\n<p>Find the smallest denominator <var>d</var>, having a resilience
|
19
|
+
<var>R</var>(<var>d</var>) 15499/<sub>94744</sub> .</p>\r\n\r\n"
|
@@ -0,0 +1,32 @@
|
|
1
|
+
---
|
2
|
+
:id: 244
|
3
|
+
:name: Sliders
|
4
|
+
:url: http://projecteuler.net/problem=244
|
5
|
+
:content: "\r\n<p>You probably know the game <i>Fifteen Puzzle</i>. Here, instead
|
6
|
+
of numbered tiles, we have seven red tiles and eight blue tiles.</p>\r\n<p>A move
|
7
|
+
is denoted by the uppercase initial of the direction (Left, Right, Up, Down) in
|
8
|
+
which the tile is slid, e.g. starting from configuration (<b>S</b>), by the sequence
|
9
|
+
<b>LULUR</b> we reach the configuration (<b>E</b>):</p>\r\n<p></p>\n<div style=\"text-align:
|
10
|
+
center;\">\r\n<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" align=\"center\"><tr>\n<td
|
11
|
+
width=\"25\">(<b>S</b>)</td>\n<td width=\"100\"><img src=\"project/images/p_244_start.gif\"></td>\n<td
|
12
|
+
width=\"25\">, (<b>E</b>)</td>\n<td width=\"100\"><img src=\"project/images/p_244_example.gif\"></td>\r\n</tr></table>\n</div>\r\n\r\n<p>For
|
13
|
+
each path, its checksum is calculated by (pseudocode):\r\n</p>\n<div style=\"margin-left:
|
14
|
+
100px;\">\r\nchecksum = 0<br>\r\nchecksum = (checksum <img src=\"images/symbol_times.gif\"
|
15
|
+
width=\"9\" height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">
|
16
|
+
243 + <var>m</var><sub>1</sub>) mod 100 000 007<br>\r\nchecksum = (checksum <img
|
17
|
+
src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
|
18
|
+
style=\"vertical-align:middle;\"> 243 + <var>m</var><sub>2</sub>) mod 100 000 007<br>\r\n …<br>\r\nchecksum
|
19
|
+
= (checksum <img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\"
|
20
|
+
border=\"0\" style=\"vertical-align:middle;\"> 243 + <var>m</var><sub><var>n</var></sub>)
|
21
|
+
mod 100 000 007<br>\n</div>\r\nwhere <var>m</var><sub><var>k</var></sub> is the
|
22
|
+
ASCII value of the <var>k</var><sup><var>th</var></sup> letter in the move sequence
|
23
|
+
and the ASCII values for the moves are:\r\n\r\n<div style=\"text-align:center;\">\r\n<table
|
24
|
+
cellspacing=\"0\" cellpadding=\"2\" border=\"1\" align=\"center\">\n<tr>\n<td width=\"30\"><b>L</b></td>\n<td
|
25
|
+
width=\"30\">76</td>\n</tr>\n<tr>\n<td><b>R</b></td>\n<td>82</td>\n</tr>\n<tr>\n<td><b>U</b></td>\n<td>85</td>\n</tr>\n<tr>\n<td><b>D</b></td>\n<td>68</td>\n</tr>\n</table>\n</div>\r\n\r\n<p>For
|
26
|
+
the sequence <b>LULUR</b> given above, the checksum would be 19761398.</p>\r\n<p>Now,
|
27
|
+
starting from configuration (<b>S</b>),\r\nfind all shortest ways to reach configuration
|
28
|
+
(<b>T</b>).</p>\r\n<p></p>\n<div style=\"text-align: center;\">\r\n<table cellspacing=\"0\"
|
29
|
+
cellpadding=\"2\" border=\"0\" align=\"center\"><tr>\n<td width=\"25\">(<b>S</b>)</td>\n<td
|
30
|
+
width=\"100\"><img src=\"project/images/p_244_start.gif\"></td>\n<td width=\"25\">, (<b>T</b>)</td>\n<td
|
31
|
+
width=\"100\"><img src=\"project/images/p_244_target.gif\"></td>\r\n</tr></table>\n</div>\r\n\r\n<p>What
|
32
|
+
is the sum of all checksums for the paths having the minimal length?</p>\r\n"
|
@@ -0,0 +1,36 @@
|
|
1
|
+
---
|
2
|
+
:id: 245
|
3
|
+
:name: Coresilience
|
4
|
+
:url: http://projecteuler.net/problem=245
|
5
|
+
:content: "\r\n<p>We shall call a fraction that cannot be cancelled down a resilient
|
6
|
+
fraction.<br> Furthermore we shall define the resilience of a denominator, <var>R</var>(<var>d</var>),
|
7
|
+
to be the ratio of its proper fractions that are resilient; for example, <var>R</var>(12)
|
8
|
+
= <sup>4</sup>⁄<sub>11</sub>.</p>\r\n\r\n\r\n<div style=\"text-align:left;\">\r\n<table><tr>\n<td>The
|
9
|
+
resilience of a number <var>d</var> <img src=\"images/symbol_gt.gif\" width=\"10\"
|
10
|
+
height=\"10\" alt=\">\" border=\"0\" style=\"vertical-align:middle;\"> 1 is then</td>\r\n<td><div
|
11
|
+
style=\"text-align:center;\">φ(<var>d</var>)<br><img src=\"images/blackdot.gif\"
|
12
|
+
width=\"36\" height=\"1\" alt=\"\"><br><var>d</var> - 1</div></td>\n<td>, where
|
13
|
+
φ is Euler's totient function.</td>\r\n</tr></table>\n<table><tr>\n<td>We further
|
14
|
+
define the <b>coresilience</b> of a number <var>n</var> <img src=\"images/symbol_gt.gif\"
|
15
|
+
width=\"10\" height=\"10\" alt=\">\" border=\"0\" style=\"vertical-align:middle;\">
|
16
|
+
1 as <var>C</var>(<var>n</var>)</td>\n<td>= </td>\r\n<td><div style=\"text-align:center;\">\n<var>n</var>
|
17
|
+
- φ(<var>n</var>)<br><img src=\"images/blackdot.gif\" width=\"54\" height=\"1\"
|
18
|
+
alt=\"\"><br><var>n</var> - 1</div></td>\n<td>.</td>\r\n</tr></table>\n<table><tr>\n<td>The
|
19
|
+
coresilience of a prime <var>p</var> is <var>C</var>(<var>p</var>)</td>\r\n<td>= </td>\r\n<td><div
|
20
|
+
style=\"text-align:center;\">1<br><img src=\"images/blackdot.gif\" width=\"34\"
|
21
|
+
height=\"1\" alt=\"\"><br><var>p</var> - 1</div></td>\n<td>.</td>\r\n</tr></table>\n</div>\r\n\r\n<!--\r\n<p>The
|
22
|
+
resilience of a number <var>d</var> <img src='images/symbol_gt.gif' width='10' height='10'
|
23
|
+
alt='>' border='0' style='vertical-align:middle;' /> 1 is then <font \"size=4\"><sup>φ(<var>d</var>)</sup>⁄<sub>(<var>d</var>-1)</sub></font>,
|
24
|
+
where φ is Euler's totient function.</p>\r\n\r\n<p>We further define the <b>coresilience</b>
|
25
|
+
of a number <var>n</var> <img src='images/symbol_gt.gif' width='10' height='10'
|
26
|
+
alt='>' border='0' style='vertical-align:middle;' /> 1 as <var>C</var>(<var>n</var>)
|
27
|
+
= <font \"size=4\"><sup>(<var>n</var> - φ(<var>n</var>))</sup>⁄<sub>(<var>n</var>
|
28
|
+
- 1)</sub></font>.\r\n</p>\r\n\r\n<p>The coresilience of a prime <var>p</var> is
|
29
|
+
<var>C</var>(<var>p</var>) = <font \"size=4\"><sup>1</sup>⁄<sub>(<var>p</var>
|
30
|
+
- 1)</sub></font>.</p>\r\n-->\r\n\r\n<p>Find the sum of all <b>composite</b> integers
|
31
|
+
1 <img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"<\" border=\"0\"
|
32
|
+
style=\"vertical-align:middle;\"><var>n</var> <img src=\"images/symbol_le.gif\"
|
33
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">
|
34
|
+
2<img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
|
35
|
+
style=\"vertical-align:middle;\">10<sup>11</sup>, for which <var>C</var>(<var>n</var>)
|
36
|
+
is a <dfn title=\"A fraction with numerator 1\">unit fraction</dfn>.\r\n</p>\r\n\r\n"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
:id: 246
|
3
|
+
:name: Tangents to an ellipse
|
4
|
+
:url: http://projecteuler.net/problem=246
|
5
|
+
:content: "\r\n<p>\r\nA definition for an ellipse is:<br>\r\nGiven a circle c with
|
6
|
+
centre M and radius r and a point G such that d(G,M)<img src=\"images/symbol_lt.gif\"
|
7
|
+
width=\"10\" height=\"10\" alt=\"<\" border=\"0\" style=\"vertical-align:middle;\">r,
|
8
|
+
the locus of the points that are equidistant from c and G form an ellipse.\r\n</p>\r\nThe
|
9
|
+
construction of the points of the ellipse is shown below.\r\n\r\n<div style=\"text-align:center;\">\r\n<img
|
10
|
+
src=\"project/images/p_246_anim.gif\" alt=\"\">\n</div>\r\n\r\n<p>\r\nGiven are
|
11
|
+
the points M(-2000,1500) and G(8000,1500).<br> \r\nGiven is also the circle c with
|
12
|
+
centre M and radius 15000.<br>\r\nThe locus of the points that are equidistant from
|
13
|
+
G and c form an ellipse e.<br>\r\nFrom a point P outside e the two tangents t<sub>1</sub>
|
14
|
+
and t<sub>2</sub> to the ellipse are drawn.<br>\r\nLet the points where t<sub>1</sub>
|
15
|
+
and t<sub>2</sub> touch the ellipse be R and S.\r\n</p>\r\n<div style=\"text-align:center;\">\r\n<img
|
16
|
+
src=\"project/images/p_246_ellipse.gif\" alt=\"\">\n</div>\r\n<p>\r\nFor how many
|
17
|
+
lattice points P is angle RPS greater than 45 degrees?\r\n</p>\r\n\r\n"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
---
|
2
|
+
:id: 247
|
3
|
+
:name: Squares under a hyperbola
|
4
|
+
:url: http://projecteuler.net/problem=247
|
5
|
+
:content: "\r\n<p>Consider the region constrained by 1 <img src=\"images/symbol_le.gif\"
|
6
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>x</var>
|
7
|
+
and 0 <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
|
8
|
+
style=\"vertical-align:middle;\"><var>y</var> <img src=\"images/symbol_le.gif\"
|
9
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><sup>1</sup>/<sub><var>x</var></sub>.\r\n</p>\n<p>\r\nLet
|
10
|
+
S<sub>1</sub> be the largest square that can fit under the curve.<br>\r\nLet S<sub>2</sub>
|
11
|
+
be the largest square that fits in the remaining area, and so on. <br>\r\nLet the
|
12
|
+
<i>index</i> of S<sub><var>n</var></sub> be the pair (left, below) indicating the
|
13
|
+
number of squares to the left of S<sub><var>n</var></sub> and the number of squares
|
14
|
+
below S<sub><var>n</var></sub>.\r\n</p>\r\n<div style=\"text-align:center;\">\r\n<img
|
15
|
+
src=\"project/images/p_247_hypersquares.gif\" alt=\"\">\n</div>\r\n<p>\r\nThe diagram
|
16
|
+
shows some such squares labelled by number. <br>\r\nS<sub>2</sub> has one square
|
17
|
+
to its left and none below, so the index of S<sub>2</sub> is (1,0).<br>\r\nIt can
|
18
|
+
be seen that the index of S<sub>32</sub> is (1,1) as is the index of S<sub>50</sub>.
|
19
|
+
<br>\r\n50 is the largest <var>n</var> for which the index of S<sub><var>n</var></sub>
|
20
|
+
is (1,1).\r\n</p>\r\n<p>\r\nWhat is the largest <var>n</var> for which the index
|
21
|
+
of S<sub><var>n</var></sub> is (3,3)?\r\n</p>\r\n\r\n\r\n"
|
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
:id: 249
|
3
|
+
:name: Prime Subset Sums
|
4
|
+
:url: http://projecteuler.net/problem=249
|
5
|
+
:content: "\r\n<p>Let <var>S</var> = {2, 3, 5, ..., 4999} be the set of prime numbers
|
6
|
+
less than 5000.</p>\r\n<p>Find the number of subsets of <var>S</var>, the sum of
|
7
|
+
whose elements is a prime number.<br>\r\nEnter the rightmost 16 digits as your answer.</p>\r\n"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
:id: 25
|
3
|
+
:name: 1000-digit Fibonacci number
|
4
|
+
:url: http://projecteuler.net/problem=25
|
5
|
+
:content: "\r\n<p>The Fibonacci sequence is defined by the recurrence relation:</p>\r\n<blockquote>F<sub><i>n</i></sub>
|
6
|
+
= F<sub><i>n</i><img src=\"images/symbol_minus.gif\" width=\"9\" height=\"3\" alt=\"−\"
|
7
|
+
border=\"0\" style=\"vertical-align:middle;\">1</sub> + F<sub><i>n</i><img src=\"images/symbol_minus.gif\"
|
8
|
+
width=\"9\" height=\"3\" alt=\"−\" border=\"0\" style=\"vertical-align:middle;\">2</sub>,
|
9
|
+
where F<sub>1</sub> = 1 and F<sub>2</sub> = 1.</blockquote>\r\n<p>Hence the first
|
10
|
+
12 terms will be:</p>\r\n<blockquote>F<sub>1</sub> = 1<br>\r\nF<sub>2</sub> = 1<br>\r\nF<sub>3</sub>
|
11
|
+
= 2<br>\r\nF<sub>4</sub> = 3<br>\r\nF<sub>5</sub> = 5<br>\r\nF<sub>6</sub> = 8<br>\r\nF<sub>7</sub>
|
12
|
+
= 13<br>\r\nF<sub>8</sub> = 21<br>\r\nF<sub>9</sub> = 34<br>\r\nF<sub>10</sub> =
|
13
|
+
55<br>\r\nF<sub>11</sub> = 89<br>\r\nF<sub>12</sub> = 144</blockquote>\r\n<p>The
|
14
|
+
12th term, F<sub>12</sub>, is the first term to contain three digits.</p>\r\n<p>What
|
15
|
+
is the first term in the Fibonacci sequence to contain 1000 digits?</p>\r\n\r\n"
|
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
:id: 250
|
3
|
+
:name: '250250'
|
4
|
+
:url: http://projecteuler.net/problem=250
|
5
|
+
:content: "\r\n<p>Find the number of non-empty subsets of {1<sup>1</sup>, 2<sup>2</sup>,
|
6
|
+
3<sup>3</sup>,..., 250250<sup>250250</sup>}, the sum of whose elements is divisible
|
7
|
+
by 250. Enter the rightmost 16 digits as your answer.</p>\r\n"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
---
|
2
|
+
:id: 251
|
3
|
+
:name: Cardano Triplets
|
4
|
+
:url: http://projecteuler.net/problem=251
|
5
|
+
:content: "\r\n<p>\r\nA triplet of positive integers (<var>a</var>,<var>b</var>,<var>c</var>)
|
6
|
+
is called a Cardano Triplet if it satisfies the condition:</p>\r\n<div style=\"text-align:center;\">\r\n<img
|
7
|
+
src=\"project/images/p_251_cardano.gif\" alt=\"\">\n</div>\r\n<p>\r\nFor example,
|
8
|
+
(2,1,5) is a Cardano Triplet.\r\n</p>\r\n<p>\r\nThere exist 149 Cardano Triplets
|
9
|
+
for which <var>a</var>+<var>b</var>+<var>c</var> <img src=\"images/symbol_le.gif\"
|
10
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">
|
11
|
+
1000.\r\n</p>\r\n<p>\r\nFind how many Cardano Triplets exist such that <var>a</var>+<var>b</var>+<var>c</var>
|
12
|
+
<img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
|
13
|
+
style=\"vertical-align:middle;\"> 110,000,000.\r\n \r\n\r\n</p>"
|
@@ -0,0 +1,31 @@
|
|
1
|
+
---
|
2
|
+
:id: 252
|
3
|
+
:name: Convex Holes
|
4
|
+
:url: http://projecteuler.net/problem=252
|
5
|
+
:content: "\r\n<p>\r\nGiven a set of points on a plane, we define a convex hole to
|
6
|
+
be a convex polygon having as vertices any of the given points and not containing
|
7
|
+
any of the given points in its interior (in addition to the vertices, other given
|
8
|
+
points may lie on the perimeter of the polygon). \r\n</p>\r\n<p>\r\nAs an example,
|
9
|
+
the image below shows a set of twenty points and a few such convex holes. \r\nThe
|
10
|
+
convex hole shown as a red heptagon has an area equal to 1049694.5 square units,
|
11
|
+
which is the highest possible area for a convex hole on the given set of points.\r\n</p>\r\n<div
|
12
|
+
style=\"text-align:center;\">\r\n<img src=\"project/images/p_252_convexhole.gif\"
|
13
|
+
alt=\"\">\n</div>\r\n<p>\r\n<style type=\"text/css\">\r\ntable.p252 td {\r\n padding:
|
14
|
+
0px 3px 0px 3px;\r\n vertical-align: bottom;\r\n text-align: left;\r\n}\r\n</style></p>\n<p>For
|
15
|
+
our example, we used the first 20 points (<var>T</var><sub>2<var>k</var><img src=\"images/symbol_minus.gif\"
|
16
|
+
width=\"9\" height=\"3\" alt=\"−\" border=\"0\" style=\"vertical-align:middle;\">1</sub>, <var>T</var><sub>2<var>k</var></sub>),
|
17
|
+
for <var>k</var> = 1,2,…,20, produced with the pseudo-random number generator:</p>\r\n\r\n<center><table
|
18
|
+
class=\"p252\">\n<tr>\n<td style=\"text-align:right\">\n<var>S</var><sub>0</sub>\n</td>\r\n
|
19
|
+
\ <td>=<sub> </sub>\n</td>\r\n <td>290797<sub> </sub>\n</td>\r\n </tr>\n<tr>\n<td>\n<var>S</var><sub><var>n</var>+1</sub>\n</td>\r\n
|
20
|
+
\ <td>=<sub> </sub>\n</td>\r\n <td>\n<var>S</var><sub><var>n</var></sub><sup>2</sup>
|
21
|
+
mod 50515093</td>\r\n </tr>\n<tr>\n<td style=\"text-align:right\">\n<var>T</var><sub><var>n</var></sub>\n</td>\r\n
|
22
|
+
\ <td>=<sub> </sub>\n</td>\r\n <td>( <var>S</var><sub><var>n</var></sub> mod
|
23
|
+
2000 ) <img src=\"images/symbol_minus.gif\" width=\"9\" height=\"3\" alt=\"−\" border=\"0\"
|
24
|
+
style=\"vertical-align:middle;\"> 1000<sup> </sup>\n</td>\r\n </tr>\n</table></center>\r\n\r\n<p>\r\n<i>i.e.</i>
|
25
|
+
(527, 144), (<img src=\"images/symbol_minus.gif\" width=\"9\" height=\"3\" alt=\"−\"
|
26
|
+
border=\"0\" style=\"vertical-align:middle;\">488, 732), (<img src=\"images/symbol_minus.gif\"
|
27
|
+
width=\"9\" height=\"3\" alt=\"−\" border=\"0\" style=\"vertical-align:middle;\">454, <img
|
28
|
+
src=\"images/symbol_minus.gif\" width=\"9\" height=\"3\" alt=\"−\" border=\"0\"
|
29
|
+
style=\"vertical-align:middle;\">947), …\r\n</p>\r\n<p>\r\nWhat is the maximum area
|
30
|
+
for a convex hole on the set containing the first 500 points in the pseudo-random
|
31
|
+
sequence?<br> Specify your answer including one digit after the decimal point.\r\n</p>\r\n\r\n\r\n\r\n\r\n\r\n"
|
@@ -0,0 +1,36 @@
|
|
1
|
+
---
|
2
|
+
:id: 253
|
3
|
+
:name: Tidying up
|
4
|
+
:url: http://projecteuler.net/problem=253
|
5
|
+
:content: "\r\n<p>A small child has a “number caterpillar” consisting of forty jigsaw
|
6
|
+
pieces, each with one number on it, which, when connected together in a line, reveal
|
7
|
+
the numbers 1 to 40 in order.</p>\r\n\r\n<p>Every night, the child's father has
|
8
|
+
to pick up the pieces of the caterpillar that have been scattered across the play
|
9
|
+
room. He picks up the pieces at random and places them in the correct order.<br>
|
10
|
+
As the caterpillar is built up in this way, it forms distinct segments that gradually
|
11
|
+
merge together.<br> The number of segments starts at zero (no pieces placed), generally
|
12
|
+
increases up to about eleven or twelve, then tends to drop again before finishing
|
13
|
+
at a single segment (all pieces placed).</p>\n<p>\r\n\r\n</p>\n<p>For example:</p>\r\n<div
|
14
|
+
align=\"center\">\r\n<table cellspacing=\"0\" cellpadding=\"2\" border=\"1\" align=\"center\">\n<tr
|
15
|
+
style=\"background-color:#c1daf9;\">\n<td width=\"80\" align=\"center\"><b>Piece
|
16
|
+
Placed</b></td>\r\n<td width=\"80\" align=\"center\"><b>Segments So Far</b></td>\n</tr>\n<tr>\n<td
|
17
|
+
align=\"center\">12</td>\n<td align=\"center\">1</td>\n</tr>\n<tr>\n<td align=\"center\">4</td>\n<td
|
18
|
+
align=\"center\">2</td>\n</tr>\n<tr>\n<td align=\"center\">29</td>\n<td align=\"center\">3</td>\n</tr>\n<tr>\n<td
|
19
|
+
align=\"center\">6</td>\n<td align=\"center\">4</td>\n</tr>\n<tr>\n<td align=\"center\">34</td>\n<td
|
20
|
+
align=\"center\">5</td>\n</tr>\n<tr>\n<td align=\"center\">5</td>\n<td align=\"center\">4</td>\n</tr>\n<tr>\n<td
|
21
|
+
align=\"center\">35</td>\n<td align=\"center\">4</td>\n</tr>\n<tr>\n<td align=\"center\">…</td>\n<td
|
22
|
+
align=\"center\">…</td>\n</tr>\n</table>\n</div>\r\n\r\n<p>Let <var>M</var> be the
|
23
|
+
maximum number of segments encountered during a random tidy-up of the caterpillar.<br>\r\nFor
|
24
|
+
a caterpillar of ten pieces, the number of possibilities for each <var>M</var> is</p>\r\n<div
|
25
|
+
align=\"center\">\r\n<table cellspacing=\"0\" cellpadding=\"2\" border=\"1\" align=\"center\">\n<tr
|
26
|
+
style=\"background-color:#c1daf9;\">\n<td width=\"50\" align=\"center\"><b><var>M</var></b></td>\r\n<td
|
27
|
+
width=\"90\" align=\"center\"><b>Possibilities</b></td>\n</tr>\n<tr>\n<td align=\"center\">1</td>\n<td
|
28
|
+
align=\"right\">512 </td>\n</tr>\n<tr>\n<td align=\"center\">2</td>\n<td align=\"right\">250912
|
29
|
+
</td>\n</tr>\n<tr>\n<td align=\"center\">3</td>\n<td align=\"right\">1815264
|
30
|
+
</td>\n</tr>\n<tr>\n<td align=\"center\">4</td>\n<td align=\"right\">1418112
|
31
|
+
</td>\n</tr>\n<tr>\n<td align=\"center\">5</td>\n<td align=\"right\">144000
|
32
|
+
</td>\n</tr>\n</table>\n</div>\r\n\r\n<p>so the most likely value of <var>M</var>
|
33
|
+
is 3 and the average value is <sup>385643</sup>⁄<sub>113400</sub> = 3.400732, rounded
|
34
|
+
to six decimal places.</p>\r\n\r\n<p>The most likely value of <var>M</var> for a
|
35
|
+
forty-piece caterpillar is 11; but what is the average value of <var>M</var>?</p>\r\n<p>Give
|
36
|
+
your answer rounded to six decimal places.</p>\r\n\r\n"
|