摘要:
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 3025385 = 2640.Fi 阅读全文
摘要:
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 阅读全文
摘要:
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. 1 #include 2 #include 3 #include 4 5 void solve() 6 { 7 int sum,i; 8 sum=0; 9 for(i=3; i<1000; i++)10 ... 阅读全文
摘要:
The fraction49/98is a curious fraction, as an inexperienced mathematician in attempting to simplify it may incorrectly believe that49/98=4/8, which is correct, is obtained by cancelling the 9s.We shall consider fractions like,30/50=3/5, to be trivial examples.There are exactly four non-trivial examp 阅读全文