▼页尾

02 2011 档案

摘要:215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 21000? 阅读全文
posted @ 2011-02-27 21:33 xiatwhu 阅读(298) 评论(0) 推荐(0)
摘要:Starting in the top left corner of a 2×2 grid, there are 6 routes (without backtracking) to the bottom right corner. 阅读全文
posted @ 2011-02-27 21:14 xiatwhu 阅读(213) 评论(0) 推荐(0)
摘要:The following iterative sequence is defined for the set of positive integers: n → n/2 (n is even) n → 3n + 1 (n is odd) Using the rule above and starting with 13, we generate the following sequence: 13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1 It can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1. Which starting number, under one million, produ 阅读全文
posted @ 2011-02-24 13:52 xiatwhu 阅读(668) 评论(6) 推荐(0)
摘要:Work out the first ten digits of the sum of the following one-hundred 50-digit numbers. 37107287533902102798797998220837590246510135740250 46376937677490009712648124896970078050417018260538 74324986199524741059474233309513058123726617309629 91942213363574161572522430563301811072406154908250 23067588207539346171171980310421047513778063246676 89261670696623633820136378418383684178734361726757 28112879812849979408065481931592621691275889832738 442742289174325203219235894228767964876702721 阅读全文
posted @ 2011-02-24 11:05 xiatwhu 阅读(455) 评论(0) 推荐(0)
摘要: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, 6, 10, 15, 21, 28, 36, 45, 55, ... Let us list the factors of the first seven triangle numbers: 阅读全文
posted @ 2011-02-24 10:22 xiatwhu 阅读(363) 评论(0) 推荐(0)
摘要:In the 20×20 grid below, four numbers along a diagonal line have been marked in red. 阅读全文
posted @ 2011-02-22 22:12 xiatwhu 阅读(726) 评论(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 阅读(366) 评论(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 阅读(217) 评论(0) 推荐(0)
摘要:Find the greatest product of five consecutive digits in the 1000-digit number.731671765313306249192251196744265747423553491949349698352031277450632623957831801698480186947885184385861560789112949495459501737958331952853208805511125406987471585238630507156932909632952274430435576689664895044524452316 阅读全文
posted @ 2011-02-22 20:10 xiatwhu 阅读(381) 评论(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 阅读(269) 评论(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 阅读(214) 评论(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 阅读(289) 评论(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 阅读(352) 评论(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 阅读(603) 评论(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 阅读(211) 评论(0) 推荐(0)
摘要: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.[代码] 阅读全文
posted @ 2011-02-20 20:27 xiatwhu 阅读(272) 评论(0) 推荐(0)
摘要:DescriptionCalculate a+b InputTwo integer a,b;(-10^1000<=a,b<=10^1000) OutputOutput a+b Sample Input1 2 Sample Output3 [代码]大数加减法 阅读全文
posted @ 2011-02-20 20:03 xiatwhu 阅读(932) 评论(0) 推荐(0)
摘要:DescriptionInputOutputSample InputSample Output好啦,这就是最简单的第一题,加法运算 阅读全文
posted @ 2011-02-19 22:53 xiatwhu 阅读(590) 评论(0) 推荐(0)

▲页首
西