とんちゃんといっしょ

Cloudに関する技術とか日常とかについて書いたり書かなかったり

Project Euler

リハビリ

Ruby会議に参加してやる気をもらったので最近リハビリがてらにProject Eulerを最初から挑戦し始めた。 今回はソースコードをgithubに載せていってる。 Mahito/project-euler · GitHub 英語が全く書けない困った社会人なのだが、なんちゃって英語でコメントも…

Project Euler Problem 33

土曜日にわんくまの数学Dayに参加してきた。 数学難しいです>< ってなったあと・・・っていうか最中に現実逃避に、 Project Eulerをやり始めた(ぉ 今回はProblem 33 The fraction ^(49)/_(98) is a curious fraction, as an inexperienced mathematician …

久しぶりRubyでProject Eulerをやってみた

最近Rubyをまともに使った覚えが無いので、 1年ぶりぐらいになるかもしれないけどProject Eulerをやってみることに。 今回はProblem 32に挑戦 We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once; f…

Problem 14

問題 Find the longest sequence using a starting number under one million.

Problem 13

問題 Find the first ten digits of the sum of one-hundred 50-digit numbers.

Problem 12

問題 What is the value of the first triangle number to have over five hundred divisors?

Problem 11

問題 What is the greatest product of four numbers on the same straight line in the 20 by 20 grid?

Problem 10

問題 Calculate the sum of all the primes below two million.

Problem 9

問題 Find the only Pythagorean triplet, {a, b, c}, for which a + b + c = 1000.

Problem 8

問題 Discover the largest product of five consecutive digits in the 1000-digit number.

Problem 7

問題 Find the 10001st prime. 英語 By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6^(th) prime is 13.What is the 10001^(st) prime number? http://projecteuler.net/index.php?section=problems&id=7 日本語 素…

Problem 6

問題 What is the difference between the sum of the squares and the square of the sums? 英語 The sum of the squares of the first ten natural numbers is, 1^(2) + 2^(2) + ... + 10^(2) = 385The square of the sum of the first ten natural number…

1日5問掲載は多そうなので減らす。 といっても3問ぐらいにすると1週間持たない感じ。 まぁ、掲載数が減ったら減ったでお察しくだしあ><

Problem 5

問題 What is the smallest number divisible by each of the numbers 1 to 20? 英語 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.What is the smallest number that is evenly divisible …

Problem 4

問題 Find the largest palindrome made from the product of two 3-digit numbers. 英語 A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.Find the largest palin…

Problem 3

問題 Find the largest prime factor of a composite number. 英語 The prime factors of 13195 are 5, 7, 13 and 29.What is the largest prime factor of the number 600851475143 ? http://projecteuler.net/index.php?section=problems&id=3 日本語 1319…

Problem 2

問題 Find the sum of all the even-valued terms in the Fibonacci sequence which do not exceed four million. 英語 Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 t…

Problem 1

問題 Add all the natural numbers below one thousand that are multiples of 3 or 5. 英語 If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.Find the sum of all the…