
project euler
董一峰
苟有恒,何必三更眠五更起;最无益,莫过一日曝十日寒。
展开
-
Problem 1 Multiples of 3 and 5
Problem 1 Multiples of 3 and 5 project euler原创 2017-07-13 16:49:59 · 288 阅读 · 0 评论 -
Problem 15 Lattice paths
project euler Problem 15 Lattice paths Starting in the top left corner of a 2×2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner. How many such routes are there through a 20×20 grid?原创 2017-07-26 10:42:31 · 383 阅读 · 0 评论 -
Problem 48 Self powers
The series, 11+22+33+...+1010=104050713171^1 + 2^2 + 3^3 + ... + 10^{10} = 10405071317. Find the last ten digits of the series, 11+22+33+...+100010001^1 + 2^2 + 3^3 + ... + 1000^{1000}.str(sum([ i**i原创 2017-07-18 15:37:48 · 342 阅读 · 0 评论 -
Problem 7 10001st prime
project euler Problem 7 10001st prime 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?原创 2017-07-18 14:03:22 · 298 阅读 · 0 评论 -
Problem 3 Largest prime factor
project euler problem 3 largest prime factor The prime factors of 13195 are 5, 7, 13 and 29.What is the largest prime factor of the number 600851475143 ?import mathdef is_prime(n):原创 2017-07-14 10:55:35 · 248 阅读 · 0 评论 -
Problem 11 Largest product in a grid
Problem 11 Largest product in a grid In the 20×20 grid below, four numbers along a diagonal line have been marked in red. The product of these numbers is 26 × 63 × 78 × 14 = 1788696. What is the greatest product of four adjacent numbers in the same directi原创 2017-07-21 12:30:45 · 379 阅读 · 0 评论 -
Problem 10 Summation of primes
project euler Problem 10 Summation of primes The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million.原创 2017-07-21 12:26:54 · 332 阅读 · 0 评论 -
Problem 8 Largest product in a series
prodect euler Problem 8 Largest product in a series The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832. Find the thirteen adjacent digits in the 1000-digit number that have the greatest product. What i原创 2017-07-20 11:48:51 · 460 阅读 · 0 评论 -
Problem 5 Smallest multiple
Problem 5 Smallest multiple 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?原创 2017-07-15 16:33:53 · 399 阅读 · 0 评论 -
Problem 6 Sum square difference
The sum of the squares of the first ten natural numbers is, 12+22+...+102=3851^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ten natural numbers is, (1+2+...+10)2=552=3025(1 + 2 + ..原创 2017-07-15 17:18:25 · 409 阅读 · 0 评论 -
Problem 4 Largest palindrome product
project euler Largest palindrome product 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.原创 2017-07-14 12:28:03 · 343 阅读 · 0 评论 -
Problem 2 Even Fibonacci numbers
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原创 2017-07-13 18:23:14 · 258 阅读 · 0 评论 -
Problem 16 Power digit sum
project euler Problem 16 Power digit sum 215=327682^{15} = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.What is the sum of the digits of the number 210002^{1000}?原创 2017-07-26 12:08:30 · 540 阅读 · 2 评论