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

Problem 7

By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.What is the 10001st prime number? 訳 最初の六つの素数,2,3,5,7,11,13を列挙することで,6番目の素数が13であることがわかる.10001番目の素…

Problem 6

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 numbers is, (1 + 2 + ... + 10)^2 = 55^2 = 3025Hence the difference between the sum of the squares of the…

Problem 5

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 by all of the numbers from 1 to 20? 訳 2520は,1から10までのそれぞれの数で割り切…

素因数分解

コメント欄でご指摘いただいたことを考えてみます.素因数分解をする際に素数の列として,エラトステネスの篩ではなく, primes = 2:3:([6,12..] >>= (\x->[x-1,x+1] ) を使うというテクニック.6の倍数の「前後」を「素数のタネ」として使うということです…