▼页尾
摘要: In the 20×20 grid below, four numbers along a diagonal line have been marked in red. 阅读全文
posted @ 2011-02-22 22:12 xiatwhu 阅读(713) 评论(0) 推荐(0) 编辑
摘要: The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. 阅读全文
posted @ 2011-02-22 21:10 xiatwhu 阅读(359) 评论(0) 推荐(0) 编辑
摘要: A Pythagorean triplet is a set of three natural numbers, a b c, for which, a2 + b2 = c2For example, 32 + 42 = 9 + 16 = 25 = 52.There exists exactly one Pythagorean triplet for which a + b + c = 1000.Find the product abc.寻找和为1000毕达哥拉斯三元数组,求它们的积由于a b c,我们容易得到a的范围a < 1000/(1+1+1.414); 估算有 a < 300 阅读全文
posted @ 2011-02-22 20:32 xiatwhu 阅读(207) 评论(0) 推荐(0) 编辑
摘要: Find the greatest product of five consecutive digits in the 1000-digit number.731671765313306249192251196744265747423553491949349698352031277450632623957831801698480186947885184385861560789112949495459501737958331952853208805511125406987471585238630507156932909632952274430435576689664895044524452316 阅读全文
posted @ 2011-02-22 20:10 xiatwhu 阅读(363) 评论(0) 推荐(0) 编辑
摘要: 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?求第10001个素数。求素数有很多种方法最直接的方法就是看这个数能不能整除2~sqrt(该数);而查表法能做更少的运算,如果一个数不能被小于它的素数整除的话,那么该数就是素数。如23不能被2,3,5,7,11,13,17,19整除。更进一步,一个数不能被2~sqrt(该数)中的素数整除的话,那么该数就是素数。所以,23只要不能被2, 阅读全文
posted @ 2011-02-22 01:21 xiatwhu 阅读(257) 评论(0) 推荐(0) 编辑
摘要: The sum of the squares of the first ten natural numbers is,12 + 22 + ... + 102 = 385The square of the sum of the first ten natural numbers is,(1 + 2 + ... + 10)2 = 552 = 3025Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 385 = 阅读全文
posted @ 2011-02-22 00:52 xiatwhu 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 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 evenly divisible by all of the numbers from 1 to 20?题目的要求就是求1,2,3 ··· ··· 20的最小公倍数我们可惜先求1,2的最小公倍数2再求2,3的最小公 阅读全文
posted @ 2011-02-22 00:33 xiatwhu 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 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.[代码]六位数的回文数为abccba;其中 abc 范围为 999~100;所以六位数的回文数只有900个。对于每一个回文数,我们看其能不能分解为两个三位数之积对于最小的六位回文数10000 阅读全文
posted @ 2011-02-20 22:31 xiatwhu 阅读(323) 评论(0) 推荐(0) 编辑
摘要: The prime factors of 13195 are 5, 7, 13 and 29.What is the largest prime factor of the number 600851475143 ?[代码]好啦,得到的结果是正确的但其实这个算法是错误的在验证一个数是否是素数时,我们一般是从2到sqrt()800000接近于600851475143的平方根但实际上求解600851475143的最大质因数不应该认为该质因数小于sqrt(600851475143)如15的最大质因数是5,但5不小于sqrt(15)所以,改到下面的算法[代码]该算法思路更清晰把因数从小到大一一分解出去 阅读全文
posted @ 2011-02-20 21:50 xiatwhu 阅读(588) 评论(0) 推荐(0) 编辑
摘要: Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-value 阅读全文
posted @ 2011-02-20 20:46 xiatwhu 阅读(203) 评论(0) 推荐(0) 编辑
▲页首
西