码迷,mamicode.com
首页 >  
搜索关键字:euler    ( 502个结果
Project Euler:Problem 25 1000-digit Fibonacci number
The Fibonacci sequence is defined by the recurrence relation: Fn = Fn?1 + Fn?2, where F1 = 1 and F2 = 1. Hence the first 12 terms will be: F1 = 1 F2 = 1 F3 = 2 F4 = 3 F5 = 5 F6 = 8 F7 = 1...
分类:其他好文   时间:2015-06-02 00:33:24    阅读次数:168
Project Euler:Problem 21 Amicable numbers
Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n). If d(a) = b and d(b) = a, where a ≠ b, then a and b are an amicable pair and each of a and b a...
分类:其他好文   时间:2015-06-01 16:43:34    阅读次数:126
Project Euler:Problem 20 Factorial digit sum
n! means n × (n ? 1) × ... × 3 × 2 × 1 For example, 10! = 10 × 9 × ... × 3 × 2 × 1 = 3628800, and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27. Find the sum of the digi...
分类:其他好文   时间:2015-05-31 15:22:58    阅读次数:131
Project Euler: Problem 17 Number letter counts
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) inclusive we...
分类:其他好文   时间:2015-05-31 12:33:14    阅读次数:126
Project Euler:Problem 18 Maximum path sum I
By 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. 3 7 4 2 4 6 8 5 9 3 That is, 3 + 7 + 4 + 9 = 23. Find th...
分类:其他好文   时间:2015-05-31 12:30:05    阅读次数:115
Project Euler:Problem 16 Power digit sum
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? #include #include using namespace std; int main() { string s = "1"; for (...
分类:其他好文   时间:2015-05-31 11:01:20    阅读次数:133
Project Euler: Problem 9 Special Pythagorean triplet
A Pythagorean triplet is a set of three natural numbers, a  b  c, for which, a2 + b2 = c2 For example, 32 + 42 = 9 + 16 = 25 = 52. There exists exactly one Pythagorean triplet for which a + b + c...
分类:其他好文   时间:2015-05-31 09:37:13    阅读次数:172
Project Euler:Problem 12 Highly divisible triangular number
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,...
分类:其他好文   时间:2015-05-31 09:31:48    阅读次数:165
Project Euler: Problem 14 Longest Collatz sequence
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 sequ...
分类:其他好文   时间:2015-05-31 09:27:37    阅读次数:117
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×...
分类:其他好文   时间:2015-05-31 09:26:08    阅读次数:135
502条   上一页 1 ... 37 38 39 40 41 ... 51 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!