2014-03-01から1ヶ月間の記事一覧

Project Euler その10

Problem 11 In the 20×20 grid below, four numbers along a diagonal line have been marked in red. 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 81 49 31 73 55 79 14 29…

Project Euler その9

Problem11がどうにもうまくいかないので先に進む。 Problem12 The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, …

Project Euler その8

Problem 10 The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. 訳 10以下の素数の和は2+3+5+7=17である。200万以下の全ての素数の和を求めよ。 コード i = 3 prime = [2] flag = 0 while(1): for j…

Project Euler その7

Problem 9 A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a^2 + b^2 = c^2 For example, 32 + 42 = 9 + 16 = 25 = 52. There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc…

Project Euler その6

Problem 4 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 palindrome made from the product of two 3-digit numbers. 訳 「回文数はどちらか…

Project Euler その5

飛ばしてたProblem3を解いた。 Problem 3 The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? 訳 「13195の素因数は5と7,13と29である。600851475143の素因数の内最大の要素は何か? 」 コー…

Project Euler その4

Problem8 Find the greatest product of five consecutive digits in the 1000-digit number. 73167176531330624919225119674426574742355349194934 96983520312774506326239578318016984801869478851843 8586156078911294949545950173795833195285320880551…

Project Euler その3

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 10 001st prime number? 訳 最初の6つの素数をリストアップすると、2,3,5,7,11と13がある。6番目の素数に13を見ることができ…

Project Euler その2

Problem3,4がなんかめんどくさそうだったので一旦飛ばす。 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 positive number that is divisible by all of th…

Project Euler その1

Pythonで解いてみた。 Problem 1 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 multiples of 3 or 5 below 1000. 訳 10以下のすべての自…

ハイレゾへの道 

以前PCM1798とPCM2706を使ったUSBDACを作ったことがあった。 PCM2706でPCからの信号をI2Sに変換、PCM1798でD-A変換して出力といった感じ。PCM2704で作ったDACよりは高音質な気がしたけれど、PCM2706が16bitのI2Sしか吐けない。 だもんでハイレゾ音源を試すこ…

USBアイソレータの効果

かねてから気になっていたUSBアイソレータADuM4160を試してみた。 マルツで注文したらケース(リール?)に入ってた。このチップ、例としてはDACに挟んで、PC由来のノイズをカットするなどがあるらしい。 電源も別系統で用意するので、少なくとも電源は綺麗…