projecteuler
chenyong78
这个作者很懒,什么都没留下…
展开
-
Problem 17
Problem If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.If all the numbers from 1 to 1000 (one thousand)原创 2012-01-21 20:24:52 · 254 阅读 · 0 评论 -
Problem 16
Problem 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?Code#include #include using namespace std;const unsigned i原创 2012-01-21 20:23:39 · 239 阅读 · 0 评论 -
Problem 15
Problem Starting in the top left corner of a 22 grid, there are 6 routes (without backtracking) to the bottom right corner.How many routes are there through a 2020 grid?这道题犯懒了,用WIN7计算器原创 2012-01-21 20:20:46 · 208 阅读 · 0 评论 -
Problem 14
Problem 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 followi原创 2012-01-21 20:17:31 · 268 阅读 · 0 评论 -
Problem 13
Problem Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.3710728753390210279879799822083759024651013574025046376937677490009712648124896970078050417018260原创 2012-01-21 20:16:16 · 294 阅读 · 0 评论 -
Problem 12
Problem 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,原创 2012-01-21 20:14:01 · 194 阅读 · 0 评论 -
Problem 11
Problem In the 2020 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 0849 49 99 40 17 81 18 57 60 87 17 40 98 43原创 2012-01-21 20:12:50 · 307 阅读 · 0 评论 -
Problem 10
ProblemThe sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.Find the sum of all the primes below two million.Code#include #include using namespace std;bool isPrime(int n){ if(n < 2)原创 2012-01-21 20:11:31 · 199 阅读 · 0 评论 -
Problem 9
ProblemA 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 w原创 2012-01-21 20:10:00 · 294 阅读 · 0 评论 -
Problem 8
ProblemFind the greatest product of five consecutive digits in the 1000-digit number.731671765313306249192251196744265747423553491949349698352031277450632623957831801698480186947885184385861原创 2012-01-21 20:08:47 · 235 阅读 · 0 评论 -
Problem 7
ProblemBy 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?Code#include using namespace std;bool is原创 2012-01-21 20:07:11 · 273 阅读 · 0 评论 -
Problem 6
ProblemThe 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 t原创 2012-01-21 19:55:34 · 205 阅读 · 0 评论 -
Problem 5
Problem2520 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 n原创 2012-01-21 19:54:28 · 378 阅读 · 0 评论 -
Problem 4
ProblemA 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原创 2012-01-21 19:50:45 · 206 阅读 · 0 评论 -
Problem 3
problemThe prime factors of 13195 are 5, 7, 13 and 29.What is the largest prime factor of the number 600851475143 ?Code#include #include using namespace std;static vector factorsList;b原创 2012-01-21 19:49:05 · 183 阅读 · 0 评论 -
Problem 2
ProblemEach 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 cons原创 2012-01-21 19:46:34 · 218 阅读 · 0 评论 -
problem 1
ProblemIf 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.原创 2012-01-21 19:44:24 · 266 阅读 · 0 评论 -
Problem 18 & 67
ProblemBy starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.37 42 4 68 5 9 3That is, 3 + 7 + 4 + 9 =原创 2012-01-21 20:28:04 · 342 阅读 · 0 评论