Problem 45 - After 40755, what is the next triangle number that is also pentagonal and hexagonal?
링크 Triangle, pentagonal, and hexagonal numbers are generated by the following formulae: Triangle Tn=n(n+1)/2 1, 3, 6, 10, 15, ... Pentagonal Pn=n(3n1)/2 1, 5, 12, 22, 35, ... Hexagonal Hn=n(2n1) 1, 6, 15, 28, 45, ... It can be verified that T285 = P165 = H143 = 40755. Find the next triangle number that is also pentagonal and hexagonal. python - ugly brute force limit = 100000 T = set([x*(x+1)/2 ..
더보기
Problem 44 - Find the smallest pair of pentagonal numbers whose sum and difference is pentagonal.
링크 Pentagonal numbers are generated by the formula, Pn=n(3n1)/2. The first ten pentagonal numbers are: 1, 5, 12, 22, 35, 51, 70, 92, 117, 145, ... It can be seen that P4 + P7 = 22 + 70 = 92 = P8. However, their difference, 70 22 = 48, is not pentagonal. Find the pair of pentagonal numbers, Pj and Pk, for which their sum and difference is pentagonal and D = |Pk Pj| is minimised; what is the value..
더보기
Problem 42 - How many triangle words does the list of common English words contain?
링크 The nth term of the sequence of triangle numbers is given by, tn = ½n(n+1); so the first ten triangle numbers are: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... By converting each letter in a word to a number corresponding to its alphabetical position and adding these values we form a word value. For example, the word value for SKY is 19 + 11 + 25 = 55 = t10. If the word value is a triangle number..
더보기
Problem 39 - If p is the perimeter of a right angle triangle, {a, b, c}, which value, for p ≤ 1000, has the most solutions?
링크 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? 참고 Problem 9 - "Find the only Pythagorean triplet, {a, b, c}, for which a + b + c = 1000" python import math import fractions ans = (0, 0) for p in range(12, 1001,..
더보기
Problem 38 - What is the largest 1 to 9 pandigital that can be formed by multiplying a fixed number by 1, 2, 3, ... ?
링크 Take the number 192 and multiply it by each of 1, 2, and 3: 192 1 = 192 192 2 = 384 192 3 = 576 By concatenating each product we get the 1 to 9 pandigital, 192384576. We will call 192384576 the concatenated product of 192 and (1,2,3) The same can be achieved by starting with 9 and multiplying by 1, 2, 3, 4, and 5, giving the pandigital, 918273645, which is the concatenated product of 9 and (1..
더보기
Problem 37 - Find the sum of all eleven primes that are both truncatable from left to right and right to left.
링크 The number 3797 has an interesting property. Being prime itself, it is possible to continuously remove digits from left to right, and remain prime at each stage: 3797, 797, 97, and 7. Similarly we can work from right to left: 3797, 379, 37, and 3. Find the sum of the only eleven primes that are both truncatable from left to right and right to left. NOTE: 2, 3, 5, and 7 are not considered to b..
더보기