task
stringlengths
0
154k
__index_level_0__
int64
0
39.2k
There are N empty boxes arranged in a row from left to right. The integer i is written on the i-th box from the left (1 \leq i \leq N). For each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it. We say a set of choices to put a ball or not in the boxes is good when the following con...
25,000
There are n cards (n is even) in the deck. Each card has a positive integer written on it. n / 2 people will play new card game. At the beginning of the game each player gets two cards, each card is given to exactly one player. Find the way to distribute cards such that the sum of values written of the cards will be ...
25,001
You are given a matrix f with 4 rows and n columns. Each element of the matrix is either an asterisk (*) or a dot (.). You may perform the following operation arbitrary number of times: choose a square submatrix of f with size k × k (where 1 ≤ k ≤ 4) and replace each element of the chosen submatrix with a dot. Choosin...
25,002
Sherlock is following N criminals, which are right now in a 2D grid. Each criminal at t=0, decides to move in certain fixed direction. Each criminal moves with same speed. These fixed directions are North, East, West and South. Two or more criminals, however, vanish whenever they meet at any place at same time, t>0. ...
25,003
Tanya is now five so all her friends gathered together to celebrate her birthday. There are n children on the celebration, including Tanya. The celebration is close to its end, and the last planned attraction is gaming machines. There are m machines in the hall, they are numbered 1 through m. Each of the children has ...
25,004
You have an n × m rectangle table, its cells are not initially painted. Your task is to paint all cells of the table. The resulting picture should be a tiling of the table with squares. More formally: * each cell must be painted some color (the colors are marked by uppercase Latin letters); * we will assume that ...
25,005
There are a set of points S on the plane. This set doesn't contain the origin O(0, 0), and for each two distinct points in the set A and B, the triangle OAB has strictly positive area. Consider a set of pairs of points (P1, P2), (P3, P4), ..., (P2k - 1, P2k). We'll call the set good if and only if: * k ≥ 2. * Al...
25,006
A film festival is coming up in the city N. The festival will last for exactly n days and each day will have a premiere of exactly one film. Each film has a genre — an integer from 1 to k. On the i-th day the festival will show a movie of genre ai. We know that a movie of each of k genres occurs in the festival progra...
25,007
You are given two integers b and w. You have a chessboard of size 10^9 × 10^9 with the top left cell at (1; 1), the cell (1; 1) is painted white. Your task is to find a connected component on this chessboard that contains exactly b black cells and exactly w white cells. Two cells are called connected if they share a s...
25,008
Problem description. “Murphy’s Law doesn’t meant that something bad will happen. It means that whatever can happen, will happen.” —Cooper While traveling across space-time,the data sent by NASA to "The Endurance" spaceship is sent in the format of, For...
25,009
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.
25,010
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, \dots By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
25,011
The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143?
25,012
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 \times 99. Find the largest palindrome made from the product of two 3-digit numbers.
25,013
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 divisible with no remainder by all of the numbers from 1 to 20?
25,014
The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385. The square of the sum of the first ten natural numbers is, (1 + 2 + ... + 10)^2 = 55^2 = 3025. Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 - 385 = 2640. Fi...
25,015
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?
25,016
The four adjacent digits in the 1000-digit number that have the greatest product are 9 \times 9 \times 8 \times 9 = 5832. 73167176531330624919225119674426574742355349194934 96983520312774506326239578318016984801869478851843 85861560789112949495459501737958331952853208805511 125406987471585238630507156932909632952274430...
25,017
A Pythagorean triplet is a set of three natural numbers, a \lt b \lt c, for which, a^2 + b^2 = c^2. For example, 3^2 + 4^2 = 9 + 16 = 25 = 5^2. There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc.
25,018
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million.
25,019
In the 20 \times 20 grid below, four numbers along a diagonal line have been marked in red. 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65 52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 ...
25,020
The sequence of triangle numbers is generated by adding the natural numbers. So the 7 th 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, 36, 45, 55, \dots Let us list the factors of the first seven triangle numbers: \begin{align} \mathbf 1 &\colon 1\\ \mat...
25,021
Work out the first ten digits of the sum of the following one-hundred 50-digit numbers. 37107287533902102798797998220837590246510135740250 46376937677490009712648124896970078050417018260538 74324986199524741059474233309513058123726617309629 91942213363574161572522430563301811072406154908250 2306758820753934617117198031...
25,022
The following iterative sequence is defined for the set of positive integers: n \to n/2 (n is even) n \to 3n + 1 (n is odd) Using the rule above and starting with 13, we generate the following sequence: 13 \to 40 \to 20 \to 10 \to 5 \to 16 \to 8 \to 4 \to 2 \to 1. It can be seen that this sequence (starting at 13 and f...
25,023
Starting in the top left corner of a 2 \times 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 \times 20 grid?
25,024
2^{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 2^{1000}?
25,025
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 example, 342 (three hu...
25,026
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 the maximum total from top to bottom of the triangle below: 75 95 64 17 47 82 18 35 87 10 20 04 82 47 65 19 01 23 75 03 34 88 02...
25,027
You are given the following information, but you may prefer to do some research for yourself. 1 Jan 1900 was a Monday. Thirty days has September, April, June and November. All the rest have thirty-one, Saving February alone, Which has twenty-eight, rain or shine. And on leap years, twenty-nine. A leap year occurs on an...
25,028
n! means n \times (n - 1) \times \cdots \times 3 \times 2 \times 1. For example, 10! = 10 \times 9 \times \cdots \times 3 \times 2 \times 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 digits in the number 100!.
25,029
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 \ne 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, 55 and 110; the...
25,030
Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical position in the list to obtain a name score. For example, whe...
25,031
A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect number. A number n is called deficient if the sum of its proper divisors is less than n and it is cal...
25,032
A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4. If all of the permutations are listed numerically or alphabetically, we call it lexicographic order. The lexicographic permutations of 0, 1 and 2 are: 012   021   102   120   201   210 What is ...
25,033
The Fibonacci sequence is defined by the recurrence relation: F_n = F_{n - 1} + F_{n - 2}, where F_1 = 1 and F_2 = 1. Hence the first 12 terms will be: \begin{align} F_1 &= 1\\ F_2 &= 1\\ F_3 &= 2\\ F_4 &= 3\\ F_5 &= 5\\ F_6 &= 8\\ F_7 &= 13\\ F_8 &= 21\\ F_9 &= 34\\ F_{10} &= 55\\ F_{11} &= 89\\ F_{12} &= 144 \end{ali...
25,034
A unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given: \begin{align} 1/2 &= 0.5\\ 1/3 &=0.(3)\\ 1/4 &=0.25\\ 1/5 &= 0.2\\ 1/6 &= 0.1(6)\\ 1/7 &= 0.(142857)\\ 1/8 &= 0.125\\ 1/9 &= 0.(1)\\ 1/10 &= 0.1 \end{align} Where 0.1(6) means 0.166666\cdot...
25,035
Euler discovered the remarkable quadratic formula: n^2 + n + 41 It turns out that the formula will produce 40 primes for the consecutive integer values 0 \le n \le 39. However, when n = 40, 40^2 + 40 + 41 = 40(40 + 1) + 41 is divisible by 41, and certainly when n = 41, 41^2 + 41 + 41 is clearly divisible by 41. The inc...
25,036
Starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows: 21 22 23 24 25 20 7 8 9 10 19  6 1 2 11 18 5 4 3 12 17 16 15 14 13 It can be verified that the sum of the numbers on the diagonals is 101. What is the sum of the numbers on the diagonals in a 1001 by 1001 s...
25,037
Consider all integer combinations of a^b for 2 \le a \le 5 and 2 \le b \le 5: \begin{matrix} 2^2=4, &2^3=8, &2^4=16, &2^5=32\\ 3^2=9, &3^3=27, &3^4=81, &3^5=243\\ 4^2=16, &4^3=64, &4^4=256, &4^5=1024\\ 5^2=25, &5^3=125, &5^4=625, &5^5=3125 \end{matrix} If they are then placed in numerical order, with any repeats remove...
25,038
Surprisingly there are only three numbers that can be written as the sum of fourth powers of their digits: \begin{align} 1634 &= 1^4 + 6^4 + 3^4 + 4^4\\ 8208 &= 8^4 + 2^4 + 0^4 + 8^4\\ 9474 &= 9^4 + 4^4 + 7^4 + 4^4 \end{align} As 1 = 1^4 is not a sum it is not included. The sum of these numbers is 1634 + 8208 + 9474 = ...
25,039
In the United Kingdom the currency is made up of pound (£) and pence (p). There are eight coins in general circulation: 1p, 2p, 5p, 10p, 20p, 50p, £1 (100p), and £2 (200p). It is possible to make £2 in the following way: 1×£1 + 1×50p + 2×20p + 1×5p + 1×2p + 3×1p How many different ways can £2 be made using any number o...
25,040
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, the 5-digit number, 15234, is 1 through 5 pandigital. The product 7254 is unusual, as the identity, 39 \times 186 = 7254, containing multiplicand, multiplier, and product is 1 through 9 pandigital. Find...
25,041
The fraction 49/98 is a curious fraction, as an inexperienced mathematician in attempting to simplify it may incorrectly believe that 49/98 = 4/8, which is correct, is obtained by cancelling the 9s. We shall consider fractions like, 30/50 = 3/5, to be trivial examples. There are exactly four non-trivial examples of thi...
25,042
145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145. Find the sum of all numbers which are equal to the sum of the factorial of their digits. Note: As 1! = 1 and 2! = 2 are not sums they are not included.
25,043
The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97. How many circular primes are there below one million?
25,044
The decimal number, 585 = 1001001001_2 (binary), is palindromic in both bases. Find the sum of all numbers, less than one million, which are palindromic in base 10 and base 2. (Please note that the palindromic number, in either base, may not include leading zeros.)
25,045
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 le...
25,046
Take the number 192 and multiply it by each of 1, 2, and 3: \begin{align} 192 \times 1 &= 192\\ 192 \times 2 &= 384\\ 192 \times 3 &= 576 \end{align} 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 sta...
25,047
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 \le 1000, is the number of solutions maximised?
25,048
An irrational decimal fraction is created by concatenating the positive integers: 0.12345678910{\color{red}\mathbf 1}112131415161718192021\cdots It can be seen that the 12 th digit of the fractional part is 1. If d_n represents the n th digit of the fractional part, find the value of the following expression. d_1 \time...
25,049
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?
25,050
The n th term of the sequence of triangle numbers is given by, t_n = \frac12n(n+1); so the first ten triangle numbers are: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, \dots 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 ...
25,051
The number, 1406357289, is a 0 to 9 pandigital number because it is made up of each of the digits 0 to 9 in some order, but it also has a rather interesting sub-string divisibility property. Let d_1 be the 1 st digit, d_2 be the 2 nd digit, and so on. In this way, we note the following: d_2d_3d_4=406 is divisible by 2 ...
25,052
Pentagonal numbers are generated by the formula, P_n=n(3n-1)/2. The first ten pentagonal numbers are: 1, 5, 12, 22, 35, 51, 70, 92, 117, 145, \dots It can be seen that P_4 + P_7 = 22 + 70 = 92 = P_8. However, their difference, 70 - 22 = 48, is not pentagonal. Find the pair of pentagonal numbers, P_j and P_k, for which ...
25,053
Triangle, pentagonal, and hexagonal numbers are generated by the following formulae: Triangle T_n=n(n+1)/2 1, 3, 6, 10, 15, \dots Pentagonal P_n=n(3n - 1)/2 1, 5, 12, 22, 35, \dots Hexagonal H_n=n(2n - 1) 1, 6, 15, 28, 45, \dots It can be verified that T_{285} = P_{165} = H_{143} = 40755. Find the next triangle number ...
25,054
It was proposed by Christian Goldbach that every odd composite number can be written as the sum of a prime and twice a square. \begin{align} 9 = 7 + 2 \times 1^2\\ 15 = 7 + 2 \times 2^2\\ 21 = 3 + 2 \times 3^2\\ 25 = 7 + 2 \times 3^2\\ 27 = 19 + 2 \times 2^2\\ 33 = 31 + 2 \times 1^2 \end{align} It turns out that the co...
25,055
The first two consecutive numbers to have two distinct prime factors are: \begin{align} 14 &= 2 \times 7\\ 15 &= 3 \times 5. \end{align} The first three consecutive numbers to have three distinct prime factors are: \begin{align} 644 &= 2^2 \times 7 \times 23\\ 645 &= 3 \times 5 \times 43\\ 646 &= 2 \times 17 \times 19....
25,056
The series, 1^1 + 2^2 + 3^3 + \cdots + 10^{10} = 10405071317. Find the last ten digits of the series, 1^1 + 2^2 + 3^3 + \cdots + 1000^{1000}.
25,057
The arithmetic sequence, 1487, 4817, 8147, in which each of the terms increases by 3330, is unusual in two ways: (i) each of the three terms are prime, and, (ii) each of the 4-digit numbers are permutations of one another. There are no arithmetic sequences made up of three 1-, 2-, or 3-digit primes, exhibiting this pro...
25,058
The prime 41, can be written as the sum of six consecutive primes: 41 = 2 + 3 + 5 + 7 + 11 + 13. This is the longest sum of consecutive primes that adds to a prime below one-hundred. The longest sum of consecutive primes below one-thousand that adds to a prime, contains 21 terms, and is equal to 953. Which prime, below...
25,059
By replacing the 1 st digit of the 2-digit number *3, it turns out that six of the nine possible values: 13, 23, 43, 53, 73, and 83, are all prime. By replacing the 3 rd and 4 th digits of 56**3 with the same digit, this 5-digit number is the first example having seven primes among the ten generated numbers, yielding t...
25,060
It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order. Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and 6x, contain the same digits.
25,061
There are exactly ten ways of selecting three from five, 12345: 123, 124, 125, 134, 135, 145, 234, 235, 245, and 345 In combinatorics, we use the notation, \displaystyle \binom 5 3 = 10. In general, \displaystyle \binom n r = \dfrac{n!}{r!(n-r)!}, where r \le n, n! = n \times (n-1) \times ... \times 3 \times 2 \times 1...
25,062
In the card game poker, a hand consists of five cards and are ranked, from lowest to highest, in the following way: High Card : Highest value card. One Pair : Two cards of the same value. Two Pairs : Two different pairs. Three of a Kind : Three cards of the same value. Straight : All cards are consecutive values. Flush...
25,063
If we take 47, reverse and add, 47 + 74 = 121, which is palindromic. Not all numbers produce palindromes so quickly. For example, \begin{align} 349 + 943 &= 1292\\ 1292 + 2921 &= 4213\\ 4213 + 3124 &= 7337 \end{align} That is, 349 took three iterations to arrive at a palindrome. Although no one has proved it yet, it is...
25,064
A googol (10^{100}) is a massive number: one followed by one-hundred zeros; 100^{100} is almost unimaginably large: one followed by two-hundred zeros. Despite their size, the sum of the digits in each number is only 1. Considering natural numbers of the form, a^b, where a, b \lt 100, what is the maximum digital sum?
25,065
It is possible to show that the square root of two can be expressed as an infinite continued fraction. \sqrt 2 =1+ \frac 1 {2+ \frac 1 {2 +\frac 1 {2+ \dots}}} By expanding this for the first four iterations, we get: 1 + \frac 1 2 = \frac 32 = 1.5 1 + \frac 1 {2 + \frac 1 2} = \frac 7 5 = 1.4 1 + \frac 1 {2 + \frac 1 ...
25,066
Starting with 1 and spiralling anticlockwise in the following way, a square spiral with side length 7 is formed. 37 36 35 34 33 32 31 38 17 16 15 14 13 30 39 18 5 4 3 12 29 40 19  6  1  2 11 28 41 20 7 8  9 10 27 42 21 22 23 24 25 26 43 44 45 46 47 48 49 It is interesting to note that the odd squares lie along the bott...
25,067
Each character on a computer is assigned a unique code and the preferred standard is ASCII (American Standard Code for Information Interchange). For example, uppercase A = 65, asterisk (*) = 42, and lowercase k = 107. A modern encryption method is to take a text file, convert the bytes to ASCII, then XOR each byte with...
25,068
The primes 3, 7, 109, and 673, are quite remarkable. By taking any two primes and concatenating them in any order the result will always be prime. For example, taking 7 and 109, both 7109 and 1097 are prime. The sum of these four primes, 792, represents the lowest sum for a set of four primes with this property. Find t...
25,069
Triangle, square, pentagonal, hexagonal, heptagonal, and octagonal numbers are all figurate (polygonal) numbers and are generated by the following formulae: Triangle P_{3,n}=n(n+1)/2 1, 3, 6, 10, 15, \dots Square P_{4,n}=n^2 1, 4, 9, 16, 25, \dots Pentagonal P_{5,n}=n(3n-1)/2 1, 5, 12, 22, 35, \dots Hexagonal P_{6,n}=n...
25,070
The cube, 41063625 (345^3), can be permuted to produce two other cubes: 56623104 (384^3) and 66430125 (405^3). In fact, 41063625 is the smallest cube which has exactly three permutations of its digits which are also cube. Find the smallest cube for which exactly five permutations of its digits are cube.
25,071
The 5-digit number, 16807=7^5, is also a fifth power. Similarly, the 9-digit number, 134217728=8^9, is a ninth power. How many n-digit positive integers exist which are also an nth power?
25,072
All square roots are periodic when written as continued fractions and can be written in the form: \displaystyle \quad \quad \sqrt{N}=a_0+\frac 1 {a_1+\frac 1 {a_2+ \frac 1 {a3+ \dots}}} For example, let us consider \sqrt{23}: \quad \quad \sqrt{23}=4+\sqrt{23}-4=4+\frac 1 {\frac 1 {\sqrt{23}-4}}=4+\frac 1 {1+\frac{\sqr...
25,073
The square root of 2 can be written as an infinite continued fraction. \sqrt{2} = 1 + \dfrac{1}{2 + \dfrac{1}{2 + \dfrac{1}{2 + \dfrac{1}{2 + ...}}}} The infinite continued fraction can be written, \sqrt{2} = [1; (2)], (2) indicates that 2 repeats ad infinitum . In a similar way, \sqrt{23} = [4; (1, 3, 1, 8)]. It turns...
25,074
Consider quadratic Diophantine equations of the form: x^2 - Dy^2 = 1 For example, when D=13, the minimal solution in x is 649^2 - 13 \times 180^2 = 1. It can be assumed that there are no solutions in positive integers when D is square. By finding minimal solutions in x for D = \{2, 3, 5, 6, 7\}, we obtain the following...
25,075
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 the maximum total from top to bottom in triangle.txt (right click and 'Save Link/Target As...'), a 15K text file containing a tr...
25,076
Consider the following "magic" 3-gon ring, filled with the numbers 1 to 6, and each line adding to nine. Working clockwise , and starting from the group of three with the numerically lowest external node (4,3,2 in this example), each solution can be described uniquely. For example, the above solution can be described b...
25,077
Euler's totient function, \phi(n) [sometimes called the phi function], is defined as the number of positive integers not exceeding n which are relatively prime to n. For example, as 1, 2, 4, 5, 7, and 8, are all less than or equal to nine and relatively prime to nine, \phi(9)=6. n Relatively Prime \phi(n) n/\phi(n) 2 1...
25,078
Euler's totient function, \phi(n) [sometimes called the phi function], is used to determine the number of positive numbers less than or equal to 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, \phi(9)=6. The number 1 is considered to be relat...
25,079
Consider the fraction, \dfrac n d, where n and d are positive integers. If n \lt d and \operatorname{HCF}(n,d)=1, it is called a reduced proper fraction. If we list the set of reduced proper fractions for d \le 8 in ascending order of size, we get: \frac 1 8, \frac 1 7, \frac 1 6, \frac 1 5, \frac 1 4, \frac 2 7, \frac...
25,080
Consider the fraction, \dfrac n d, where n and d are positive integers. If n \lt d and \operatorname{HCF}(n,d)=1, it is called a reduced proper fraction. If we list the set of reduced proper fractions for d \le 8 in ascending order of size, we get: \frac 1 8, \frac 1 7, \frac 1 6, \frac 1 5, \frac 1 4, \frac 2 7, \frac...
25,081
Consider the fraction, \dfrac n d, where n and d are positive integers. If n \lt d and \operatorname{HCF}(n, d)=1, it is called a reduced proper fraction. If we list the set of reduced proper fractions for d \le 8 in ascending order of size, we get: \frac 1 8, \frac 1 7, \frac 1 6, \frac 1 5, \frac 1 4, \frac 2 7, \fra...
25,082
The number 145 is well known for the property that the sum of the factorial of its digits is equal to 145: 1! + 4! + 5! = 1 + 24 + 120 = 145. Perhaps less well known is 169, in that it produces the longest chain of numbers that link back to 169; it turns out that there are only three such loops that exist: \begin{align...
25,083
It turns out that \pu{12 cm} is the smallest length of wire that can be bent to form an integer sided right angle triangle in exactly one way, but there are many more examples. \pu{\mathbf{12} \mathbf{cm}}: (3,4,5) \pu{\mathbf{24} \mathbf{cm}}: (6,8,10) \pu{\mathbf{30} \mathbf{cm}}: (5,12,13) \pu{\mathbf{36} \mathbf{cm...
25,084
It is possible to write five as a sum in exactly six different ways: \begin{align} &4 + 1\\ &3 + 2\\ &3 + 1 + 1\\ &2 + 2 + 1\\ &2 + 1 + 1 + 1\\ &1 + 1 + 1 + 1 + 1 \end{align} How many different ways can one hundred be written as a sum of at least two positive integers?
25,085
It is possible to write ten as the sum of primes in exactly five different ways: \begin{align} &7 + 3\\ &5 + 5\\ &5 + 3 + 2\\ &3 + 3 + 2 + 2\\ &2 + 2 + 2 + 2 + 2 \end{align} What is the first value which can be written as the sum of primes in over five thousand different ways?
25,086
Let p(n) represent the number of different ways in which n coins can be separated into piles. For example, five coins can be separated into piles in exactly seven different ways, so p(5)=7. OOOOO OOOO   O OOO   OO OOO   O   O OO   OO   O OO   O   O   O O   O   O   O   O Find the least value of n for which p(n) is divis...
25,087
A common security method used for online banking is to ask the user for three random characters from a passcode. For example, if the passcode was 531278, they may ask for the 2nd, 3rd, and 5th characters; the expected reply would be: 317. The text file, keylog.txt , contains fifty successful login attempts. Given that ...
25,088
It is well known that if the square root of a natural number is not an integer, then it is irrational. The decimal expansion of such square roots is infinite without any repeating pattern at all. The square root of two is 1.41421356237309504880\cdots, and the digital sum of the first one hundred decimal digits is 475. ...
25,089
In the 5 by 5 matrix below, the minimal path sum from the top left to the bottom right, by only moving to the right and down , is indicated in bold red and is equal to 2427. \begin{pmatrix} \color{red}{131} & 673 & 234 & 103 & 18\\ \color{red}{201} & \color{red}{96} & \color{red}{342} & 965 & 150\\ 630 & 803 & \color{...
25,090
NOTE: This problem is a more challenging version of Problem 81 . The minimal path sum in the 5 by 5 matrix below, by starting in any cell in the left column and finishing in any cell in the right column, and only moving up, down, and right, is indicated in red and bold; the sum is equal to 994. \begin{pmatrix} 131 & 6...
25,091
NOTE: This problem is a significantly more challenging version of Problem 81 . In the 5 by 5 matrix below, the minimal path sum from the top left to the bottom right, by moving left, right, up, and down, is indicated in bold red and is equal to 2297. \begin{pmatrix} \color{red}{131} & 673 & \color{red}{234} & \color{r...
25,092
In the game, Monopoly , the standard board is set up in the following way: A player starts on the GO square and adds the scores on two 6-sided dice to determine the number of squares they advance in a clockwise direction. Without any further rules we would expect to visit each square with equal probability: 2.5%. Howev...
25,093
By counting carefully it can be seen that a rectangular grid measuring 3 by 2 contains eighteen rectangles: Although there exists no rectangular grid that contains exactly two million rectangles, find the area of the grid with the nearest solution.
25,094
A spider, S, sits in one corner of a cuboid room, measuring 6 by 5 by 3, and a fly, F, sits in the opposite corner. By travelling on the surfaces of the room the shortest "straight line" distance from S to F is 10 and the path is shown on the diagram. However, there are up to three "shortest" path candidates for any gi...
25,095
The smallest number expressible as the sum of a prime square, prime cube, and prime fourth power is 28. In fact, there are exactly four numbers below fifty that can be expressed in such a way: \begin{align} 28 &= 2^2 + 2^3 + 2^4\\ 33 &= 3^2 + 2^3 + 2^4\\ 49 &= 5^2 + 2^3 + 2^4\\ 47 &= 2^2 + 3^3 + 2^4 \end{align} How man...
25,096
A natural number, N, that can be written as the sum and product of a given set of at least two natural numbers, \{a_1, a_2, \dots, a_k\} is called a product-sum number: N = a_1 + a_2 + \cdots + a_k = a_1 \times a_2 \times \cdots \times a_k. For example, 6 = 1 + 2 + 3 = 1 \times 2 \times 3. For a given set of size, k, w...
25,097
For a number written in Roman numerals to be considered valid there are basic rules which must be followed. Even though the rules allow some numbers to be expressed in more than one way there is always a "best" way of writing a particular number. For example, it would appear that there are at least six ways of writing ...
25,098
Each of the six faces on a cube has a different digit (0 to 9) written on it; the same is done to a second cube. By placing the two cubes side-by-side in different positions we can form a variety of 2-digit numbers. For example, the square number 64 could be formed: In fact, by carefully choosing the digits on both cub...
25,099