摘要: We shall say that ann-digit number is pandigital if it makes use of all the digits 1 tonexactly once. For example, 2143 is a 4-digit pandigital and is also prime.What is the largestn-digit pandigital prime that exists? 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 8 bool ispri. 阅读全文
posted @ 2013-07-26 20:03 cpoint 阅读(366) 评论(0) 推荐(0) 编辑
摘要: The number 3797 has an interesting property. Being prime itself, it is possible to continuously remove digits from left to right, and remain prime at each stage: 3797, 797, 97, and 7. Similarly we can work from right to left: 3797, 379, 37, and 3.Find the sum of the only eleven primes that are both 阅读全文
posted @ 2013-07-26 19:12 cpoint 阅读(356) 评论(0) 推荐(0) 编辑
摘要: The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime.There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97.How many circular primes are there below one million?#include #include #include #inclu 阅读全文
posted @ 2013-07-26 13:19 cpoint 阅读(333) 评论(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 10 001st prime number? 1 #include 2 #include 3 #include 4 #include 5 6 int prim(int n) 7 { 8 int i; 9 for(i=2; i*i<=n; i++)10 {11 if(n%i==0)12 return 0;13 ... 阅读全文
posted @ 2013-07-26 11:27 cpoint 阅读(277) 评论(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 isevenly divisibleby all of the numbers from 1 to 20? 1 #include 2 #include 3 #include 4 #include 5 6 #define N 20 7 8 int gcd(int a, int b) 9... 阅读全文
posted @ 2013-07-26 11:26 cpoint 阅读(187) 评论(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 3025385 = 2640.Fi 阅读全文
posted @ 2013-07-26 11:02 cpoint 阅读(597) 评论(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 @ 2013-07-26 10:57 cpoint 阅读(265) 评论(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. 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 ... 阅读全文
posted @ 2013-07-26 10:55 cpoint 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2013-07-26 00:49 cpoint 阅读(269) 评论(0) 推荐(0) 编辑
浏览次数:travelocity promotion codes