摘要:
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 are called amicable numbers.For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44,. 阅读全文
摘要:
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 were written out in words, how many letters would be used?NOTE:Do not count spaces or hyphens. For examp 阅读全文
摘要:
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?题目大意:题目大意:215= 32768 并且其各位之和为 is 3 + 2 + 7 + 6 + 8 = 26.21000的各位数之和是多少?// (Problem 16)Power digit sum// Completed on Sun, 17 Nov 2013, 15:23// Language: C//// 版权所有(C)acutus (mail: acutu.. 阅读全文
摘要:
Starting in the top left corner of a 22 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 2020 grid?题目大意:从一个22网格的左上角开始,有6条(不允许往回走)通往右下角的路。对于2020的网格,这样的路有多少条?// (Problem 15)Lattice paths// Completed 阅读全文
摘要:
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 sequence:13 40 20 10 5 16 8 4 2 1It can be seen that this sequence (starting at 13 and finishing at 1) con... 阅读全文
摘要:
Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.371072875339021027987979982208375902465101357402504637693767749000971264812489697007805041701826053874324986199524741059474233309513058123726617309629919422133635741615725224305633018110724061549082502306758820753 阅读全文
摘要:
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.Find the sum of all the primes below two million.#include#include#include#define N 2000000bool prim(int n){ int i; for(i=2; i*i<=n; i++) { if(n%i==0) return false; } return true;}int main(){ int i; long long ... 阅读全文
摘要:
A Pythagorean triplet is a set of three natural numbers,abc, for which,a2+b2=c2For example, 32+ 42= 9 + 16 = 25 = 52.There exists exactly one Pythagorean triplet for whicha+b+c= 1000.Find the productabc.#include#include#include#include#include#includevoid show(){ int a,b,c; for(a=1; a<333; a++... 阅读全文
摘要:
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?#include #include #include #include int prim(int n){ int i; for(i=2; i*i<=n; i++) { if(n%i==0) return 0; } return 1;} void solve(int n){ int... 阅读全文
摘要:
Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025385 = 2640.Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.前十个自然数的平方和是:12+ 22+ ... + 102= 385前十个自然数的和的平方是:(1 + 2 阅读全文