euler-manager 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +21 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +37 -0
- data/Rakefile +1 -0
- data/bin/euler +145 -0
- data/data/answers.yml +456 -0
- data/data/problems/1.yml +7 -0
- data/data/problems/10.yml +8 -0
- data/data/problems/100.yml +13 -0
- data/data/problems/101.yml +49 -0
- data/data/problems/102.yml +16 -0
- data/data/problems/103.yml +26 -0
- data/data/problems/104.yml +15 -0
- data/data/problems/105.yml +21 -0
- data/data/problems/106.yml +19 -0
- data/data/problems/107.yml +20 -0
- data/data/problems/108.yml +32 -0
- data/data/problems/109.yml +33 -0
- data/data/problems/11.yml +33 -0
- data/data/problems/110.yml +19 -0
- data/data/problems/111.yml +21 -0
- data/data/problems/112.yml +15 -0
- data/data/problems/113.yml +13 -0
- data/data/problems/114.yml +106 -0
- data/data/problems/115.yml +17 -0
- data/data/problems/116.yml +76 -0
- data/data/problems/117.yml +82 -0
- data/data/problems/118.yml +9 -0
- data/data/problems/119.yml +11 -0
- data/data/problems/12.yml +13 -0
- data/data/problems/120.yml +17 -0
- data/data/problems/121.yml +15 -0
- data/data/problems/122.yml +42 -0
- data/data/problems/123.yml +13 -0
- data/data/problems/124.yml +58 -0
- data/data/problems/125.yml +12 -0
- data/data/problems/126.yml +17 -0
- data/data/problems/127.yml +31 -0
- data/data/problems/128.yml +18 -0
- data/data/problems/129.yml +12 -0
- data/data/problems/13.yml +6 -0
- data/data/problems/130.yml +19 -0
- data/data/problems/131.yml +12 -0
- data/data/problems/132.yml +12 -0
- data/data/problems/133.yml +13 -0
- data/data/problems/134.yml +19 -0
- data/data/problems/135.yml +20 -0
- data/data/problems/136.yml +17 -0
- data/data/problems/137.yml +36 -0
- data/data/problems/138.yml +20 -0
- data/data/problems/139.yml +15 -0
- data/data/problems/14.yml +28 -0
- data/data/problems/140.yml +29 -0
- data/data/problems/141.yml +14 -0
- data/data/problems/142.yml +14 -0
- data/data/problems/143.yml +20 -0
- data/data/problems/144.yml +30 -0
- data/data/problems/145.yml +11 -0
- data/data/problems/146.yml +9 -0
- data/data/problems/147.yml +14 -0
- data/data/problems/148.yml +11 -0
- data/data/problems/149.yml +41 -0
- data/data/problems/15.yml +11 -0
- data/data/problems/150.yml +34 -0
- data/data/problems/151.yml +19 -0
- data/data/problems/152.yml +12 -0
- data/data/problems/153.yml +57 -0
- data/data/problems/154.yml +16 -0
- data/data/problems/155.yml +22 -0
- data/data/problems/156.yml +27 -0
- data/data/problems/157.yml +34 -0
- data/data/problems/158.yml +19 -0
- data/data/problems/159.yml +29 -0
- data/data/problems/16.yml +6 -0
- data/data/problems/160.yml +8 -0
- data/data/problems/161.yml +15 -0
- data/data/problems/162.yml +15 -0
- data/data/problems/163.yml +19 -0
- data/data/problems/164.yml +8 -0
- data/data/problems/165.yml +32 -0
- data/data/problems/166.yml +15 -0
- data/data/problems/167.yml +17 -0
- data/data/problems/168.yml +13 -0
- data/data/problems/169.yml +10 -0
- data/data/problems/17.yml +11 -0
- data/data/problems/170.yml +16 -0
- data/data/problems/171.yml +13 -0
- data/data/problems/172.yml +6 -0
- data/data/problems/173.yml +12 -0
- data/data/problems/174.yml +20 -0
- data/data/problems/175.yml +21 -0
- data/data/problems/176.yml +9 -0
- data/data/problems/177.yml +16 -0
- data/data/problems/178.yml +9 -0
- data/data/problems/179.yml +10 -0
- data/data/problems/18.yml +21 -0
- data/data/problems/180.yml +34 -0
- data/data/problems/181.yml +7 -0
- data/data/problems/182.yml +35 -0
- data/data/problems/183.yml +27 -0
- data/data/problems/184.yml +18 -0
- data/data/problems/185.yml +22 -0
- data/data/problems/186.yml +28 -0
- data/data/problems/187.yml +16 -0
- data/data/problems/188.yml +10 -0
- data/data/problems/189.yml +15 -0
- data/data/problems/19.yml +12 -0
- data/data/problems/190.yml +13 -0
- data/data/problems/191.yml +15 -0
- data/data/problems/192.yml +27 -0
- data/data/problems/193.yml +7 -0
- data/data/problems/194.yml +18 -0
- data/data/problems/195.yml +13 -0
- data/data/problems/196.yml +25 -0
- data/data/problems/197.yml +16 -0
- data/data/problems/198.yml +21 -0
- data/data/problems/199.yml +14 -0
- data/data/problems/2.yml +10 -0
- data/data/problems/20.yml +22 -0
- data/data/problems/200.yml +12 -0
- data/data/problems/201.yml +20 -0
- data/data/problems/202.yml +14 -0
- data/data/problems/203.yml +21 -0
- data/data/problems/204.yml +11 -0
- data/data/problems/205.yml +10 -0
- data/data/problems/206.yml +6 -0
- data/data/problems/207.yml +20 -0
- data/data/problems/208.yml +12 -0
- data/data/problems/209.yml +27 -0
- data/data/problems/21.yml +13 -0
- data/data/problems/210.yml +10 -0
- data/data/problems/211.yml +11 -0
- data/data/problems/212.yml +41 -0
- data/data/problems/213.yml +11 -0
- data/data/problems/214.yml +15 -0
- data/data/problems/215.yml +18 -0
- data/data/problems/216.yml +14 -0
- data/data/problems/217.yml +27 -0
- data/data/problems/218.yml +14 -0
- data/data/problems/219.yml +19 -0
- data/data/problems/22.yml +13 -0
- data/data/problems/220.yml +24 -0
- data/data/problems/221.yml +20 -0
- data/data/problems/222.yml +7 -0
- data/data/problems/223.yml +12 -0
- data/data/problems/224.yml +12 -0
- data/data/problems/225.yml +11 -0
- data/data/problems/226.yml +16 -0
- data/data/problems/227.yml +13 -0
- data/data/problems/228.yml +23 -0
- data/data/problems/229.yml +30 -0
- data/data/problems/23.yml +19 -0
- data/data/problems/230.yml +23 -0
- data/data/problems/231.yml +16 -0
- data/data/problems/232.yml +14 -0
- data/data/problems/233.yml +10 -0
- data/data/problems/234.yml +23 -0
- data/data/problems/235.yml +9 -0
- data/data/problems/236.yml +32 -0
- data/data/problems/237.yml +13 -0
- data/data/problems/238.yml +42 -0
- data/data/problems/239.yml +9 -0
- data/data/problems/24.yml +10 -0
- data/data/problems/240.yml +11 -0
- data/data/problems/241.yml +17 -0
- data/data/problems/242.yml +16 -0
- data/data/problems/243.yml +19 -0
- data/data/problems/244.yml +32 -0
- data/data/problems/245.yml +36 -0
- data/data/problems/246.yml +17 -0
- data/data/problems/247.yml +21 -0
- data/data/problems/248.yml +6 -0
- data/data/problems/249.yml +7 -0
- data/data/problems/25.yml +15 -0
- data/data/problems/250.yml +7 -0
- data/data/problems/251.yml +13 -0
- data/data/problems/252.yml +31 -0
- data/data/problems/253.yml +36 -0
- data/data/problems/254.yml +21 -0
- data/data/problems/255.yml +59 -0
- data/data/problems/256.yml +43 -0
- data/data/problems/257.yml +18 -0
- data/data/problems/258.yml +13 -0
- data/data/problems/259.yml +16 -0
- data/data/problems/26.yml +11 -0
- data/data/problems/260.yml +30 -0
- data/data/problems/261.yml +19 -0
- data/data/problems/262.yml +20 -0
- data/data/problems/263.yml +19 -0
- data/data/problems/264.yml +20 -0
- data/data/problems/265.yml +16 -0
- data/data/problems/266.yml +10 -0
- data/data/problems/267.yml +14 -0
- data/data/problems/268.yml +8 -0
- data/data/problems/269.yml +15 -0
- data/data/problems/27.yml +25 -0
- data/data/problems/270.yml +17 -0
- data/data/problems/271.yml +13 -0
- data/data/problems/272.yml +15 -0
- data/data/problems/273.yml +21 -0
- data/data/problems/274.yml +23 -0
- data/data/problems/275.yml +19 -0
- data/data/problems/276.yml +11 -0
- data/data/problems/277.yml +24 -0
- data/data/problems/278.yml +32 -0
- data/data/problems/279.yml +6 -0
- data/data/problems/28.yml +17 -0
- data/data/problems/280.yml +13 -0
- data/data/problems/281.yml +17 -0
- data/data/problems/282.yml +10 -0
- data/data/problems/283.yml +11 -0
- data/data/problems/284.yml +22 -0
- data/data/problems/285.yml +17 -0
- data/data/problems/286.yml +12 -0
- data/data/problems/287.yml +36 -0
- data/data/problems/288.yml +15 -0
- data/data/problems/289.yml +19 -0
- data/data/problems/29.yml +24 -0
- data/data/problems/290.yml +8 -0
- data/data/problems/291.yml +10 -0
- data/data/problems/292.yml +13 -0
- data/data/problems/293.yml +15 -0
- data/data/problems/294.yml +10 -0
- data/data/problems/295.yml +26 -0
- data/data/problems/296.yml +15 -0
- data/data/problems/297.yml +19 -0
- data/data/problems/298.yml +46 -0
- data/data/problems/299.yml +31 -0
- data/data/problems/3.yml +7 -0
- data/data/problems/30.yml +12 -0
- data/data/problems/300.yml +24 -0
- data/data/problems/301.yml +25 -0
- data/data/problems/302.yml +18 -0
- data/data/problems/303.yml +11 -0
- data/data/problems/304.yml +19 -0
- data/data/problems/305.yml +14 -0
- data/data/problems/306.yml +29 -0
- data/data/problems/307.yml +12 -0
- data/data/problems/308.yml +34 -0
- data/data/problems/309.yml +17 -0
- data/data/problems/31.yml +18 -0
- data/data/problems/310.yml +19 -0
- data/data/problems/311.yml +21 -0
- data/data/problems/312.yml +15 -0
- data/data/problems/313.yml +17 -0
- data/data/problems/314.yml +29 -0
- data/data/problems/315.yml +49 -0
- data/data/problems/316.yml +25 -0
- data/data/problems/317.yml +11 -0
- data/data/problems/318.yml +61 -0
- data/data/problems/319.yml +23 -0
- data/data/problems/32.yml +14 -0
- data/data/problems/320.yml +12 -0
- data/data/problems/321.yml +18 -0
- data/data/problems/322.yml +12 -0
- data/data/problems/323.yml +19 -0
- data/data/problems/324.yml +17 -0
- data/data/problems/325.yml +25 -0
- data/data/problems/326.yml +12 -0
- data/data/problems/327.yml +39 -0
- data/data/problems/328.yml +36 -0
- data/data/problems/329.yml +17 -0
- data/data/problems/33.yml +13 -0
- data/data/problems/330.yml +40 -0
- data/data/problems/331.yml +28 -0
- data/data/problems/332.yml +16 -0
- data/data/problems/333.yml +25 -0
- data/data/problems/334.yml +39 -0
- data/data/problems/335.yml +16 -0
- data/data/problems/336.yml +24 -0
- data/data/problems/337.yml +15 -0
- data/data/problems/338.yml +41 -0
- data/data/problems/339.yml +17 -0
- data/data/problems/34.yml +7 -0
- data/data/problems/340.yml +14 -0
- data/data/problems/341.yml +18 -0
- data/data/problems/342.yml +17 -0
- data/data/problems/343.yml +29 -0
- data/data/problems/344.yml +21 -0
- data/data/problems/345.yml +26 -0
- data/data/problems/346.yml +11 -0
- data/data/problems/347.yml +16 -0
- data/data/problems/348.yml +12 -0
- data/data/problems/349.yml +13 -0
- data/data/problems/35.yml +8 -0
- data/data/problems/350.yml +18 -0
- data/data/problems/351.yml +13 -0
- data/data/problems/352.yml +49 -0
- data/data/problems/353.yml +25 -0
- data/data/problems/354.yml +16 -0
- data/data/problems/355.yml +8 -0
- data/data/problems/356.yml +10 -0
- data/data/problems/357.yml +9 -0
- data/data/problems/358.yml +31 -0
- data/data/problems/359.yml +26 -0
- data/data/problems/36.yml +8 -0
- data/data/problems/360.yml +12 -0
- data/data/problems/361.yml +20 -0
- data/data/problems/362.yml +32 -0
- data/data/problems/363.yml +33 -0
- data/data/problems/364.yml +15 -0
- data/data/problems/365.yml +17 -0
- data/data/problems/366.yml +26 -0
- data/data/problems/367.yml +20 -0
- data/data/problems/368.yml +39 -0
- data/data/problems/369.yml +15 -0
- data/data/problems/37.yml +10 -0
- data/data/problems/370.yml +16 -0
- data/data/problems/371.yml +13 -0
- data/data/problems/372.yml +16 -0
- data/data/problems/373.yml +10 -0
- data/data/problems/374.yml +25 -0
- data/data/problems/375.yml +23 -0
- data/data/problems/376.yml +25 -0
- data/data/problems/377.yml +11 -0
- data/data/problems/378.yml +15 -0
- data/data/problems/379.yml +15 -0
- data/data/problems/38.yml +18 -0
- data/data/problems/380.yml +22 -0
- data/data/problems/381.yml +21 -0
- data/data/problems/382.yml +23 -0
- data/data/problems/383.yml +13 -0
- data/data/problems/384.yml +28 -0
- data/data/problems/385.yml +22 -0
- data/data/problems/386.yml +16 -0
- data/data/problems/387.yml +19 -0
- data/data/problems/388.yml +12 -0
- data/data/problems/389.yml +12 -0
- data/data/problems/39.yml +10 -0
- data/data/problems/390.yml +18 -0
- data/data/problems/391.yml +29 -0
- data/data/problems/392.yml +22 -0
- data/data/problems/393.yml +12 -0
- data/data/problems/394.yml +22 -0
- data/data/problems/395.yml +19 -0
- data/data/problems/396.yml +28 -0
- data/data/problems/397.yml +20 -0
- data/data/problems/398.yml +13 -0
- data/data/problems/399.yml +22 -0
- data/data/problems/4.yml +8 -0
- data/data/problems/40.yml +18 -0
- data/data/problems/400.yml +18 -0
- data/data/problems/401.yml +11 -0
- data/data/problems/402.yml +25 -0
- data/data/problems/403.yml +19 -0
- data/data/problems/404.yml +21 -0
- data/data/problems/405.yml +15 -0
- data/data/problems/406.yml +46 -0
- data/data/problems/407.yml +20 -0
- data/data/problems/408.yml +14 -0
- data/data/problems/409.yml +12 -0
- data/data/problems/41.yml +8 -0
- data/data/problems/410.yml +19 -0
- data/data/problems/411.yml +23 -0
- data/data/problems/412.yml +19 -0
- data/data/problems/413.yml +13 -0
- data/data/problems/414.yml +40 -0
- data/data/problems/415.yml +19 -0
- data/data/problems/416.yml +13 -0
- data/data/problems/417.yml +21 -0
- data/data/problems/418.yml +17 -0
- data/data/problems/419.yml +22 -0
- data/data/problems/42.yml +14 -0
- data/data/problems/420.yml +13 -0
- data/data/problems/421.yml +29 -0
- data/data/problems/422.yml +22 -0
- data/data/problems/423.yml +22 -0
- data/data/problems/424.yml +37 -0
- data/data/problems/425.yml +16 -0
- data/data/problems/426.yml +29 -0
- data/data/problems/427.yml +18 -0
- data/data/problems/428.yml +32 -0
- data/data/problems/429.yml +10 -0
- data/data/problems/43.yml +17 -0
- data/data/problems/430.yml +20 -0
- data/data/problems/431.yml +33 -0
- data/data/problems/432.yml +13 -0
- data/data/problems/433.yml +18 -0
- data/data/problems/434.yml +32 -0
- data/data/problems/435.yml +21 -0
- data/data/problems/436.yml +21 -0
- data/data/problems/437.yml +22 -0
- data/data/problems/438.yml +29 -0
- data/data/problems/439.yml +17 -0
- data/data/problems/44.yml +16 -0
- data/data/problems/440.yml +21 -0
- data/data/problems/441.yml +23 -0
- data/data/problems/442.yml +9 -0
- data/data/problems/443.yml +13 -0
- data/data/problems/444.yml +28 -0
- data/data/problems/445.yml +37 -0
- data/data/problems/446.yml +29 -0
- data/data/problems/447.yml +31 -0
- data/data/problems/448.yml +14 -0
- data/data/problems/449.yml +17 -0
- data/data/problems/45.yml +15 -0
- data/data/problems/450.yml +26 -0
- data/data/problems/451.yml +15 -0
- data/data/problems/452.yml +8 -0
- data/data/problems/453.yml +16 -0
- data/data/problems/454.yml +17 -0
- data/data/problems/455.yml +16 -0
- data/data/problems/456.yml +15 -0
- data/data/problems/46.yml +18 -0
- data/data/problems/47.yml +21 -0
- data/data/problems/48.yml +7 -0
- data/data/problems/49.yml +10 -0
- data/data/problems/5.yml +8 -0
- data/data/problems/50.yml +10 -0
- data/data/problems/51.yml +15 -0
- data/data/problems/52.yml +8 -0
- data/data/problems/53.yml +28 -0
- data/data/problems/54.yml +43 -0
- data/data/problems/55.yml +21 -0
- data/data/problems/56.yml +11 -0
- data/data/problems/57.yml +15 -0
- data/data/problems/58.yml +22 -0
- data/data/problems/59.yml +23 -0
- data/data/problems/6.yml +13 -0
- data/data/problems/60.yml +10 -0
- data/data/problems/61.yml +30 -0
- data/data/problems/62.yml +9 -0
- data/data/problems/63.yml +7 -0
- data/data/problems/64.yml +130 -0
- data/data/problems/65.yml +62 -0
- data/data/problems/66.yml +27 -0
- data/data/problems/67.yml +17 -0
- data/data/problems/68.yml +23 -0
- data/data/problems/69.yml +14 -0
- data/data/problems/7.yml +6 -0
- data/data/problems/70.yml +16 -0
- data/data/problems/71.yml +17 -0
- data/data/problems/72.yml +16 -0
- data/data/problems/73.yml +16 -0
- data/data/problems/74.yml +41 -0
- data/data/problems/75.yml +16 -0
- data/data/problems/76.yml +8 -0
- data/data/problems/77.yml +8 -0
- data/data/problems/78.yml +12 -0
- data/data/problems/79.yml +11 -0
- data/data/problems/8.yml +6 -0
- data/data/problems/80.yml +11 -0
- data/data/problems/81.yml +19 -0
- data/data/problems/82.yml +19 -0
- data/data/problems/83.yml +23 -0
- data/data/problems/84.yml +63 -0
- data/data/problems/85.yml +9 -0
- data/data/problems/86.yml +15 -0
- data/data/problems/87.yml +12 -0
- data/data/problems/88.yml +53 -0
- data/data/problems/89.yml +18 -0
- data/data/problems/9.yml +13 -0
- data/data/problems/90.yml +23 -0
- data/data/problems/91.yml +19 -0
- data/data/problems/92.yml +29 -0
- data/data/problems/93.yml +21 -0
- data/data/problems/94.yml +11 -0
- data/data/problems/95.yml +23 -0
- data/data/problems/96.yml +46 -0
- data/data/problems/97.yml +14 -0
- data/data/problems/98.yml +16 -0
- data/data/problems/99.yml +16 -0
- data/euler-manager.gemspec +31 -0
- data/euler-manager.sublime-project +12 -0
- data/example/1/README.md +6 -0
- data/example/1/ruby/1.rb +5 -0
- data/example/1/scala/1.scala +9 -0
- data/example/2/README.md +9 -0
- data/example/2/python/2.py +5 -0
- data/example/2/python/euler.py +0 -0
- data/example/Eulerfile.rb +87 -0
- data/example/README.md +26 -0
- data/example/lib/euler.py +0 -0
- data/example/lib/euler.rb +0 -0
- data/example/lib/euler.scala +5 -0
- data/lib/euler.rb +190 -0
- data/lib/euler/errors.rb +7 -0
- data/lib/euler/languages.rb +12 -0
- data/lib/euler/languages/coffeescript.rb +25 -0
- data/lib/euler/languages/javascript.rb +25 -0
- data/lib/euler/languages/python.rb +27 -0
- data/lib/euler/languages/ruby.rb +25 -0
- data/lib/euler/languages/scala.rb +27 -0
- data/lib/euler/languages/templates/coffeescript.coffee +5 -0
- data/lib/euler/languages/templates/javascript.js +5 -0
- data/lib/euler/languages/templates/python.py +5 -0
- data/lib/euler/languages/templates/ruby.rb +5 -0
- data/lib/euler/languages/templates/scala.scala +9 -0
- data/lib/euler/problem.rb +60 -0
- data/lib/euler/solution.rb +98 -0
- data/lib/euler/version.rb +3 -0
- data/scripts/update_problems +68 -0
- data/spec/euler/problem_spec.rb +5 -0
- data/spec/euler/solution_spec.rb +69 -0
- data/spec/euler_spec.rb +27 -0
- data/spec/spec_helper.rb +3 -0
- metadata +644 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
:id: 439
|
3
|
+
:name: Sum of sum of divisors
|
4
|
+
:url: http://projecteuler.net/problem=439
|
5
|
+
:content: "\r\n<p>Let <var>d</var>(<var>k</var>) be the sum of all divisors of <var>k</var>.<br>\r\nWe
|
6
|
+
define the function S(<var>N</var>) = <img src=\"images/symbol_sum.gif\" width=\"11\"
|
7
|
+
height=\"14\" alt=\"∑\" border=\"0\" style=\"vertical-align:middle;\"><sub>1<img
|
8
|
+
src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>i</var><img
|
9
|
+
src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>N</var></sub><img
|
10
|
+
src=\"images/symbol_sum.gif\" width=\"11\" height=\"14\" alt=\"∑\" border=\"0\"
|
11
|
+
style=\"vertical-align:middle;\"><sub>1<img src=\"images/symbol_le.gif\" width=\"10\"
|
12
|
+
height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>j</var><img
|
13
|
+
src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>N</var></sub><var>d</var>(<var>i</var>·<var>j</var>).<br>\r\nFor
|
14
|
+
example, S(3) = <var>d</var>(1) + <var>d</var>(2) + <var>d</var>(3) + <var>d</var>(2)
|
15
|
+
+ <var>d</var>(4) + <var>d</var>(6) + <var>d</var>(3) + <var>d</var>(6) + <var>d</var>(9)
|
16
|
+
= 59.</p>\r\n\r\n<p>You are given that S(10<sup>3</sup>) = 563576517282 and S(10<sup>5</sup>)
|
17
|
+
mod 10<sup>9</sup> = 215766508.<br>\r\nFind S(10<sup>11</sup>) mod 10<sup>9</sup>.</p>\r\n\r\n"
|
@@ -0,0 +1,16 @@
|
|
1
|
+
---
|
2
|
+
:id: 44
|
3
|
+
:name: Pentagon numbers
|
4
|
+
:url: http://projecteuler.net/problem=44
|
5
|
+
:content: "\r\n<p>Pentagonal numbers are generated by the formula, P<sub><var>n</var></sub>=<var>n</var>(3<var>n</var><img
|
6
|
+
src=\"images/symbol_minus.gif\" width=\"9\" height=\"3\" alt=\"−\" border=\"0\"
|
7
|
+
style=\"vertical-align:middle;\">1)/2. The first ten pentagonal numbers are:</p>\r\n<p
|
8
|
+
style=\"text-align:center;\">1, 5, 12, 22, 35, 51, 70, 92, 117, 145, ...</p>\r\n<p>It
|
9
|
+
can be seen that P<sub>4</sub> + P<sub>7</sub> = 22 + 70 = 92 = P<sub>8</sub>. However,
|
10
|
+
their difference, 70 <img src=\"images/symbol_minus.gif\" width=\"9\" height=\"3\"
|
11
|
+
alt=\"−\" border=\"0\" style=\"vertical-align:middle;\"> 22 = 48, is not pentagonal.</p>\r\n<p>Find
|
12
|
+
the pair of pentagonal numbers, P<sub><var>j</var></sub> and P<sub><var>k</var></sub>,
|
13
|
+
for which their sum and difference are pentagonal and D = |P<sub><var>k</var></sub><img
|
14
|
+
src=\"images/symbol_minus.gif\" width=\"9\" height=\"3\" alt=\"−\" border=\"0\"
|
15
|
+
style=\"vertical-align:middle;\"> P<sub><var>j</var></sub>| is minimised; what is
|
16
|
+
the value of D?</p>\r\n"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
---
|
2
|
+
:id: 440
|
3
|
+
:name: GCD and Tiling
|
4
|
+
:url: http://projecteuler.net/problem=440
|
5
|
+
:content: "\r\n<p>We want to tile a board of length <var>n</var> and height 1 completely,
|
6
|
+
with either 1 <img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\"
|
7
|
+
border=\"0\" style=\"vertical-align:middle;\"> 2 blocks or 1 <img src=\"images/symbol_times.gif\"
|
8
|
+
width=\"9\" height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">
|
9
|
+
1 blocks with a single decimal digit on top:</p>\r\n\r\n<img src=\"project/images/p440_tiles.png\"><p>For
|
10
|
+
example, here are some of the ways to tile a board of length <var>n</var> = 8:</p>\r\n\r\n<img
|
11
|
+
src=\"project/images/p440_some8.png\"><p>Let T(<var>n</var>) be the number of ways
|
12
|
+
to tile a board of length <var>n</var> as described above.</p>\r\n\r\n<p>For example,
|
13
|
+
T(1) = 10 and T(2) = 101.</p>\r\n\r\n<p>Let S(<var>L</var>) be the triple sum <img
|
14
|
+
src=\"images/symbol_sum.gif\" width=\"11\" height=\"14\" alt=\"∑\" border=\"0\"
|
15
|
+
style=\"vertical-align:middle;\"><sub><var>a</var>,<var>b</var>,<var>c</var></sub>
|
16
|
+
gcd(T(<var>c</var><sup><var>a</var></sup>), T(<var>c</var><sup><var>b</var></sup>))
|
17
|
+
for 1 <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
|
18
|
+
style=\"vertical-align:middle;\"><var>a</var>, <var>b</var>, <var>c</var> <img src=\"images/symbol_le.gif\"
|
19
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>L</var>.<br>\r\nFor
|
20
|
+
example:<br>\r\nS(2) = 10444<br>\r\nS(3) = 1292115238446807016106539989<br>\r\nS(4)
|
21
|
+
mod 987 898 789 = 670616280.</p>\r\n\r\n<p>Find S(2000) mod 987 898 789.</p>\r\n"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
---
|
2
|
+
:id: 441
|
3
|
+
:name: The inverse summation of coprime couples
|
4
|
+
:url: http://projecteuler.net/problem=441
|
5
|
+
:content: "\r\n<p>\r\nFor an integer <var>M</var>, we define R(<var>M</var>) as the
|
6
|
+
sum of 1/(<var>p</var>·<var>q</var>) for all the integer pairs <var>p</var> and
|
7
|
+
<var>q</var> which satisfy all of these conditions:\r\n</p>\r\n<ul>\n<li> 1 <img
|
8
|
+
src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>p</var>
|
9
|
+
<img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"<\" border=\"0\"
|
10
|
+
style=\"vertical-align:middle;\"><var>q</var> <img src=\"images/symbol_le.gif\"
|
11
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>M</var>\n</li>\r\n<li>
|
12
|
+
<var>p</var> + <var>q</var> <img src=\"images/symbol_ge.gif\" width=\"10\" height=\"12\"
|
13
|
+
alt=\"≥\" border=\"0\" style=\"vertical-align:middle;\"><var>M</var>\n</li>\r\n<li>
|
14
|
+
<var>p</var> and <var>q</var> are coprime.</li>\r\n</ul>\n<p>\r\nWe also define
|
15
|
+
S(<var>N</var>) as the sum of R(<var>i</var>) for 2 <img src=\"images/symbol_le.gif\"
|
16
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>i</var>
|
17
|
+
<img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
|
18
|
+
style=\"vertical-align:middle;\"><var>N</var>.<br>\r\nWe can verify that S(2) =
|
19
|
+
R(2) = 1/2, S(10) <img src=\"images/symbol_asymp.gif\" width=\"11\" height=\"9\"
|
20
|
+
alt=\"≈\" border=\"0\" style=\"vertical-align:middle;\"> 6.9147 and S(100) <img
|
21
|
+
src=\"images/symbol_asymp.gif\" width=\"11\" height=\"9\" alt=\"≈\" border=\"0\"
|
22
|
+
style=\"vertical-align:middle;\"> 58.2962.\r\n</p>\r\n<p>\r\nFind S(10<sup>7</sup>).
|
23
|
+
Give your answer rounded to four decimal places.\r\n</p>\r\n"
|
@@ -0,0 +1,9 @@
|
|
1
|
+
---
|
2
|
+
:id: 442
|
3
|
+
:name: Eleven-free integers
|
4
|
+
:url: http://projecteuler.net/problem=442
|
5
|
+
:content: "\r\n<p>An integer is called <i>eleven-free</i> if its decimal expansion
|
6
|
+
does not contain any substring representing a power of 11 except 1.</p>\r\n\r\n<p>For
|
7
|
+
example, 2404 and 13431 are eleven-free, while 911 and 4121331 are not.</p>\r\n\r\n<p>Let
|
8
|
+
E(<i>n</i>) be the <i>n</i>th positive eleven-free integer. For example, E(3) =
|
9
|
+
3, E(200) = 213 and E(500 000) = 531563.</p>\r\n\r\n<p>Find E(10<sup>18</sup>).</p>\r\n\r\n"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
---
|
2
|
+
:id: 443
|
3
|
+
:name: GCD sequence
|
4
|
+
:url: http://projecteuler.net/problem=443
|
5
|
+
:content: "\r\n<p>Let g(<var>n</var>) be a sequence defined as follows:<br>\r\ng(4)
|
6
|
+
= 13,<br>\r\ng(<var>n</var>) = g(<var>n</var>-1) + gcd(<var>n</var>, g(<var>n</var>-1))
|
7
|
+
for <var>n</var> <img src=\"images/symbol_gt.gif\" width=\"10\" height=\"10\" alt=\">\"
|
8
|
+
border=\"0\" style=\"vertical-align:middle;\"> 4.</p>\r\n\r\n<p>The first few values
|
9
|
+
are:</p>\r\n<div align=\"center\">\r\n <table cellspacing=\"1\" cellpadding=\"5\"
|
10
|
+
border=\"0\" align=\"center\">\n<tr>\n<td><var>n</var></td>\n<td>4</td>\n<td>5</td>\n<td>6</td>\n<td>7</td>\n<td>8</td>\n<td>9</td>\n<td>10</td>\n<td>11</td>\n<td>12</td>\n<td>13</td>\n<td>14</td>\n<td>15</td>\n<td>16</td>\n<td>17</td>\n<td>18</td>\n<td>19</td>\n<td>20</td>\n<td>...</td>\r\n
|
11
|
+
\ </tr>\n<tr>\n<td>g(<var>n</var>)</td>\n<td>13</td>\n<td>14</td>\n<td>16</td>\n<td>17</td>\n<td>18</td>\n<td>27</td>\n<td>28</td>\n<td>29</td>\n<td>30</td>\n<td>31</td>\n<td>32</td>\n<td>33</td>\n<td>34</td>\n<td>51</td>\n<td>54</td>\n<td>55</td>\n<td>60</td>\n<td>...</td>\r\n
|
12
|
+
\ </tr>\n</table>\n</div>\r\n\r\n<p>You are given that g(1 000) = 2524 and g(1 000 000)
|
13
|
+
= 2624152.</p>\r\n\r\n<p>Find g(10<sup>15</sup>).</p>\r\n"
|
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
:id: 444
|
3
|
+
:name: The Roundtable Lottery
|
4
|
+
:url: http://projecteuler.net/problem=444
|
5
|
+
:content: "\r\n<p>A group of <var>p</var> people decide to sit down at a round table
|
6
|
+
and play a lottery-ticket trading game. Each person starts off with a randomly-assigned,
|
7
|
+
unscratched lottery ticket. Each ticket, when scratched, reveals a whole-pound prize
|
8
|
+
ranging anywhere from £1 to £<var>p</var>, with no two tickets alike. The goal of
|
9
|
+
the game is for each person to maximize his ticket winnings upon leaving the game.</p>\r\n\r\n<p>An
|
10
|
+
arbitrary person is chosen to be the first player. Going around the table, each
|
11
|
+
player has only one of two options:</p>\r\n\r\n<p>1. The player can scratch his
|
12
|
+
ticket and reveal its worth to everyone at the table.<br>\r\n2. The player can trade
|
13
|
+
his unscratched ticket for a previous player's scratched ticket, and then leave
|
14
|
+
the game with that ticket. The previous player then scratches his newly-acquired
|
15
|
+
ticket and reveals its worth to everyone at the table.</p>\r\n\r\n<p>The game ends
|
16
|
+
once all tickets have been scratched. All players still remaining at the table must
|
17
|
+
leave with their currently-held tickets.</p>\r\n\r\n<p>Assume that each player uses
|
18
|
+
the optimal strategy for maximizing the expected value of his ticket winnings. </p>\r\n\r\n<p>Let
|
19
|
+
E(<var>p</var>) represent the expected number of players left at the table when
|
20
|
+
the game ends in a game consisting of <var>p</var> players (e.g. E(111) = 5.2912
|
21
|
+
when rounded to 5 significant digits).</p>\r\n\r\n<p>Let S<sub>1</sub>(<var>N</var>)
|
22
|
+
= <img style=\"vertical-align:middle\" src=\"project/images/p444_sum.png\"> E(<var>p</var>)<br>\r\nLet
|
23
|
+
S<sub><var>k</var></sub>(<var>N</var>) = <img style=\"vertical-align:middle\" src=\"project/images/p444_sum.png\">
|
24
|
+
S<sub><var>k</var>-1</sub>(<var>p</var>) for <var>k</var> <img src=\"images/symbol_gt.gif\"
|
25
|
+
width=\"10\" height=\"10\" alt=\">\" border=\"0\" style=\"vertical-align:middle;\">
|
26
|
+
1</p>\r\n\r\n<p>Find S<sub>20</sub>(10<sup>14</sup>) and write the answer in scientific
|
27
|
+
notation rounded to 10 significant digits. Use a lowercase e to separate mantissa
|
28
|
+
and exponent (e.g. S<sub>3</sub>(100) = 5.983679014e5).</p>\r\n\r\n"
|
@@ -0,0 +1,37 @@
|
|
1
|
+
---
|
2
|
+
:id: 445
|
3
|
+
:name: Retractions A
|
4
|
+
:url: http://projecteuler.net/problem=445
|
5
|
+
:content: "\r\n<p>\r\nFor every integer n<img src=\"images/symbol_gt.gif\" width=\"10\"
|
6
|
+
height=\"10\" alt=\">\" border=\"0\" style=\"vertical-align:middle;\">1, the
|
7
|
+
family of functions f<sub>n,a,b</sub> is defined \r\nby f<sub>n,a,b</sub>(<var>x</var>)<img
|
8
|
+
src=\"images/symbol_cong.gif\" width=\"9\" height=\"11\" alt=\"≡\" border=\"0\"
|
9
|
+
style=\"vertical-align:middle;\">a<var>x</var>+b mod n for a,b,<var>x</var> integer
|
10
|
+
and 0<img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"<\"
|
11
|
+
border=\"0\" style=\"vertical-align:middle;\">a<img src=\"images/symbol_lt.gif\"
|
12
|
+
width=\"10\" height=\"10\" alt=\"<\" border=\"0\" style=\"vertical-align:middle;\">n,
|
13
|
+
0<img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
|
14
|
+
style=\"vertical-align:middle;\">b<img src=\"images/symbol_lt.gif\" width=\"10\"
|
15
|
+
height=\"10\" alt=\"<\" border=\"0\" style=\"vertical-align:middle;\">n, 0<img
|
16
|
+
src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>x</var><img
|
17
|
+
src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"<\" border=\"0\"
|
18
|
+
style=\"vertical-align:middle;\">n.<br>\r\nWe will call f<sub>n,a,b</sub> a <i>retraction</i>
|
19
|
+
if f<sub>n,a,b</sub>(f<sub>n,a,b</sub>(<var>x</var>))<img src=\"images/symbol_cong.gif\"
|
20
|
+
width=\"9\" height=\"11\" alt=\"≡\" border=\"0\" style=\"vertical-align:middle;\">f<sub>n,a,b</sub>(<var>x</var>)
|
21
|
+
mod n for every 0<img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\"
|
22
|
+
border=\"0\" style=\"vertical-align:middle;\"><var>x</var><img src=\"images/symbol_lt.gif\"
|
23
|
+
width=\"10\" height=\"10\" alt=\"<\" border=\"0\" style=\"vertical-align:middle;\">n.<br>\r\nLet
|
24
|
+
R(n) be the number of retractions for n.\r\n</p>\r\n<p>\r\nYou are given that<br><img
|
25
|
+
src=\"images/symbol_sum.gif\" width=\"11\" height=\"14\" alt=\"∑\" border=\"0\"
|
26
|
+
style=\"vertical-align:middle;\"> R(c) for c=C(100 000,k), and 1 <img src=\"images/symbol_le.gif\"
|
27
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">
|
28
|
+
k <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
|
29
|
+
style=\"vertical-align:middle;\">99 999 <img src=\"images/symbol_cong.gif\" width=\"9\"
|
30
|
+
height=\"11\" alt=\"≡\" border=\"0\" style=\"vertical-align:middle;\">628701600
|
31
|
+
(mod 1 000 000 007).<br>\r\n(C(n,k) is the binomial coefficient).<br></p>\r\n<p>
|
32
|
+
\r\nFind <img src=\"images/symbol_sum.gif\" width=\"11\" height=\"14\" alt=\"∑\"
|
33
|
+
border=\"0\" style=\"vertical-align:middle;\"> R(c) for c=C(10 000 000,k), and 1
|
34
|
+
<img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
|
35
|
+
style=\"vertical-align:middle;\">k<img src=\"images/symbol_le.gif\" width=\"10\"
|
36
|
+
height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"> 9 999 999.<br>\r\nGive
|
37
|
+
your answer modulo 1 000 000 007.\r\n</p>\r\n\r\n"
|
@@ -0,0 +1,29 @@
|
|
1
|
+
---
|
2
|
+
:id: 446
|
3
|
+
:name: Retractions B
|
4
|
+
:url: http://projecteuler.net/problem=446
|
5
|
+
:content: "\r\n<p>\r\nFor every integer n<img src=\"images/symbol_gt.gif\" width=\"10\"
|
6
|
+
height=\"10\" alt=\">\" border=\"0\" style=\"vertical-align:middle;\">1, the
|
7
|
+
family of functions f<sub>n,a,b</sub> is defined \r\nby f<sub>n,a,b</sub>(<var>x</var>)<img
|
8
|
+
src=\"images/symbol_cong.gif\" width=\"9\" height=\"11\" alt=\"≡\" border=\"0\"
|
9
|
+
style=\"vertical-align:middle;\">a<var>x</var>+b mod n for a,b,<var>x</var> integer
|
10
|
+
and 0<img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"<\"
|
11
|
+
border=\"0\" style=\"vertical-align:middle;\">a<img src=\"images/symbol_lt.gif\"
|
12
|
+
width=\"10\" height=\"10\" alt=\"<\" border=\"0\" style=\"vertical-align:middle;\">n,
|
13
|
+
0<img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
|
14
|
+
style=\"vertical-align:middle;\">b<img src=\"images/symbol_lt.gif\" width=\"10\"
|
15
|
+
height=\"10\" alt=\"<\" border=\"0\" style=\"vertical-align:middle;\">n, 0<img
|
16
|
+
src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>x</var><img
|
17
|
+
src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"<\" border=\"0\"
|
18
|
+
style=\"vertical-align:middle;\">n.<br>\r\nWe will call f<sub>n,a,b</sub> a <i>retraction</i>
|
19
|
+
if f<sub>n,a,b</sub>(f<sub>n,a,b</sub>(<var>x</var>))<img src=\"images/symbol_cong.gif\"
|
20
|
+
width=\"9\" height=\"11\" alt=\"≡\" border=\"0\" style=\"vertical-align:middle;\">f<sub>n,a,b</sub>(<var>x</var>)
|
21
|
+
mod n for every 0<img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\"
|
22
|
+
border=\"0\" style=\"vertical-align:middle;\"><var>x</var><img src=\"images/symbol_lt.gif\"
|
23
|
+
width=\"10\" height=\"10\" alt=\"<\" border=\"0\" style=\"vertical-align:middle;\">n.<br>\r\nLet
|
24
|
+
R(n) be the number of retractions for n.\r\n</p>\r\n<p>\r\nF(N)=<img src=\"images/symbol_sum.gif\"
|
25
|
+
width=\"11\" height=\"14\" alt=\"∑\" border=\"0\" style=\"vertical-align:middle;\">R(n<sup>4</sup>+4)
|
26
|
+
for 1<img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
|
27
|
+
style=\"vertical-align:middle;\">n<img src=\"images/symbol_le.gif\" width=\"10\"
|
28
|
+
height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">N. <br> \r\nF(1024)=77532377300600.<br></p>\r\n<p>\r\nFind
|
29
|
+
F(10<sup>7</sup>) (mod 1 000 000 007)\r\n\r\n</p>"
|
@@ -0,0 +1,31 @@
|
|
1
|
+
---
|
2
|
+
:id: 447
|
3
|
+
:name: Retractions C
|
4
|
+
:url: http://projecteuler.net/problem=447
|
5
|
+
:content: "\r\n<p>\r\nFor every integer n<img src=\"images/symbol_gt.gif\" width=\"10\"
|
6
|
+
height=\"10\" alt=\">\" border=\"0\" style=\"vertical-align:middle;\">1, the
|
7
|
+
family of functions f<sub>n,a,b</sub> is defined \r\nby f<sub>n,a,b</sub>(<var>x</var>)<img
|
8
|
+
src=\"images/symbol_cong.gif\" width=\"9\" height=\"11\" alt=\"≡\" border=\"0\"
|
9
|
+
style=\"vertical-align:middle;\">a<var>x</var>+b mod n for a,b,<var>x</var> integer
|
10
|
+
and 0<img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"<\"
|
11
|
+
border=\"0\" style=\"vertical-align:middle;\">a<img src=\"images/symbol_lt.gif\"
|
12
|
+
width=\"10\" height=\"10\" alt=\"<\" border=\"0\" style=\"vertical-align:middle;\">n,
|
13
|
+
0<img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
|
14
|
+
style=\"vertical-align:middle;\">b<img src=\"images/symbol_lt.gif\" width=\"10\"
|
15
|
+
height=\"10\" alt=\"<\" border=\"0\" style=\"vertical-align:middle;\">n, 0<img
|
16
|
+
src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>x</var><img
|
17
|
+
src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\" alt=\"<\" border=\"0\"
|
18
|
+
style=\"vertical-align:middle;\">n.<br>\r\nWe will call f<sub>n,a,b</sub> a <i>retraction</i>
|
19
|
+
if f<sub>n,a,b</sub>(f<sub>n,a,b</sub>(<var>x</var>))<img src=\"images/symbol_cong.gif\"
|
20
|
+
width=\"9\" height=\"11\" alt=\"≡\" border=\"0\" style=\"vertical-align:middle;\">f<sub>n,a,b</sub>(<var>x</var>)
|
21
|
+
mod n for every 0<img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\"
|
22
|
+
border=\"0\" style=\"vertical-align:middle;\"><var>x</var><img src=\"images/symbol_lt.gif\"
|
23
|
+
width=\"10\" height=\"10\" alt=\"<\" border=\"0\" style=\"vertical-align:middle;\">n.<br>\r\nLet
|
24
|
+
R(n) be the number of retractions for n.\r\n</p>\r\n<p>\r\nF(N)=<img src=\"images/symbol_sum.gif\"
|
25
|
+
width=\"11\" height=\"14\" alt=\"∑\" border=\"0\" style=\"vertical-align:middle;\">R(n)
|
26
|
+
for 2<img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
|
27
|
+
style=\"vertical-align:middle;\">n<img src=\"images/symbol_le.gif\" width=\"10\"
|
28
|
+
height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">N.<br>\r\nF(10<sup>7</sup>)<img
|
29
|
+
src=\"images/symbol_cong.gif\" width=\"9\" height=\"11\" alt=\"≡\" border=\"0\"
|
30
|
+
style=\"vertical-align:middle;\">638042271 (mod 1 000 000 007).\r\n</p>\r\n<p> \r\nFind
|
31
|
+
F(10<sup>14</sup>) (mod 1 000 000 007).\r\n</p>\r\n\r\n\r\n"
|
@@ -0,0 +1,14 @@
|
|
1
|
+
---
|
2
|
+
:id: 448
|
3
|
+
:name: Average least common multiple
|
4
|
+
:url: http://projecteuler.net/problem=448
|
5
|
+
:content: "\r\n<p>\r\nThe function <b>lcm</b>(a,b) denotes the least common multiple
|
6
|
+
of a and b.<br>\r\nLet A(n) be the average of the values of lcm(n,i) for 1<img src=\"images/symbol_le.gif\"
|
7
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">i<img
|
8
|
+
src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">n.<br>\r\nE.g:
|
9
|
+
A(2)=(2+2)/2=2 and A(10)=(10+10+30+20+10+30+70+40+90+10)/10=32. \r\n</p>\r\nLet
|
10
|
+
S(n)=<img src=\"images/symbol_sum.gif\" width=\"11\" height=\"14\" alt=\"∑\" border=\"0\"
|
11
|
+
style=\"vertical-align:middle;\">A(k) for 1<img src=\"images/symbol_le.gif\" width=\"10\"
|
12
|
+
height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">k<img src=\"images/symbol_le.gif\"
|
13
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">n.<br>\r\nS(100)=122726.\r\n\r\n<p>\r\nFind
|
14
|
+
S(99999999019) mod 999999017.\r\n</p>\r\n"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
:id: 449
|
3
|
+
:name: Chocolate covered candy
|
4
|
+
:url: http://projecteuler.net/problem=449
|
5
|
+
:content: "\r\n<p>Phil the confectioner is making a new batch of chocolate covered
|
6
|
+
candy. Each candy centre is shaped like an ellipsoid of revolution defined by the
|
7
|
+
equation: b<sup>2</sup><var>x</var><sup>2</sup> + b<sup>2</sup><var>y</var><sup>2</sup>
|
8
|
+
+ a<sup>2</sup><var>z</var><sup>2</sup> = a<sup>2</sup>b<sup>2</sup>.\r\n</p>\r\n<p>\r\nPhil
|
9
|
+
wants to know how much chocolate is needed to cover one candy centre with a uniform
|
10
|
+
coat of chocolate one millimeter thick.\r\n</p>\n<table class=\"formula\"><tr>\n<td>If
|
11
|
+
a=1 mm and b=1 mm, the amount of chocolate required is \r\n </td>\r\n <td><table
|
12
|
+
class=\"frac\">\n<tr><td>28</td></tr>\n<tr><td class=\"overline\">3</td></tr>\n</table></td>\r\n
|
13
|
+
\ <td>π mm<sup>3</sup>\n</td>\r\n</tr></table>\r\nIf a=2 mm and b=1 mm, the amount
|
14
|
+
of chocolate required is approximately 60.35475635 mm<sup>3</sup>.\r\n\r\n<p>\r\nFind
|
15
|
+
the amount of chocolate in mm<sup>3</sup> required if a=3 mm and b=1 mm. Give your
|
16
|
+
answer as the number rounded to 8 decimal places behind the decimal point.</p>\r\n
|
17
|
+
\r\n"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
:id: 45
|
3
|
+
:name: Triangular, pentagonal, and hexagonal
|
4
|
+
:url: http://projecteuler.net/problem=45
|
5
|
+
:content: "\r\n<p>Triangle, pentagonal, and hexagonal numbers are generated by the
|
6
|
+
following formulae:</p>\r\n<table>\n<tr>\n<td>Triangle</td>\r\n<td> </td>\r\n<td>T<sub><i>n</i></sub>=<i>n</i>(<i>n</i>+1)/2</td>\r\n<td> </td>\r\n<td>1,
|
7
|
+
3, 6, 10, 15, ...</td>\r\n</tr>\n<tr>\n<td>Pentagonal</td>\r\n<td> </td>\r\n<td>P<sub><i>n</i></sub>=<i>n</i>(3<i>n</i><img
|
8
|
+
src=\"images/symbol_minus.gif\" width=\"9\" height=\"3\" alt=\"−\" border=\"0\"
|
9
|
+
style=\"vertical-align:middle;\">1)/2</td>\r\n<td> </td>\r\n<td>1, 5, 12, 22, 35,
|
10
|
+
...</td>\r\n</tr>\n<tr>\n<td>Hexagonal</td>\r\n<td> </td>\r\n<td>H<sub><i>n</i></sub>=<i>n</i>(2<i>n</i><img
|
11
|
+
src=\"images/symbol_minus.gif\" width=\"9\" height=\"3\" alt=\"−\" border=\"0\"
|
12
|
+
style=\"vertical-align:middle;\">1)</td>\r\n<td> </td>\r\n<td>1, 6, 15, 28, 45,
|
13
|
+
...</td>\r\n</tr>\n</table>\n<p>It can be verified that T<sub>285</sub> = P<sub>165</sub>
|
14
|
+
= H<sub>143</sub> = 40755.</p>\r\n<p>Find the next triangle number that is also
|
15
|
+
pentagonal and hexagonal.</p>\r\n\r\n"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
---
|
2
|
+
:id: 450
|
3
|
+
:name: Hypocycloid and Lattice points
|
4
|
+
:url: http://projecteuler.net/problem=450
|
5
|
+
:content: "\r\n<p>\r\nA hypocycloid is the curve drawn by a point on a small circle
|
6
|
+
rolling inside a larger circle. The parametric equations of a hypocycloid centered
|
7
|
+
at the origin, and starting at the right most point is given by:</p>\n<p style=\"text-align:center\">\r\n$x(t)
|
8
|
+
= (R - r) \\cos(t) + r \\cos(\\frac {R - r} r t)$<br>\r\n$y(t) = (R - r) \\sin(t)
|
9
|
+
- r \\sin(\\frac {R - r} r t)$</p>\n<p>\r\nWhere <var>R</var> is the radius of the
|
10
|
+
large circle and <var>r</var> the radius of the small circle.\r\n</p>\r\n<p>\r\nLet
|
11
|
+
$C(R, r)$ be the set of distinct points with integer coordinates on the hypocycloid
|
12
|
+
with radius <var>R</var> and <var>r</var> and for which there is a corresponding
|
13
|
+
value of <var>t</var> such that $\\sin(t)$ and $\\cos(t)$ are rational numbers.</p>\r\n<p>\r\nLet
|
14
|
+
$S(R, r) = \\sum_{(x,y) \\in C(R, r)} |x| + |y|$ be the sum of the absolute values
|
15
|
+
of the <var>x</var> and <var>y</var> coordinates of the points in $C(R, r)$.</p>\r\n<p>\r\n\r\nLet
|
16
|
+
$T(N) = \\sum_{R = 3}^N \\sum_{r=1}^{\\lfloor \\frac {R - 1} 2 \\rfloor} S(R, r)$
|
17
|
+
be the sum of $S(R, r)$ for <var>R</var> and <var>r</var> positive integers, $R\\leq
|
18
|
+
N$ and $2r \r\n</p>\n<p>\r\n\r\nYou are given:<br><var>C</var>(3, 1) = {(3, 0),
|
19
|
+
(-1, 2), (-1,0), (-1,-2)}<br><br><var>C</var>(2500, 1000) =<br></p>\n<ul>\r\n {(2500,
|
20
|
+
0), (772, 2376), (772, -2376), (516, 1792),\r\n (516, -1792), (500, 0), (68, 504),
|
21
|
+
(68, -504),<br>(-1356, 1088), (-1356, -1088), (-1500, 1000), (-1500, -1000)}</ul>\n<i>Note:
|
22
|
+
(-625, 0) is not an element of C(2500, 1000) because $\\sin(t)$ is not a rational
|
23
|
+
number for the corresponding values of <var>t</var>.</i>\r\n\r\n<p>\r\n<var>S</var>(3,
|
24
|
+
1) = (|3| + |0|) + (|-1| + |2|) + (|-1| + |0|) + (|-1| + |-2|) = 10</p>\r\n<p>\r\n<var>T</var>(3)
|
25
|
+
= 10; <var>T</var>(10) = 524 ;<var>T</var>(100) = 580442; <var>T</var>(10<sup>3</sup>)
|
26
|
+
= 583108600.\r\n</p>\r\n<p>\r\nFind <var>T</var>(10<sup>6</sup>).\r\n</p>\r\n\r\n\r\n"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
:id: 451
|
3
|
+
:name: Modular inverses
|
4
|
+
:url: http://projecteuler.net/problem=451
|
5
|
+
:content: "\r\n<p>\r\nConsider the number 15.<br>\r\nThere are eight positive numbers
|
6
|
+
less than 15 which are coprime to 15: 1, 2, 4, 7, 8, 11, 13, 14.<br>\r\nThe modular
|
7
|
+
inverses of these numbers modulo 15 are: 1, 8, 4, 13, 2, 11, 7, 14<br> \r\nbecause<br>\r\n1*1
|
8
|
+
mod 15=1<br>\r\n2*8=16 mod 15=1<br>\r\n4*4=16 mod 15=1<br>\r\n7*13=91 mod 15=1<br>\r\n11*11=121
|
9
|
+
mod 15=1<br>\r\n14*14=196 mod 15=1<br></p>\r\n<p>\r\nLet I(n) be the largest positive
|
10
|
+
number m smaller than n-1 such that the modular inverse of m modulo n equals m itself.<br>\r\nSo
|
11
|
+
I(15)=11.<br>\r\nAlso I(100)=51 and I(7)=1.<br></p>\r\n<p>\r\nFind <img src=\"images/symbol_sum.gif\"
|
12
|
+
width=\"11\" height=\"14\" alt=\"∑\" border=\"0\" style=\"vertical-align:middle;\">I(n)
|
13
|
+
for 3<img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
|
14
|
+
style=\"vertical-align:middle;\">n<img src=\"images/symbol_le.gif\" width=\"10\"
|
15
|
+
height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">2·10<sup>7</sup></p>"
|
@@ -0,0 +1,8 @@
|
|
1
|
+
---
|
2
|
+
:id: 452
|
3
|
+
:name: Long Products
|
4
|
+
:url: http://projecteuler.net/problem=452
|
5
|
+
:content: "\r\n<p>Define F(<var>m</var>,<var>n</var>) as the number of <var>n</var>-tuples
|
6
|
+
of positive integers for which the product of the elements doesn't exceed <var>m</var>.</p>\r\n<p>F(10,
|
7
|
+
10) = 571.</p>\r\n<p>F(10<sup>6</sup>, 10<sup>6</sup>) mod 1 234 567 891 = 252903833.</p>\r\n<p>Find
|
8
|
+
F(10<sup>9</sup>, 10<sup>9</sup>) mod 1 234 567 891.</p>\r\n\r\n"
|
@@ -0,0 +1,16 @@
|
|
1
|
+
---
|
2
|
+
:id: 453
|
3
|
+
:name: Lattice Quadrilaterals
|
4
|
+
:url: http://projecteuler.net/problem=453
|
5
|
+
:content: "\r\n<p>A <b>simple quadrilateral</b> is a polygon that has four distinct
|
6
|
+
vertices, has no straight angles and does not self-intersect.</p>\r\n\r\n<p>Let
|
7
|
+
Q(m, n) be the number of simple quadrilaterals whose vertices are lattice points
|
8
|
+
with coordinates (x,y) satisfying 0 <img src=\"images/symbol_le.gif\" width=\"10\"
|
9
|
+
height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"> x <img src=\"images/symbol_le.gif\"
|
10
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">
|
11
|
+
m and 0 <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
|
12
|
+
style=\"vertical-align:middle;\"> y <img src=\"images/symbol_le.gif\" width=\"10\"
|
13
|
+
height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"> n.</p>\r\n\r\n<p>For
|
14
|
+
example, Q(2, 2) = 94 as can be seen below:</p>\r\n<p align=\"center\"><img src=\"project/images/p453_quad.png\"></p>\r\n<p>It
|
15
|
+
can also be verified that Q(3, 7) = 39590, Q(12, 3) = 309000 and Q(123, 45) = 70542215894646.</p>\r\n\r\n<p>Find
|
16
|
+
Q(12345, 6789) mod 135707531.</p>\r\n"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
:id: 454
|
3
|
+
:name: Diophantine reciprocals III
|
4
|
+
:url: http://projecteuler.net/problem=454
|
5
|
+
:content: "\r\n<p>In the following equation <var>x</var>, <var>y</var>, and <var>n</var>
|
6
|
+
are positive integers.</p>\r\n<div style=\"text-align:center;\">\r\n<table align=\"center\"><tr>\n<td><div
|
7
|
+
style=\"text-align:center;\">1<br><img src=\"images/blackdot.gif\" width=\"15\"
|
8
|
+
height=\"1\" alt=\"\"><br><var>x</var>\n</div></td>\r\n<td> + </td>\r\n<td><div
|
9
|
+
style=\"text-align:center;\">1<br><img src=\"images/blackdot.gif\" width=\"15\"
|
10
|
+
height=\"1\" alt=\"\"><br><var>y</var>\n</div></td>\r\n<td> = </td>\r\n<td><div
|
11
|
+
style=\"text-align:center;\">1<br><img src=\"images/blackdot.gif\" width=\"15\"
|
12
|
+
height=\"1\" alt=\"\"><br><var>n</var>\n</div></td>\r\n</tr></table>\n</div>\r\n<p>For
|
13
|
+
a limit <var>L</var> we define F(<var>L</var>) as the number of solutions which
|
14
|
+
satisfy <var>x</var> <img src=\"images/symbol_lt.gif\" width=\"10\" height=\"10\"
|
15
|
+
alt=\"<\" border=\"0\" style=\"vertical-align:middle;\"><var>y</var> <img src=\"images/symbol_le.gif\"
|
16
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"><var>L</var>.</p>\r\n\r\n<p>We
|
17
|
+
can verify that F(15) = 4 and F(1000) = 1069.<br>\r\nFind F(10<sup>12</sup>).</p>\r\n"
|
@@ -0,0 +1,16 @@
|
|
1
|
+
---
|
2
|
+
:id: 455
|
3
|
+
:name: Powers With Trailing Digits
|
4
|
+
:url: http://projecteuler.net/problem=455
|
5
|
+
:content: "\r\n<p>Let f(n) be the largest positive integer x less than 10<sup>9</sup>
|
6
|
+
such that the last 9 digits of n<sup>x</sup> form the number <i>x</i> (including
|
7
|
+
leading zeros), or zero if no such integer exists.</p>\r\n\r\n<p>For example:</p>\r\n\r\n<ul>\n<li>f(4)
|
8
|
+
= 411728896 (4<sup>411728896</sup> = ...490<u>411728896</u>) </li>\r\n<li>f(10)
|
9
|
+
= 0</li>\r\n<li>f(157) = 743757 (157<sup>743757</sup> = ...567<u>000743757</u>)</li>\r\n<li>Σf(n),
|
10
|
+
2 <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
|
11
|
+
style=\"vertical-align:middle;\"> n <img src=\"images/symbol_le.gif\" width=\"10\"
|
12
|
+
height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\"> 10<sup>3</sup>
|
13
|
+
= 442530011399</li>\r\n</ul>\n<p>Find Σf(n), 2 <img src=\"images/symbol_le.gif\"
|
14
|
+
width=\"10\" height=\"12\" alt=\"≤\" border=\"0\" style=\"vertical-align:middle;\">
|
15
|
+
n <img src=\"images/symbol_le.gif\" width=\"10\" height=\"12\" alt=\"≤\" border=\"0\"
|
16
|
+
style=\"vertical-align:middle;\"> 10<sup>6</sup>.</p>\r\n\r\n"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
:id: 456
|
3
|
+
:name: Triangles containing the origin II
|
4
|
+
:url: http://projecteuler.net/problem=456
|
5
|
+
:content: "\r\n<p>Define:<br><var>x</var><sub><var>n</var></sub> = (1248<sup><var>n</var></sup>
|
6
|
+
mod 32323) - 16161<br><var>y</var><sub><var>n</var></sub> = (8421<sup><var>n</var></sup>
|
7
|
+
mod 30103) - 15051<br>\r\nP<sub><var>n</var></sub> = {(<var>x</var><sub>1</sub>,
|
8
|
+
<var>y</var><sub>1</sub>), (<var>x</var><sub>2</sub>, <var>y</var><sub>2</sub>),
|
9
|
+
..., (<var>x</var><sub><var>n</var></sub>, <var>y</var><sub><var>n</var></sub>)}\r\n</p>\r\n\r\n<p>For
|
10
|
+
example, P<sub>8</sub> = {(-14913, -6630), (-10161, 5625), (5226, 11896), (8340,
|
11
|
+
-10778), (15852, -5203), (-15165, 11295), (-1427, -14495), (12407, 1060)}.</p>\r\n\r\n<p>Let
|
12
|
+
C(<var>n</var>) be the number of triangles whose vertices are in P<sub><var>n</var></sub>
|
13
|
+
which contain the origin in the interior.</p>\r\n\r\n<p>\r\nExamples:<br>\r\nC(8)
|
14
|
+
= 20<br>\r\nC(600) = 8950634<br>\r\nC(40 000) = 2666610948988\r\n</p>\r\n\r\n<p>Find
|
15
|
+
C(2 000 000).\r\n\r\n</p>"
|
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
:id: 46
|
3
|
+
:name: Goldbach's other conjecture
|
4
|
+
:url: http://projecteuler.net/problem=46
|
5
|
+
:content: "\r\n<p>It was proposed by Christian Goldbach that every odd composite number
|
6
|
+
can be written as the sum of a prime and twice a square.</p>\r\n<p style=\"margin-left:10px;\">9
|
7
|
+
= 7 + 2<img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
|
8
|
+
style=\"vertical-align:middle;\">1<sup>2</sup><br>\r\n15 = 7 + 2<img src=\"images/symbol_times.gif\"
|
9
|
+
width=\"9\" height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">2<sup>2</sup><br>\r\n21
|
10
|
+
= 3 + 2<img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
|
11
|
+
style=\"vertical-align:middle;\">3<sup>2</sup><br>\r\n25 = 7 + 2<img src=\"images/symbol_times.gif\"
|
12
|
+
width=\"9\" height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">3<sup>2</sup><br>\r\n27
|
13
|
+
= 19 + 2<img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\"
|
14
|
+
border=\"0\" style=\"vertical-align:middle;\">2<sup>2</sup><br>\r\n33 = 31 + 2<img
|
15
|
+
src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
|
16
|
+
style=\"vertical-align:middle;\">1<sup>2</sup></p>\r\n<p>It turns out that the conjecture
|
17
|
+
was false.</p>\r\n<p>What is the smallest odd composite that cannot be written as
|
18
|
+
the sum of a prime and twice a square?</p>\r\n\r\n"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
---
|
2
|
+
:id: 47
|
3
|
+
:name: Distinct primes factors
|
4
|
+
:url: http://projecteuler.net/problem=47
|
5
|
+
:content: "\r\n<p>The first two consecutive numbers to have two distinct prime factors
|
6
|
+
are:</p>\r\n<p style=\"margin-left:100px;\">14 = 2 <img src=\"images/symbol_times.gif\"
|
7
|
+
width=\"9\" height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\">
|
8
|
+
7<br>15 = 3 <img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\"
|
9
|
+
border=\"0\" style=\"vertical-align:middle;\"> 5</p>\r\n<p>The first three consecutive
|
10
|
+
numbers to have three distinct prime factors are:</p>\r\n<p style=\"margin-left:100px;\">644
|
11
|
+
= 2² <img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
|
12
|
+
style=\"vertical-align:middle;\"> 7 <img src=\"images/symbol_times.gif\" width=\"9\"
|
13
|
+
height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\"> 23<br>645
|
14
|
+
= 3 <img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
|
15
|
+
style=\"vertical-align:middle;\"> 5 <img src=\"images/symbol_times.gif\" width=\"9\"
|
16
|
+
height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\"> 43<br>646
|
17
|
+
= 2 <img src=\"images/symbol_times.gif\" width=\"9\" height=\"9\" alt=\"×\" border=\"0\"
|
18
|
+
style=\"vertical-align:middle;\"> 17 <img src=\"images/symbol_times.gif\" width=\"9\"
|
19
|
+
height=\"9\" alt=\"×\" border=\"0\" style=\"vertical-align:middle;\"> 19.</p>\r\n<p>Find
|
20
|
+
the first four consecutive integers to have four distinct prime factors. What is
|
21
|
+
the first of these numbers?</p>\r\n\r\n"
|