2009-01-17から1日間の記事一覧

Rubyで数字をスライスする 〜Rubyでオイラープロジェクトを解こう!Problem8

Problem 8 - Project Eulerより Find the greatest product of five consecutive digits in the 1000-digit number. 以下の1000桁の数字における連続した5つの数の積の最大値を求めよ。7316717653133062491922511967442657474235534919493496983520312774506…

Rubyでピタゴラスを求める 〜Rubyでオイラープロジェクトを解こう!Problem9

Problem 9 - Project Eulerより A Pythagorean triplet is a set of three natural numbers, a For example, . There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc. ピタゴラス数とは、次の関係にある3つの自…