2008-04-27から1日間の記事一覧

Problem 79 - セキュリティキーを解読せよ

これは面白かった。Problem 79 - Project Euler A common security method used for online banking is to ask the user for three random characters from a passcode. For example, if the passcode was 531278, they may asked for the 2nd, 3rd, and 5th…

Problem 45 - 三角数、五角数、六角数

同じような問題があった気がする。Problem 45 - Project Euler Triangle, pentagonal, and hexagonal numbers are generated by the following formulae: Triangle Tn=n(n+1)/2 1, 3, 6, 10, 15, ... Pentagonal Pn=n(3n−1)/2 1, 5, 12, 22, 35, ... Hexagon…

Problem 53 - 組み合わせ

40問達成!!Problem 53 - Project Euler There are exactly ten ways of selecting three from five, 12345:123, 124, 125, 134, 135, 145, 234, 235, 245, and 345In combinatorics, we use the notation, 5C3 = 10.In general,nCr = n!/r!(n−r)!,where r …

パスカルの三角形の横列

パスカルの三角形があって、 0: 1 1: 1 1 2: 1 2 1 3: 1 3 3 1 4: 1 4 6 4 1 5: 1 5 10 10 5 1 6: 1 6 15 20 15 6 1横列を求めたい。 例えば、6の横列を求めたいとする。1はとりあえず置いといて。6/1倍して、6 5/2倍して、15 4/3倍して、20 3/4倍して、15 2…

Problem 52 - n倍しても同じ数が現れる

英語の簡単なものからProblem 52 - Project Euler It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order.Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and 6…

Problem 42 - 三角数

段々翻訳されてない所に入ってきた。英語力が無い僕には辛くなりそう。Problem 42 - Project Euler The n^th term of the sequence of triangle numbers is given by, tn = ½n(n+1); so the first ten triangle numbers are:1, 3, 6, 10, 15, 21, 28, 36, 45…