task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
Denote the average of k numbers x_1, ..., x_k by \bar{x} = \frac{1}{k} \sum_i x_i. Their variance is defined as \frac{1}{k} \sum_i \left( x_i - \bar{x} \right) ^ 2. Let S(n) be the sum of all quadruples of integers (a,b,c,d) satisfying 1 \leq a \leq b \leq c \leq d \leq n such that their average is exactly twice their ... | 25,800 |
We define \nu_2(n) to be the largest integer r such that 2^r divides n. For example, \nu_2(24) = 3. Define \displaystyle S(n) = \sum_{k = 1}^n (-2)^k\binom{2k}k and u(n) = \nu_2\Big(3S(n)+4\Big). For example, when n = 4 then S(4) = 980 and 3S(4) + 4 = 2944 = 2^7 \cdot 23, hence u(4) = 7. You are also given u(20) = 24.... | 25,801 |
Let S_i be an integer sequence produced with the following pseudo-random number generator: S_0 = 290797 S_{i+1} = S_i ^2 \bmod 50515093 Let M(n) be the median of the pairwise products S_i S_j for 0 \le i \lt j \lt n. You are given M(3) = 3878983057768 and M(103) = 492700616748525. Find M(1\,000\,003). | 25,802 |
This problem uses half open interval notation where [a,b) represents a \le x < b. A real number, x_1, is chosen in the interval [0,1). A second real number, x_2, is chosen such that each of [0,\frac{1}{2}) and [\frac{1}{2},1) contains exactly one of (x_1, x_2). Continue such that on the n-th step a real number, x_n, is... | 25,803 |
For a positive integer n, the function g(n) is defined as \displaystyle g(n)=\sum_{i=1}^{n} (-1)^i \gcd \left(n,i^2\right) For example, g(4) = -\gcd \left(4,1^2\right) + \gcd \left(4,2^2\right) - \gcd \left(4,3^2\right) + \gcd \left(4,4^2\right) = -1+4-1+4=6. You are also given g(1234)=1233. Let \displaystyle G(N) = \s... | 25,804 |
A standard 52 card deck comprises thirteen ranks in four suits. However, modern decks have two additional Jokers, which neither have a suit nor a rank, for a total of 54 cards. If we shuffle such a deck and draw cards without replacement, then we would need, on average, approximately 29.05361725 cards so that we have a... | 25,805 |
A monic polynomial is a single-variable polynomial in which the coefficient of highest degree is equal to 1. Define \mathcal{F} to be the set of all monic polynomials with integer coefficients (including the constant polynomial p(x)=1). A polynomial p(x)\in\mathcal{F} is cyclogenic if there exists q(x)\in\mathcal{F} an... | 25,806 |
Two players play a game with a deck of cards which contains s suits with each suit containing n cards numbered from 1 to n. Before the game starts, a set of cards (which may be empty) is picked from the deck and placed face-up on the table, with no overlap. These are called the visible cards. The players then make move... | 25,807 |
Pentagonal numbers are generated by the formula: P_n = \tfrac 12n(3n-1) giving the sequence: 1,5,12,22,35, 51,70,92,\ldots Some pentagonal numbers can be expressed as the sum of two other pentagonal numbers. For example: P_8 = 92 = 22 + 70 = P_4 + P_7 3577 is the smallest pentagonal number that can be expressed as the... | 25,808 |
An integer of the form p^q q^p with prime numbers p \neq q is called a hybrid-integer . For example, 800 = 2^5 5^2 is a hybrid-integer. We define C(n) to be the number of hybrid-integers less than or equal to n. You are given C(800) = 2 and C(800^{800}) = 10790. Find C(800800^{800800}). | 25,809 |
The positive integral solutions of the equation x^y=y^x are (2,4), (4,2) and (k,k) for all k > 0. For a given positive integer n, let f(n) be the number of integral values 0 < x,y \leq n^2-n such that
x^y\equiv y^x \pmod n.
For example, f(5)=104 and f(97)=1614336. Let S(M,N)=\sum f(p) where the sum is taken over all pr... | 25,810 |
Let \Bbb R^2 be the set of pairs of real numbers (x, y). Let \pi = 3.14159\cdots\ . Consider the function f from \Bbb R^2 to \Bbb R^2 defined by f(x, y) = (x^2 - x - y^2, 2xy - y + \pi), and its n-th iterated composition f^{(n)}(x, y) = f(f(\cdots f(x, y)\cdots)). For example f^{(3)}(x, y) = f(f(f(x, y))). A pair (x, y... | 25,811 |
Rand48 is a pseudorandom number generator used by some programming languages. It generates a sequence from any given integer 0 \le a_0 < 2^{48} using the rule a_n = (25214903917 \cdot a_{n - 1} + 11) \bmod 2^{48}. Let b_n = \lfloor a_n / 2^{16} \rfloor \bmod 52.
The sequence b_0, b_1, \dots is translated to an infinite... | 25,812 |
Let g(n) denote the number of ways a positive integer n can be represented in the form: x^2+xy+41y^2 where x and y are integers. For example, g(53)=4 due to (x,y) \in \{(-4,1),(-3,-1),(3,1),(4,-1)\}. Define \displaystyle T(N)=\sum_{n=1}^{N}g(n). You are given T(10^3)=474 and T(10^6)=492128. Find T(10^{16}). | 25,813 |
For a positive integer n, let s(n) be the integer obtained by shifting the leftmost digit of the decimal representation of n to the rightmost position. For example, s(142857)=428571 and s(10)=1. For a positive rational number r, we define N(r) as the smallest positive integer n such that s(n)=r\cdot n. If no such integ... | 25,814 |
This problem combines the game of Nim with the Towers of Hanoi. For a brief introduction to the rules of these games, please refer to Problem 301 and Problem 497 , respectively. The unique shortest solution to the Towers of Hanoi problem with n disks and 3 pegs requires 2^n-1 moves. Number the positions in the solution... | 25,815 |
Given a circle C and an integer n > 1, we perform the following operations. In step 0, we choose two uniformly random points R_0 and B_0 on C. In step i (1 \leq i < n), we first choose a uniformly random point R_i on C and connect the points R_{i - 1} and R_i with a red rope; then choose a uniformly random point B_i on... | 25,816 |
Both 169 and 961 are the square of a prime. 169 is the reverse of 961. We call a number a reversible prime square if: It is not a palindrome, and It is the square of a prime, and Its reverse is also the square of a prime. 169 and 961 are not palindromes, so both are reversible prime squares. Find the sum of the first 5... | 25,817 |
The following is a function defined for all positive rational values of x. f(x)=\begin{cases} x &x\text{ is integral}\\
f(\frac 1{1-x}) &x \lt 1\\
f\Big(\frac 1{\lceil x\rceil -x}-1+f(x-1)\Big) &\text{otherwise}\end{cases} For example, f(3/2)=3, f(1/6) = 65533 and f(13/10) = 7625597484985. Find f(22/7). Gi... | 25,818 |
We use x\oplus y for the bitwise XOR of x and y. Define the XOR-product of x and y, denoted by x \otimes y, similar to a long multiplication in base 2, except that the intermediate results are XORed instead of the usual integer addition. For example, 7 \otimes 3 = 9, or in base 2, 111_2 \otimes 11_2 = 1001_2:
\begin{a... | 25,819 |
Let b(n) be the largest power of 2 that divides n. For example b(24) = 8. Define the recursive function:
\begin{align*}
\begin{split}
A(0) &= 1\\
A(2n) &= 3A(n) + 5A\big(2n - b(n)\big) \qquad n \gt 0\\
A(2n+1) &= A(n)
\end{split}
\end{align*}
and let H(t,r) = A\big((2^t+1)^r\big). You are given H(3,2) = A(81) = 636056... | 25,820 |
A dynamical polynomial is a monic leading coefficient is 1 polynomial f(x) with integer coefficients such that f(x) divides f(x^2-2). For example, f(x) = x^2 - x - 2 is a dynamical polynomial because f(x^2-2) = x^4-5x^2+4 = (x^2 + x -2)f(x). Let S(n) be the number of dynamical polynomials of degree n. For example, S(2)... | 25,821 |
We use x\oplus y to be the bitwise XOR of x and y. Define the XOR-product of x and y, denoted by x \otimes y, similar to a long multiplication in base 2, except that the intermediate results are XORed instead of the usual integer addition. For example, 11 \otimes 11 = 69, or in base 2, 1011_2 \otimes 1011_2 = 1000101_2... | 25,822 |
4n people stand in a circle with their heads down. When the bell rings they all raise their heads and either look at the person immediately to their left, the person immediately to their right or the person diametrically opposite. If two people find themselves looking at each other they both scream. Define S(n) to be t... | 25,823 |
A pack of cards contains 4n cards with four identical cards of each value. The pack is shuffled and cards are dealt one at a time and placed in piles of equal value. If the card has the same value as any pile it is placed in that pile. If there is no pile of that value then it begins a new pile. When a pile has four ca... | 25,824 |
We create an array of points P_n in a two dimensional plane using the following random number generator: s_0=290797 s_{n+1}={s_n}^2 \bmod 50515093 P_n=(s_{2n},s_{2n+1}) Let d(k) be the shortest distance of any two (distinct) points among P_0, \cdots, P_{k - 1}. E.g. d(14)=546446.466846479. Find d(2000000). Give your ... | 25,825 |
Define m = M(n, d) to be the smallest positive integer such that when m^2 is written in base n it includes the base n digit d. For example, M(10,7) = 24 because if all the squares are written out in base 10 the first time the digit 7 occurs is in 24^2 = 576. M(11,10) = 19 as 19^2 = 361=2A9_{11}. Find \displaystyle \sum... | 25,826 |
The SET® card game is played with a pack of 81 distinct cards. Each card has four features (Shape, Color, Number, Shading). Each feature has three different variants (e.g. Color can be red, purple, green). A SET consists of three different cards such that each feature is either the same on each card or different on eac... | 25,827 |
Given an n-tuple of numbers another n-tuple is created where each element of the new n-tuple is chosen randomly from the numbers in the previous n-tuple. For example, given (2,2,3) the probability that 2 occurs in the first position in the next 3-tuple is 2/3. The probability of getting all 2's would be 8/27 while the ... | 25,828 |
Let d_n(x) be the n th decimal digit of the fractional part of x, or 0 if the fractional part has fewer than n digits. For example: d_7 \mathopen{}\left( 1 \right)\mathclose{} = d_7 \mathopen{}\left( \frac 1 2 \right)\mathclose{} = d_7 \mathopen{}\left( \frac 1 4 \right)\mathclose{} = d_7 \mathopen{}\left( \frac 1 5 \r... | 25,829 |
A set, S, of integers is called 123-separable if S, 2S and 3S are disjoint. Here 2S and 3S are obtained by multiplying all the elements in S by 2 and 3 respectively. Define F(n) to be the maximum number of elements of
(S\cup 2S \cup 3S)\cap \{1,2,3,\ldots,n\}
where S ranges over all 123-separable sets. For example, F(6... | 25,830 |
A list initially contains the numbers 2, 3, \dots, n. At each round, the smallest number in the list is replaced by its square. If there is more than one such number, then only one of them is replaced. For example, below are the first three rounds for n = 5:
[2, 3, 4, 5] \xrightarrow{(1)} [4, 3, 4, 5] \xrightarrow{(2)}... | 25,831 |
A list initially contains the numbers 2, 3, \dots, n. At each round, every number in the list is divided by its smallest prime factor. Then the product of these smallest prime factors is added to the list as a new number. Finally, all numbers that become 1 are removed from the list. For example, below are the first thr... | 25,832 |
A Slider is a chess piece that can move one square left or right. This problem uses a cylindrical chess board where the left hand edge of the board is connected to the right hand edge. This means that a Slider that is on the left hand edge of the chess board can move to the right hand edge of the same row and vice vers... | 25,833 |
Two cars are on a circular track of total length 2n, facing the same direction, initially distance n apart. They move in turn. At each turn, the moving car will advance a distance of 1, 2 or 3, with equal probabilities. The chase ends when the moving car reaches or goes beyond the position of the other car. The moving ... | 25,834 |
Consider a wire of length 1 unit between two posts. Every morning n birds land on it randomly with every point on the wire equally likely to host a bird. The interval from each bird to its closest neighbour is then painted. Define F(n) to be the expected length of the wire that is painted. You are given F(3) = 0.5. Fin... | 25,835 |
Define Q(n) to be the smallest number that occurs in exactly n Pythagorean triples (a,b,c) where a \lt b \lt c. For example, 15 is the smallest number occurring in exactly 5 Pythagorean triples:
(9,12,\mathbf{15})\quad (8,\mathbf{15},17)\quad (\mathbf{15},20,25)\quad (\mathbf{15},36,39)\quad (\mathbf{15},112,113)
and s... | 25,836 |
It is a common recreational problem to make a target number using a selection of other numbers. In this problem you will be given six numbers and a target number. For example, given the six numbers 2, 3, 4, 6, 7, 25, and a target of 211, one possible solution is: 211 = (3+6)\times 25 − (4\times7)\div 2 This uses all si... | 25,837 |
Given any integer n \gt 1 a binary factor tree T(n) is defined to be: A tree with the single node n when n is prime. A binary tree that has root node n, left subtree T(a) and right subtree T(b), when n is not prime. Here a and b are positive integers such that n = ab, a\le b and b-a is the smallest. For example T(20): ... | 25,838 |
Let \displaystyle S(n)=\sum\limits_{k=0}^{n}\binom{n}{k}k^n. You are given, S(10)=142469423360. Find S(10^{18}). Submit your answer modulo 83^3 89^3 97^3. | 25,839 |
Let g(m) be the integer defined by the following double sum of products of binomial coefficients: \sum_{j=0}^m\sum_{i = 0}^j (-1)^{j-i}\binom mj \binom ji \binom{j+5+6i}{j+5}. You are given that g(10) = 127278262644918. Its first (most significant) five digits are 12727. Find the first ten digits of g(142857) when writ... | 25,840 |
In this problem \oplus is used to represent the bitwise exclusive or of two numbers. Starting with blank paper repeatedly do the following: Write down the smallest positive integer a which is currently not on the paper; Find the smallest positive integer b such that neither b nor (a \oplus b) is currently on the paper.... | 25,841 |
Triangle numbers T_k are integers of the form \frac{k(k+1)} 2. A few triangle numbers happen to be perfect squares like T_1=1 and T_8=36, but more can be found when considering the product of two triangle numbers. For example, T_2 \cdot T_{24}=3 \cdot 300=30^2. Let S(n) be the sum of c for all integers triples (a, b, c... | 25,842 |
A sequence is created by starting with a positive integer n and incrementing by (n+m) at the m^{th} step.
If n=10, the resulting sequence will be 21,33,46,60,75,91,108,126,\ldots. Let S(n) be the set of indices m, for which the m^{th} term in the sequence is divisible by (n+m). For example, S(10)=\{5,8,20,35,80\}. Def... | 25,843 |
A Pythagorean triangle is called supernatural if two of its three sides are consecutive integers. Let S(N) be the sum of the perimeters of all distinct supernatural triangles with perimeters less than or equal to N. For example, S(100) = 258 and S(10000) = 172004. Find S(10^{10^{10}}). Give your answer modulo 123456789... | 25,844 |
Let A be an affine plane over a radically integral local field F with residual characteristic p. We consider an open oriented line section U of A with normalized Haar measure m. Define f(m, p) as the maximal possible discriminant of the jacobian associated to the orthogonal kernel embedding of U into A. Find f(20230401... | 25,845 |
Amidakuji (Japanese: 阿弥陀籤) is a method for producing a random permutation of a set of objects. In the beginning, a number of parallel vertical lines are drawn, one for each object. Then a specified number of horizontal rungs are added, each lower than any previous rungs. Each rung is drawn as a line segment spanning a ... | 25,846 |
Let f(N) be the smallest positive integer that is not coprime to any positive integer n \le N whose least significant digit is 3. For example f(40) equals to 897 = 3 \cdot 13 \cdot 23 since it is not coprime to any of 3,13,23,33. By taking the natural logarithm (log to base e) we obtain \ln f(40) = \ln 897 \approx 6.79... | 25,847 |
The sequence S_n is defined by S_0 = 290797 and S_n = S_{n - 1}^2 \bmod 50515093 for n > 0. There are N bowls indexed 0,1,\dots ,N-1. Initially there are S_n beans in bowl n. At each step, the smallest index n is found such that bowl n has strictly more beans than bowl n+1. Then one bean is moved from bowl n to bowl n+... | 25,848 |
A partition of n is a set of positive integers for which the sum equals n. The partitions of 5 are: \{5\},\{1,4\},\{2,3\},\{1,1,3\},\{1,2,2\},\{1,1,1,2\} and \{1,1,1,1,1\}. Further we define the function D(p) as:
\begin{align}
\begin{split}
D(1) &= 1 \\
D(p) &= 1, \text{ for any prime } p \\
D(pq) &= D(p)q + pD(q), \t... | 25,849 |
The regular star polygon \{p/q\}, for coprime integers p,q with p \gt 2q \gt 0, is a polygon formed from p edges of equal length and equal internal angles, such that tracing the complete polygon wraps q times around the centre. For example, \{8/3\} is illustrated below: The edges of a regular star polygon intersect one... | 25,850 |
Given n equally spaced points on a circle, we define an n-star polygon as an n-gon having those n points as vertices. Two n-star polygons differing by a rotation/reflection are considered different . For example, there are twelve 5-star polygons shown below. For an n-star polygon S, let I(S) be the number of its self i... | 25,851 |
This problem involves an iterative procedure that begins with a circle of n\ge 3 integers. At each step every number is simultaneously replaced with the absolute difference of its two neighbours. For any initial values, the procedure eventually becomes periodic. Let S(N) be the sum of all possible periods for 3\le n \l... | 25,852 |
Consider positive integer solutions to a^2+b^2+c^2 = 3abc For example, (1,5,13) is a solution. We define a 3-Markov number to be any part of a solution, so 1, 5 and 13 are all 3-Markov numbers. Adding distinct 3-Markov numbers \le 10^3 would give 2797. Now we define a k-Markov number to be a positive integer that is pa... | 25,853 |
Let D(n) be the n-th positive integer that has the sum of its digits a prime. For example, D(61) = 157 and D(10^8) = 403539364. Find D(10^{16}). | 25,854 |
A bracelet is made by connecting at least three numbered beads in a circle. Each bead can only display 1, 2, or any number of the form p^k or 2p^k for odd prime p. In addition a magic bracelet must satisfy the following two conditions: no two beads display the same number the product of the numbers of any two adjacent ... | 25,855 |
Jack has three plates in front of him. The giant has N beans that he distributes to the three plates. All the beans look the same, but one of them is a magic bean. Jack doesn't know which one it is, but the giant knows. Jack can ask the giant questions of the form: "Does this subset of the beans contain the magic bean?... | 25,856 |
Two players play a game. At the start of the game each player secretly chooses an integer; the first player from 1,...,n and the second player from 1,...,m. Then they take alternate turns, starting with the first player. The player, whose turn it is, displays a set of numbers and the other player tells whether their se... | 25,857 |
In a tournament there are n teams and each team plays each other team twice. A team gets two points for a win, one point for a draw and no points for a loss. With two teams there are three possible outcomes for the total points. (4,0) where a team wins twice, (3,1) where a team wins and draws, and (2,2) where either th... | 25,858 |
Any positive real number x can be decomposed into integer and fractional parts \lfloor x \rfloor + \{x\}, where \lfloor x \rfloor (the floor function) is an integer, and 0\le \{x\} < 1. For positive integers k and n, define the function
\begin{align}
f_k(n) = \sum_{i=1}^{n}\left\{ \frac{i^k}{n} \right\}
\end{align}
For... | 25,859 |
Let n be a positive integer and let E_n be the set of n-tuples of strictly positive integers. For u = (u_1, \cdots, u_n) and v = (v_1, \cdots, v_n) two elements of E_n, we define: the Sum Of Products of u and v, denoted by \langle u, v\rangle, as the sum \displaystyle\sum_{i = 1}^n u_i v_i; the Product Of Sums of u and... | 25,860 |
This game has a box of N unfair coins and N fair coins. Fair coins have probability 50% of landing heads while unfair coins have probability 75% of landing heads. The player begins with a score of 0 which may become negative during play. At each round the player randomly picks a coin from the box and guesses its type: ... | 25,861 |
For every positive integer n the Fibonacci sequence modulo
n is periodic. The period depends on the value of n.
This period is called the Pisano period for n, often shortened to \pi(n). There are three values of n for which
\pi(n) equals 18: 19, 38 and 76. The sum of those smaller than 50 is 57. Find the sum of the v... | 25,862 |
For every positive integer n the Fibonacci sequence modulo n is periodic. The period depends on the value of n.
This period is called the Pisano period for n, often shortened to \pi(n). Define M(p) as the largest integer n such that \pi(n) = p, and define M(p) = 1 if there is no such n. For example, there are three val... | 25,863 |
Given two positive integers a,b, Alex and Bianca play a game in ab rounds. They begin with a square piece of paper of side length 1. In each round Alex divides the current rectangular piece of paper into a \times b pieces using a-1 horizontal cuts and b-1 vertical ones. The cuts do not need to be evenly spaced. Moreove... | 25,864 |
A standard 52-card deck comprises 13 ranks in four suits. A pair is a set of two cards of the same rank. Cards are drawn, without replacement, from a well shuffled 52-card deck waiting for consecutive cards that form a pair. For example, the probability of finding a pair in the first two draws is \frac{1}{17}. Cards ar... | 25,865 |
A graph is made up of vertices and coloured edges.
Between every two distinct vertices there must be exactly one of the following: A red directed edge one way, and a blue directed edge the other way A green undirected edge A brown undirected edge Such a graph is called beautiful if A cycle of edges contains a red edge... | 25,866 |
Define G(N) = \sum_S \operatorname{lcm}(S) where S ranges through all subsets of \{1, \dots, N\} and \operatorname{lcm} denotes the lowest common multiple. Note that the \operatorname{lcm} of the empty set is 1. You are given G(5) = 528 and G(20) = 8463108648960. Find G(800). Give your answer modulo 10^9 + 7. | 25,867 |
Odd and Even are playing a game with N cookies. The game begins with the N cookies divided into one or more piles, not necessarily of the same size. They then make moves in turn, starting with Odd. Odd's turn: Odd may choose any pile with an odd number of cookies, eat one and divide the remaining (if any) into two equa... | 25,868 |
Gary and Sally play a game using gold and silver coins arranged into a number of vertical stacks, alternating turns. On Gary's turn he chooses a gold coin and removes it from the game along with any other coins sitting on top. Sally does the same on her turn by removing a silver coin. The first player unable to make a ... | 25,869 |
A unitary divisor of a positive integer n is a divisor d of n such that \gcd\left(d,\frac{n}{d}\right)=1. A bi-unitary divisor of n is a divisor d for which 1 is the only unitary divisor of d that is also a unitary divisor of \frac{n}{d}. For example, 2 is a bi-unitary divisor of 8, because the unitary divisors of 2 ar... | 25,870 |
For a positive integer n define T(n) to be the number of strictly larger integers which can be formed by permuting the digits of n. Leading zeros are not allowed and so for n = 2302 the total list of permutations would be: 2023,2032,2203,2230,\mathbf{2302},2320,3022,32 02,3220 giving T(2302)=4. Further define S(k) to b... | 25,871 |
Using only a six-sided fair dice and a five-sided fair dice, we would like to emulate an n-sided fair dice. For example, one way to emulate a 28-sided dice is to follow this procedure: Roll both dice, obtaining integers 1\le p\le 6 and 1\le q\le 5. Combine them using r = 5(p-1) + q to obtain an integer 1\le r\le 30. If... | 25,872 |
Let C(n) be the number of squarefree integers of the form x^2 + 1 such that 1 \le x \le n. For example, C(10) = 9 and C(1000) = 895. Find C(123567101113). | 25,873 |
A triplicate number is a positive integer such that, after repeatedly removing three consecutive identical digits from it, all its digits can be removed. For example, the integer 122555211 is a triplicate number:
122{\color{red}555}211 \rightarrow 1{\color{red}222}11\rightarrow{\color{red}111}\rightarrow.
On the other ... | 25,874 |
A small child has a “number caterpillar” consisting of N jigsaw pieces, each with one number on it, which, when connected together in a line, reveal the numbers 1 to N in order. Every night, the child's father has to pick up the pieces of the caterpillar that have been scattered across the play room. He picks up the pi... | 25,875 |
There are 5 ways to tile a regular dodecagon of side 1 with regular polygons of side 1. Let T(n) be the number of ways to tile a regular dodecagon of side n with regular polygons of side 1. Then T(1) = 5. You are also given T(2) = 48. Find T(10). Give your answer modulo 10^9+7. | 25,876 |
There is a method that is used by Bell ringers to generate all variations of the order that bells are rung. The same method can be used to create all permutations of a set of letters. Consider the letters to be permuted initially in order from smallest to largest. At each step swap the largest letter with the letter on... | 25,877 |
A prime is drawn uniformly from all primes not exceeding N. The prime is written in binary notation, and a player tries to guess it bit-by-bit starting at the least significant bit. The player scores one point for each bit they guess correctly. Immediately after each guess, the player is informed whether their guess wa... | 25,878 |
Two players play a game with a single pile of stones of initial size n. They take stones from the pile in turn, according to the following rules which depend on a fixed real number r > 0: In the first turn, the first player may take k stones with 1 \le k \lt n. If a player takes m stones in a turn, then in the next tur... | 25,879 |
Let f be a function from a finite set S to itself. A drifting subset for f is a subset A of S such that the number of elements in the union A \cup f(A) is equal to twice the number of elements of A. We write D(f) for the maximal number of elements among all drifting subsets for f. For a positive integer n, define f_n a... | 25,880 |
A sequence of rooted trees T_n is constructed such that T_n has n nodes numbered 1 to n. The sequence starts at T_1, a tree with a single node as a root with the number 1. For n > 1, T_n is constructed from T_{n-1} using the following procedure: Trace a path from the root of T_{n-1} to a leaf by following the largest-n... | 25,881 |
Let W(p,q,r) be the number of words that can be formed using the letter A p times, the letter B q times and the letter C r times with the condition that every A is separated from every B by at least two Cs. For example, CACACCBB is a valid word for W(2,2,4) but ACBCACBC is not. You are given W(2,2,4)=32 and W(4,4,44)=1... | 25,882 |
Let p(t) denote the (t+1)th prime number. So that p(0) = 2, p(1) = 3, etc. We define the prime score of a list of nonnegative integers [a_1, \dots, a_n] as the sum \sum_{i = 1}^n p(a_i). Let M(k, n) be the maximal prime score among all lists [a_1, \dots, a_n] such that: 0 \leq a_i < k for each i; the sum \sum_{i = 1}^n... | 25,883 |
For a positive integer n we define q(n) to be the number of solutions to: a_1^2+a_2^2+a_3^2+a_4^2 \equiv b_1^2+b_2^2+b_3^2+b_4^2 \pmod n where 0 \leq a_i, b_i \lt n. For example, q(4)= 18432. Define \displaystyle Q(n)=\sum_{i=1}^{n}q(i). You are given Q(10)=18573381. Find Q(12345678). Give your answer modulo 1001961001... | 25,884 |
Starting with three numbers a, b, c, at each step do one of the three operations: change a to 2(b + c) - a; change b to 2(c + a) - b; change c to 2(a + b) - c; Define f(a, b, c) to be the minimum number of steps required for one number to become zero. If this is not possible then f(a, b, c)=0. For example, f(6,10,35)=3... | 25,885 |
We use x\oplus y for the bitwise XOR of x and y. Define the XOR-product of x and y, denoted by x \otimes y, similar to a long multiplication in base 2, except that the intermediate results are XORed instead of the usual integer addition. For example, 7 \otimes 3 = 9, or in base 2, 111_2 \otimes 11_2 = 1001_2: \begin{al... | 25,886 |
We use x\oplus y for the bitwise XOR of x and y. Define the XOR-product of x and y, denoted by x \otimes y, similar to a long multiplication in base 2, except that the intermediate results are XORed instead of the usual integer addition. For example, 7 \otimes 3 = 9, or in base 2, 111_2 \otimes 11_2 = 1001_2: \begin{al... | 25,887 |
A touch-screen device can be unlocked with a "password" consisting of a sequence of two or more distinct spots that the user selects from a rectangular grid of spots on the screen. The user enters their sequence by touching the first spot, then tracing a straight line segment to the next spot, and so on until the end o... | 25,888 |
(x,y) is called a nested radical pair if x and y are non-zero integers such that \dfrac{x}{y} is not a cube of a rational number, and there exist integers a, b and c such that: \sqrt{\sqrt[3]{x}+\sqrt[3]{y}}=\sqrt[3]{a}+\sqrt[3]{b}+\sqrt[3]{c} For example, both (-4,125) and (5,5324) are nested radical pairs:
\begin{al... | 25,889 |
For a positive integer n create a graph using its divisors as vertices. An edge is drawn between two vertices a \lt b if their quotient b/a is prime. The graph can be arranged into levels where vertex n is at level 0 and vertices that are a distance k from n are on level k. Define g(n) to be the maximum number of verti... | 25,890 |
Dr. One and Dr. Zero are playing the following partisan game. The game begins with one 1, two 2's, three 3's, ..., n n's. Starting with Dr. One, they make moves in turn. Dr. One chooses a number and changes it by removing a 1 from its binary expansion. Dr. Zero chooses a number and changes it by removing a 0 from its b... | 25,891 |
In this problem we consider triangles drawn on a hexagonal lattice , where each lattice point in the plane has six neighbouring points equally spaced around it, all distance 1 away. We call a triangle remarkable if All three vertices and its incentre lie on lattice points At least one of its angles is 60^\circ Above ar... | 25,892 |
Starting from a positive integer n, at each step we subtract from n the largest perfect cube not exceeding n, until n becomes 0. For example, with n = 100 the procedure ends in 4 steps:
100 \xrightarrow{-4^3} 36 \xrightarrow{-3^3} 9 \xrightarrow{-2^3} 1 \xrightarrow{-1^3} 0.
Let D(n) denote the number of steps of the p... | 25,893 |
For a positive integer d, let f(d) be the number created by sorting the digits of d in ascending order, removing any zeros. For example, f(3403) = 334. Let S(n) be the sum of f(d) for all positive integers d of n digits or less. You are given S(1) = 45 and S(5) = 1543545675. Find S(18). Give your answer modulo 11234556... | 25,894 |
A permutation of \{2,3,\ldots,n\} is a rearrangement of these numbers. A coprime permutation is a rearrangement such that all pairs of adjacent numbers are coprime. Let P(n) be the number of coprime permutations of \{2,3,\ldots,n\}. For example, P(4)=2 as there are two coprime permutations, (2,3,4) and (4,3,2). You are... | 25,895 |
Consider the problem of determining a secret number from a set \{1, ..., N\} by repeatedly choosing a number y and asking "Is the secret number greater than y?". If N=1 then no questions need to be asked. If N=2 then only one question needs to be asked. If N=64 then six questions need to be asked. However, in the latte... | 25,896 |
Two players play a game with a number of piles of stones, alternating turns. Each turn a player can choose to remove 1, 2, 4, or 9 stones from a single pile; or alternatively they can choose to split a pile containing two or more stones into two non-empty piles. The winner is the player who removes the last stone. A co... | 25,897 |
Recall the blancmange function from Problem 226 : T(x) = \sum\limits_{n = 0}^\infty\dfrac{s(2^nx)}{2^n}, where s(x) is the distance from x to the nearest integer. For positive integers k, t, r, we write F(k, t, r) = (2^{2k} - 1)T\left(\frac{(2^t + 1)^r}{2^k + 1}\right). It can be shown that F(k, t, r) is always an inte... | 25,898 |
Let p(n) be the number of ways to write n as the sum of powers of two, ignoring order. For example, p(7) = 6, the partitions being
\begin{align}
7 &= 1+1+1+1+1+1+1 \\
&=1+1+1+1+1+2 \\
&=1+1+1+2+2 \\
&=1+1+1+4 \\
&=1+2+2+2 \\
&=1+2+4
\end{align}
You are also given p(7^7) \equiv 144548435 \pmod {10^9+7}. Find p(7^{777}... | 25,899 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.