ebb n.退潮; 落潮衰退; 衰落 vi.(指潮水)退; 落减少; 衰落
scavenger n.捡破烂的人食腐动物
codfish n.鳕鱼
If p is the perimeter of a right angle triangle with integral length sides, {a,b,c}, there are exactly three solutions for p = 120.
{20,48,52}, {24,45,51}, {30,40,50}
For which value of p 1000, is the number of solutions maximised?
My Solution
(if (> currentnum maxnum)
(progn (setq maxnum currentnum)
Others' Solution(if (primep square)
(incf tempvar))
(if (primep (- square spiralstep))
(incf tempvar))
(if (primep (- square spiralstep spiralstep))
(incf tempvar))
(if (primep (- square spiralstep spiralstep spiralstep))
(incf tempvar))
(if (< (/ tempvar (- (* 2 i) 1.0))
0.1)
(return i))))))
do(progn (setq tempar (/ j i))
(if (and (= 1 (gcd i j))
(> tempar currentnumber)
(< tempar constnumber))
(progn (setq currentnumber tempar)
(incf num)))))))
We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once. For example, 2143 is a 4-digit pandigital and is also prime.
What is the largest n-digit pandigital prime that exists?
Consider the fraction, n/d, where n and d are positive integers. If nd and HCF(n,d)=1, it is called a reduced proper fraction.
If we list the set of reduced proper fractions for d 8 in ascending order of size, we get:
1/8, 1/7, 1/6, 1/5, 1/4, 2/7, 1/3, 3/8, 2/5, 3/7, 1/2, 4/7, 3/5, 5/8, 2/3, 5/7, 3/4, 4/5, 5/6, 6/7, 7/8
It can be seen that there are 3 fractions between 1/3 and 1/2.
How many fractions lie between 1/3 and 1/2 in the sorted set of reduced proper fractions for d 10,000?
My Solution
Let r be the remainder when (a1)n + (a+1)n is divided by a2.
For example, if a = 7 and n = 3, then r = 42: 63 + 83 = 728 42 mod 49. And as n varies, so too will r, but for a = 7 it turns out that rmax = 42.
For 3 a 1000, find rmax.
My Solution
Euler's Totient function, φ(n) [sometimes called the phi function], is used to determine the number of numbers less than n which are relatively prime to n. For example, as 1, 2, 4, 5, 7, and 8, are all less than nine and relatively prime to nine, φ(9)=6.
n | Relatively Prime | φ(n) | n/φ(n) |
2 | 1 | 1 | 2 |
3 | 1,2 | 2 | 1.5 |
4 | 1,3 | 2 | 2 |
5 | 1,2,3,4 | 4 | 1.25 |
6 | 1,5 | 2 | 3 |
7 | 1,2,3,4,5,6 | 6 | 1.1666... |
8 | 1,3,5,7 | 4 | 2 |
9 | 1,2,4,5,7,8 | 6 | 1.5 |
10 | 1,3,7,9 | 4 | 2.5 |
It can be seen that n=6 produces a maximum n/φ(n) for n 10.
Find the value of n 1,000,000 for which n/φ(n) is a maximum.
My Solution
The proper divisors of a number are all the divisors excluding the number itself. For example, the proper divisors of 28 are 1, 2, 4, 7, and 14. As the sum of these divisors is equal to 28, we call it a perfect number.
Interestingly the sum of the proper divisors of 220 is 284 and the sum of the proper divisors of 284 is 220, forming a chain of two numbers. For this reason, 220 and 284 are called an amicable pair.
Perhaps less well known are longer chains. For example, starting with 12496, we form a chain of five numbers:
12496 14288 15472 14536 14264 ( 12496 ...)
Since this chain returns to its starting point, it is called an amicable chain.
Find the smallest member of the longest amicable chain with no element exceeding one million.