task
stringlengths
0
154k
__index_level_0__
int64
0
39.2k
A prime number p is called a Panaitopol prime if p = \dfrac{x^4 - y^4}{x^3 + y^3} for some positive integers x and y. Find how many Panaitopol primes are less than 5 \times 10^{15}.
25,300
We shall define a pythagorean polygon to be a convex polygon with the following properties: there are at least three vertices, no three vertices are aligned, each vertex has integer coordinates , each edge has integer length . For a given integer n, define P(n) as the number of distinct pythagorean polygons for which t...
25,301
An even positive integer N will be called admissible, if it is a power of 2 or its distinct prime factors are consecutive primes. The first twelve admissible numbers are 2,4,6,8,12,16,18,24,30,32,36,48. If N is admissible, the smallest integer M \gt 1 such that N+M is prime, will be called the pseudo-Fortunate number f...
25,302
For a positive integer k, define d(k) as the sum of the digits of k in its usual decimal representation. Thus d(42) = 4+2 = 6. For a positive integer n, define S(n) as the number of positive integers k \lt 10^n with the following properties : k is divisible by 23 and d(k) = 23. You are given that S(9) = 263626 and S(42...
25,303
We call the convex area enclosed by two circles a lenticular hole if: The centres of both circles are on lattice points. The two circles intersect at two distinct lattice points. The interior of the convex area enclosed by both circles does not contain any lattice points. Consider the circles: C_0: x^2 + y^2 = 25 C_1: ...
25,304
Given is an integer sided triangle ABC with BC \le AC \le AB. k is the angular bisector of angle ACB. m is the tangent at C to the circumscribed circle of ABC. n is a line parallel to m through B. The intersection of n and k is called E. How many triangles ABC with a perimeter not exceeding 100\,000 exist such that BE ...
25,305
Each new term in the Fibonacci sequence is generated by adding the previous two terms. Starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89. Every positive integer can be uniquely written as a sum of nonconsecutive terms of the Fibonacci sequence. For example, 100 = 3 + 8 + 89. Such a su...
25,306
Larry and Robin play a memory game involving a sequence of random numbers between 1 and 10, inclusive, that are called out one at a time. Each player can remember up to 5 previous numbers. When the called number is in a player's memory, that player is awarded a point. If it's not, the player adds the called number to h...
25,307
Four points with integer coordinates are selected: A(a, 0), B(b, 0), C(0, c) and D(0, d), with 0 \lt a \lt b and 0 \lt c \lt d. Point P, also with integer coordinates, is chosen on the line AC so that the three triangles ABP, CDP and BDP are all similar Have equal angles . It is easy to prove that the three triangles c...
25,308
In a very simplified form, we can consider proteins as strings consisting of hydrophobic (H) and polar (P) elements, e.g. HHPPHHHPHHPH. For this problem, the orientation of a protein is important; e.g. HPP is considered distinct from PPH. Thus, there are 2^n distinct proteins consisting of n elements. When one encounte...
25,309
Nim is a game played with heaps of stones, where two players take it in turn to remove any number of stones from any heap until no stones remain. We'll consider the three-heap normal-play version of Nim, which works as follows: At the start of the game there are three heaps of stones. On each player's turn, the player ...
25,310
A positive integer n is powerful if p^2 is a divisor of n for every prime factor p in n. A positive integer n is a perfect power if n can be expressed as a power of another positive integer. A positive integer n is an Achilles number if n is powerful but not a perfect power. For example, 864 and 1800 are Achilles numbe...
25,311
For a positive integer n, define f(n) as the least positive multiple of n that, written in base 10, uses only digits \le 2. Thus f(2)=2, f(3)=12, f(7)=21, f(42)=210, f(89)=1121222. Also, \sum \limits_{n = 1}^{100} {\dfrac{f(n)}{n}} = 11363107. Find \sum \limits_{n=1}^{10000} {\dfrac{f(n)}{n}}.
25,312
For any positive integer n the function \operatorname{next\_prime}(n) returns the smallest prime p such that p \gt n. The sequence a(n) is defined by: a(1)=\operatorname{next\_prime}(10^{14}) and a(n)=\operatorname{next\_prime}(a(n-1)) for n \gt 1. The Fibonacci sequence f(n) is defined by: f(0)=0, f(1)=1 and f(n)=f(n-...
25,313
Let's call S the (infinite) string that is made by concatenating the consecutive positive integers (starting from 1) written down in base 10. Thus, S = 1234567891011121314151617181920212223242\cdots It's easy to see that any number will show up an infinite number of times in S. Let's call f(n) the starting position of...
25,314
The following game is a classic example of Combinatorial Game Theory: Two players start with a strip of n white squares and they take alternate turns. On each turn, a player picks two contiguous white squares and paints them black. The first player who cannot make a move loses. n = 1: No valid moves, so the first playe...
25,315
k defects are randomly distributed amongst n integrated-circuit chips produced by a factory (any number of defects may be found on a chip and each defect is independent of the other defects). Let p(k, n) represent the probability that there is a chip with at least 3 defects. For instance p(3,7) \approx 0.0204081633. Fi...
25,316
A program written in the programming language Fractran consists of a list of fractions. The internal state of the Fractran Virtual Machine is a positive integer, which is initially set to a seed value. Each iteration of a Fractran program multiplies the state integer by the first fraction in the list which will leave i...
25,317
In the classic "Crossing Ladders" problem, we are given the lengths x and y of two ladders resting on the opposite walls of a narrow, level street. We are also given the height h above the street where the two ladders cross and we are asked to find the width of the street (w). Here, we are only concerned with instances...
25,318
Alice and Bob play the game Nim Square. Nim Square is just like ordinary three-heap normal play Nim, but the players may only remove a square number of stones from a heap. The number of stones in the three heaps is represented by the ordered triple (a,b,c). If 0 \le a \le b \le c \le 29 then the number of losing positi...
25,319
ABCD is a convex, integer sided quadrilateral with 1 \le AB \lt BC \lt CD \lt AD. BD has integer length. O is the midpoint of BD. AO has integer length. We'll call ABCD a biclinic integral quadrilateral if AO = CO \le BO = DO. For example, the following quadrilateral is a biclinic integral quadrilateral: AB = 19, BC = ...
25,320
- A Sierpiński graph of order-1 (S_1) is an equilateral triangle. - S_{n + 1} is obtained from S_n by positioning three copies of S_n so that every pair of copies has one common corner. Let C(n) be the number of cycles that pass exactly once through all the vertices of S_n. For example, C(3) = 8 because eight such cycl...
25,321
In a sliding game a counter may slide horizontally or vertically into an empty space. The objective of the game is to move the red counter from the top left corner of a grid to the bottom right corner; the space always starts in the bottom right corner. For example, the following sequence of pictures show how the game ...
25,322
The moon has been opened up, and land can be obtained for free, but there is a catch. You have to build a wall around the land that you stake out, and building a wall on the moon is expensive. Every country has been allotted a \pu{500 m} by \pu{500 m} square area, but they will possess only that area which they wall in...
25,323
Sam and Max are asked to transform two digital clocks into two "digital root" clocks. A digital root clock is a digital clock that calculates digital roots step by step. When a clock is fed a number, it will show it and then it will start the calculation, showing all the intermediate values until it gets to the result....
25,324
Let p = p_1 p_2 p_3 \cdots be an infinite sequence of random digits, selected from \{0,1,2,3,4,5,6,7,8,9\} with equal probability. It can be seen that p corresponds to the real number 0.p_1 p_2 p_3 \cdots It can also be seen that choosing a random real number from the interval [0,1) is equivalent to choosing an infinit...
25,325
A firecracker explodes at a height of \pu{100 m} above level ground. It breaks into a large number of very small fragments, which move in every direction; all of them have the same initial velocity of \pu{20 m/s}. We assume that the fragments move without air resistance, in a uniform gravitational field with g=\pu{9.81...
25,326
Consider the real number \sqrt 2 + \sqrt 3. When we calculate the even powers of \sqrt 2 + \sqrt 3 we get: (\sqrt 2 + \sqrt 3)^2 = 9.898979485566356 \cdots (\sqrt 2 + \sqrt 3)^4 = 97.98979485566356 \cdots (\sqrt 2 + \sqrt 3)^6 = 969.998969071069263 \cdots (\sqrt 2 + \sqrt 3)^8 = 9601.99989585502907 \cdots (\sqrt 2 ...
25,327
Let x_1, x_2, \dots, x_n be a sequence of length n such that: x_1 = 2 for all 1 \lt i \le n: x_{i - 1} \lt x_i for all i and j with 1 \le i, j \le n: (x_i)^j \lt (x_j + 1)^i. There are only five such sequences of length 2, namely: \{2,4\}, \{2,5\}, \{2,6\}, \{2,7\} and \{2,8\}. There are 293 such sequences of length 5;...
25,328
Let N(i) be the smallest integer n such that n! is divisible by (i!)^{1234567890} Let S(u)=\sum N(i) for 10 \le i \le u. S(1000)=614538266565663. Find S(1\,000\,000) \bmod 10^{18}.
25,329
A horizontal row comprising of 2n + 1 squares has n red counters placed at one end and n blue counters at the other end, being separated by a single empty square in the centre. For example, when n = 3. A counter can move from one square to the next (slide) or can jump over another counter (hop) as long as the square ne...
25,330
Let T(m, n) be the number of the binomial coefficients ^iC_n that are divisible by 10 for n \le i \lt m (i, m and n are positive integers). You are given that T(10^9, 10^7-10) = 989697000. Find T(10^{18}, 10^{12}-10).
25,331
Let y_0, y_1, y_2, \dots be a sequence of random unsigned 32-bit integers (i.e. 0 \le y_i \lt 2^{32}, every value equally likely). For the sequence x_i the following recursion is given: x_0 = 0 and x_i = x_{i - 1} \boldsymbol \mid y_{i - 1}, for i \gt 0. (\boldsymbol \mid is the bitwise-OR operator). It can be seen tha...
25,332
Let f(n) represent the number of ways one can fill a 3 \times 3 \times n tower with blocks of 2 \times 1 \times 1. You're allowed to rotate the blocks in any way you like; however, rotations, reflections etc of the tower itself are counted as distinct. For example (with q = 100000007): f(2) = 229, f(4) = 117805, f(10) ...
25,333
A game is played with two piles of stones and two players. On each player's turn, the player may remove a number of stones from the larger pile. The number of stones removed must be a positive multiple of the number of stones in the smaller pile. E.g. Let the ordered pair (6,14) describe a configuration with 6 stones i...
25,334
Let a_n be a sequence recursively defined by:\quad a_1=1,\quad\displaystyle a_n=\biggl(\sum_{k=1}^{n-1}k\cdot a_k\biggr)\bmod n. So the first 10 elements of a_n are: 1,1,0,3,0,3,5,4,1,9. Let f(N, M) represent the number of pairs (p, q) such that: \def\htmltext#1{\style{font-family:inherit;}{\text{#1}}} 1\le p\le q\le ...
25,335
A series of three rooms are connected to each other by automatic doors. Each door is operated by a security card. Once you enter a room the door automatically closes and that security card cannot be used again. A machine at the start will dispense an unlimited number of cards, but each room (including the starting room...
25,336
We are trying to find a hidden number selected from the set of integers \{1, 2, \dots, n\} by asking questions. Each number (question) we ask, has a cost equal to the number asked and we get one of three possible answers: "Your guess is lower than the hidden number", or "Yes, that's it!", or "Your guess is higher than...
25,337
Susan has a prime frog. Her frog is jumping around over 500 squares numbered 1 to 500. He can only jump one square to the left or to the right, with equal probability, and he cannot jump outside the range [1;500]. (if it lands at either end, it automatically jumps to the only available square on the next move.) When he...
25,338
An infinite sequence of real numbers a(n) is defined for all integers n as follows: a(n) = \begin{cases} 1 & n \lt 0\\ \sum \limits_{i = 1}^{\infty}{\dfrac{a(n - i)}{i!}} & n \ge 0 \end{cases} For example, a(0) = \dfrac{1}{1!} + \dfrac{1}{2!} + \dfrac{1}{3!} + \cdots = e - 1 a(1) = \dfrac{e - 1}{1!} + \dfrac{1}{2!} + \...
25,339
N \times N disks are placed on a square game board. Each disk has a black side and white side. At each turn, you may choose a disk and flip all the disks in the same row and the same column as this disk: thus 2 \times N - 1 disks are flipped. The game ends when all disks show their white side. The following example sho...
25,340
A spherical triangle is a figure formed on the surface of a sphere by three great circular arcs intersecting pairwise in three vertices. Let C(r) be the sphere with the centre (0,0,0) and radius r. Let Z(r) be the set of points on the surface of C(r) with integer coordinates. Let T(r) be the set of spherical triangles ...
25,341
All positive integers can be partitioned in such a way that each and every term of the partition can be expressed as 2^i \times 3^j, where i,j \ge 0. Let's consider only such partitions where none of the terms can divide any of the other terms. For example, the partition of 17 = 2 + 6 + 9 = (2^1 \times 3^0 + 2^1 \times...
25,342
In Plato's heaven, there exist an infinite number of bowls in a straight line. Each bowl either contains some or none of a finite number of beans. A child plays a game, which allows only one kind of move: removing two beans from any bowl, and putting one in each of the two adjacent bowls. The game ends when each bowl c...
25,343
Whenever Peter feels bored, he places some bowls, containing one bean each, in a circle. After this, he takes all the beans out of a certain bowl and drops them one by one in the bowls going clockwise. He repeats this, starting from the bowl he dropped the last bean in, until the initial situation appears again. For ex...
25,344
A train is used to transport four carriages in the order: ABCD. However, sometimes when the train arrives to collect the carriages they are not in the correct order. To rearrange the carriages they are all shunted on to a large rotating turntable. After the carriages are uncoupled at a specific point the train moves of...
25,345
Let \{a_1, a_2, \dots, a_n\} be an integer sequence of length n such that: a_1 = 6 for all 1 \le i \lt n: \phi(a_i) \lt \phi(a_{i + 1}) \lt a_i \lt a_{i + 1}. 1 Let S(N) be the number of such sequences with a_n \le N. For example, S(10) = 4: \{6\}, \{6, 8\}, \{6, 8, 9\} and \{6, 10\}. We can verify that S(100) = 482073...
25,346
A rectangular sheet of grid paper with integer dimensions w \times h is given. Its grid spacing is 1. When we cut the sheet along the grid lines into two pieces and rearrange those pieces without overlap, we can make new rectangles with different dimensions. For example, from a sheet with dimensions 9 \times 4, we can ...
25,347
"And he came towards a valley, through which ran a river; and the borders of the valley were wooded, and on each side of the river were level meadows. And on one side of the river he saw a flock of white sheep, and on the other a flock of black sheep. And whenever one of the white sheep bleated, one of the black sheep ...
25,348
For fixed integers a, b, c, define the crazy function F(n) as follows: F(n) = n - c for all n \gt b F(n) = F(a + F(a + F(a + F(a + n)))) for all n \le b. Also, define S(a, b, c) = \sum \limits_{n = 0}^b F(n). For example, if a = 50, b = 2000 and c = 40, then F(0) = 3240 and F(2000) = 2040. Also, S(50, 2000, 40) = 52042...
25,349
The Golomb's self-describing sequence (G(n)) is the only nondecreasing sequence of natural numbers such that n appears exactly G(n) times in the sequence. The values of G(n) for the first few n are \[ \begin{matrix} n & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & \ldots \\ G(n) & 1 & 2 & 2 & 3 & 3...
25,350
Consider the number 50. 50^2 = 2500 = 2^2 \times 5^4, so \phi(2500) = 2 \times 4 \times 5^3 = 8 \times 5^3 = 2^3 \times 5^3. 1 So 2500 is a square and \phi(2500) is a cube. Find the sum of all numbers n, 1 \lt n \lt 10^{10} such that \phi(n^2) is a cube. 1 \phi denotes Euler's totient function .
25,351
For any positive integer k, a finite sequence a_i of fractions x_i/y_i is defined by: a_1 = 1/k and a_i = (x_{i - 1} + 1) / (y_{i - 1} - 1) reduced to lowest terms for i \gt 1. When a_i reaches some integer n, the sequence stops. (That is, when y_i = 1.) Define f(k) = n. For example, for k = 20: 1/20 \to 2/19 \to 3/18 ...
25,352
One variant of N.G. de Bruijn's silver dollar game can be described as follows: On a strip of squares a number of coins are placed, at most one coin per square. Only one coin, called the silver dollar , has any value. Two players take turns making moves. At each turn a player must make either a regular or a special mov...
25,353
We define the Matrix Sum of a matrix as the maximum possible sum of matrix elements such that none of the selected elements share the same row or column. For example, the Matrix Sum of the matrix below equals 3315 ( = 863 + 383 + 343 + 959 + 767): 7  53 183 439 863 497 383 563  79 973 287  63 343 169 583 627 343 773 95...
25,354
The number 7 is special, because 7 is 111 written in base 2, and 11 written in base 6 (i.e. 7_{10} = 11_6 = 111_2). In other words, 7 is a repunit in at least two bases b \gt 1. We shall call a positive integer with this property a strong repunit. It can be verified that there are 8 strong repunits below 50: \{1,7,13,1...
25,355
The largest integer \le 100 that is only divisible by both the primes 2 and 3 is 96, as 96=32\times 3=2^5 \times 3. For two distinct primes p and q let M(p,q,N) be the largest positive integer \le N only divisible by both p and q and M(p,q,N)=0 if such a positive integer does not exist. E.g. M(2,3,100)=96. M(3,5,100)=7...
25,356
Many numbers can be expressed as the sum of a square and a cube. Some of them in more than one way. Consider the palindromic numbers that can be expressed as the sum of a square and a cube, both greater than 1, in exactly 4 different ways. For example, 5229225 is a palindromic number and it can be expressed in exactly ...
25,357
An ant moves on a regular grid of squares that are coloured either black or white. The ant is always oriented in one of the cardinal directions (left, right, up or down) and moves from square to adjacent square according to the following rules: - if it is on a black square, it flips the colour of the square to white, r...
25,358
A list of size n is a sequence of n natural numbers. Examples are (2,4,6), (2,6,4), (10,6,15,6), and (11). The greatest common divisor , or \gcd, of a list is the largest natural number that divides all entries of the list. Examples: \gcd(2,6,4) = 2, \gcd(10,6,15,6) = 1 and \gcd(11) = 11. The least common multiple , or...
25,359
A hexagonal orchard of order n is a triangular lattice made up of points within a regular hexagon with side n. The following is an example of a hexagonal orchard of order 5: Highlighted in green are the points which are hidden from the center by a point closer to it. It can be seen that for a hexagonal orchard of order...
25,360
Each one of the 25 sheep in a flock must be tested for a rare virus, known to affect 2\% of the sheep population. An accurate and extremely sensitive PCR test exists for blood samples, producing a clear positive / negative result, but it is very time-consuming and expensive. Because of the high cost, the vet-in-charge ...
25,361
A moon could be described by the sphere C(r) with centre (0,0,0) and radius r. There are stations on the moon at the points on the surface of C(r) with integer coordinates. The station at (0,0,r) is called North Pole station, the station at (0,0,-r) is called South Pole station. All stations are connected with each oth...
25,362
Consider a honey bee's honeycomb where each cell is a perfect regular hexagon with side length 1. One particular cell is occupied by the queen bee. For a positive real number L, let \text{B}(L) count the cells with distance L from the queen bee cell (all distances are measured from centre to centre); you may assume tha...
25,363
Define \operatorname{Co}(n) to be the maximal possible sum of a set of mutually co-prime elements from \{1,2,\dots,n\}. For example \operatorname{Co}(10) is 30 and hits that maximum on the subset \{1,5,7,8,9\}. You are given that \operatorname{Co}(30) = 193 and \operatorname{Co}(100) = 1356. Find \operatorname{Co}(2000...
25,364
Let a_n be the largest real root of a polynomial g(x) = x^3 - 2^n \cdot x^2 + n. For example, a_2 = 3.86619826\cdots Find the last eight digits of \sum \limits_{i = 1}^{30} \lfloor a_i^{987654321} \rfloor. Note : \lfloor a \rfloor represents the floor function.
25,365
Consider the divisors of 30: 1,2,3,5,6,10,15,30. It can be seen that for every divisor d of 30, d + 30 / d is prime. Find the sum of all positive integers n not exceeding 100\,000\,000 such that for every divisor d of n, d + n / d is prime.
25,366
A cyclic number with n digits has a very interesting property: When it is multiplied by 1, 2, 3, 4, \dots, n, all the products have exactly the same digits, in the same order, but rotated in a circular fashion! The smallest cyclic number is the 6-digit number 142857: 142857 \times 1 = 142857 142857 \times 2 = 285714 14...
25,367
An infinite number of people (numbered 1, 2, 3, etc.) are lined up to get a room at Hilbert's newest infinite hotel. The hotel contains an infinite number of floors (numbered 1, 2, 3, etc.), and each floor contains an infinite number of rooms (numbered 1, 2, 3, etc.). Initially the hotel is empty. Hilbert declares a ru...
25,368
Given two points (x_1, y_1, z_1) and (x_2, y_2, z_2) in three dimensional space, the Manhattan distance between those points is defined as |x_1 - x_2| + |y_1 - y_2| + |z_1 - z_2|. Let C(r) be a sphere with radius r and center in the origin O(0,0,0). Let I(r) be the set of all points with integer coordinates on the surf...
25,369
The Thue-Morse sequence \{T_n\} is a binary sequence satisfying: T_0 = 0 T_{2n} = T_n T_{2n + 1} = 1 - T_n The first several terms of \{T_n\} are given as follows: 01101001{\color{red}10010}1101001011001101001\cdots We define \{A_n\} as the sorted sequence of integers such that the binary expression of each element app...
25,370
Consider the number 54. 54 can be factored in 7 distinct ways into one or more factors larger than 1: 54, 2 \times 27, 3 \times 18, 6 \times 9, 3 \times 3 \times 6, 2 \times 3 \times 9 and 2 \times 3 \times 3 \times 3. If we require that the factors are all squarefree only two ways remain: 3 \times 3 \times 6 and 2 \ti...
25,371
A cubic Bézier curve is defined by four points: P_0, P_1, P_2, and P_3. The curve is constructed as follows: On the segments P_0 P_1, P_1 P_2, and P_2 P_3 the points Q_0, Q_1, and Q_2 are drawn such that \dfrac{P_0 Q_0}{P_0 P_1} = \dfrac{P_1 Q_1}{P_1 P_2} = \dfrac{P_2 Q_2}{P_2 P_3} = t, with t in [0, 1]. On the segment...
25,372
There are N seats in a row. N people come after each other to fill the seats according to the following rules: If there is any seat whose adjacent seat(s) are not occupied take such a seat. If there is no such seat and there is any seat for which only one adjacent seat is occupied take such a seat. Otherwise take one o...
25,373
The binomial coefficient \displaystyle{\binom{10^{18}}{10^9}} is a number with more than 9 billion (9\times 10^9) digits. Let M(n,k,m) denote the binomial coefficient \displaystyle{\binom{n}{k}} modulo m. Calculate \displaystyle{\sum M(10^{18},10^9,p\cdot q\cdot r)} for 1000\lt p\lt q\lt r\lt 5000 and p,q,r prime.
25,374
Two players, Anton and Bernhard, are playing the following game. There is one pile of n stones. The first player may remove any positive number of stones, but not the whole pile. Thereafter, each player may remove at most twice the number of stones his opponent took on the previous move. The player who removes the last...
25,375
Bozo sort , not to be confused with the slightly less efficient bogo sort , consists out of checking if the input sequence is sorted and if not swapping randomly two elements. This is repeated until eventually the sequence is sorted. If we consider all permutations of the first 4 natural numbers as input the expectatio...
25,376
The harmonic series 1 + \frac 1 2 + \frac 1 3 + \frac 1 4 + \cdots is well known to be divergent. If we however omit from this series every term where the denominator has a 9 in it, the series remarkably enough converges to approximately 22.9206766193. This modified harmonic series is called the Kempner series. Let us ...
25,377
In a standard 52 card deck of playing cards, a set of 4 cards is a Badugi if it contains 4 cards with no pairs and no two cards of the same suit. Let f(n) be the number of ways to choose n cards with a 4 card subset that is a Badugi. For example, there are 2598960 ways to choose five cards from a standard 52 card deck...
25,378
Let us define a geometric triangle as an integer sided triangle with sides a \le b \le c so that its sides form a geometric progression , i.e. b^2 = a \cdot c An example of such a geometric triangle is the triangle with sides a = 144, b = 156 and c = 169. There are 861805 geometric triangles with perimeter \le 10^6. Ho...
25,379
Oregon licence plates consist of three letters followed by a three digit number (each digit can be from [0..9]). While driving to work Seth plays the following game: Whenever the numbers of two licence plates seen on his trip add to 1000 that's a win. E.g. MIC-012 and HAN-988 is a win and RYU-500 and SET-500 too (as lo...
25,380
Let R(M, N) be the number of lattice points (x, y) which satisfy M\!\lt\!x\!\le\!N, M\!\lt\!y\!\le\!N and \large\left\lfloor\!\frac{y^2}{x^2}\!\right\rfloor is odd. We can verify that R(0, 100) = 3019 and R(100, 10000) = 29750422. Find R(2\cdot10^6, 10^9). Note : \lfloor x\rfloor represents the floor function.
25,381
Every triangle has a circumscribed circle that goes through the three vertices. Consider all integer sided triangles for which the radius of the circumscribed circle is integral as well. Let S(n) be the sum of the radii of the circumscribed circles of all such triangles for which the radius does not exceed n. S(100)=49...
25,382
An integer partition of a number n is a way of writing n as a sum of positive integers. Partitions that differ only in the order of their summands are considered the same. A partition of n into distinct parts is a partition of n in which every part occurs at most once. The partitions of 5 into distinct parts are: 5, 4+...
25,383
Let S_n be an integer sequence produced with the following pseudo-random number generator: \begin{align} S_0 & = 290797 \\ S_{n+1} & = S_n^2 \bmod 50515093 \end{align} Let A(i, j) be the minimum of the numbers S_i, S_{i+1}, \dots, S_j for i\le j. Let M(N) = \sum A(i, j) for 1 \le i \le j \le N. We can verify that M(10)...
25,384
Consider the following set of dice with nonstandard pips: Die A: 1 4 4 4 4 4 Die B: 2 2 2 5 5 5 Die C: 3 3 3 3 3 6 A game is played by two players picking a die in turn and rolling it. The player who rolls the highest value wins. If the first player picks die A and the second player picks die B we get P(\text{second pl...
25,385
There are 16 positive integers that do not have a zero in their digits and that have a digital sum equal to 5, namely: 5, 14, 23, 32, 41, 113, 122, 131, 212, 221, 311, 1112, 1121, 1211, 2111 and 11111. Their sum is 17891. Let f(n) be the sum of all positive integers that do not have a zero in their digits and have a di...
25,386
Let T(n) be the n th triangle number, so T(n) = \dfrac{n(n + 1)}{2}. Let dT(n) be the number of divisors of T(n). E.g.: T(7) = 28 and dT(7) = 6. Let Tr(n) be the number of triples (i, j, k) such that 1 \le i \lt j \lt k \le n and dT(i) \gt dT(j) \gt dT(k). Tr(20) = 14, Tr(100) = 5772, and Tr(1000) = 11174776. Find Tr(6...
25,387
Let f(n) be the number of couples (x, y) with x and y positive integers, x \le y and the least common multiple of x and y equal to n. Let g be the summatory function of f, i.e.: g(n) = \sum f(i) for 1 \le i \le n. You are given that g(10^6) = 37429395. Find g(10^{12}).
25,388
An m \times n maze is an m \times n rectangular grid with walls placed between grid cells such that there is exactly one path from the top-left square to any other square. The following are examples of a 9 \times 12 maze and a 15 \times 20 maze: Let C(m,n) be the number of distinct m \times n mazes. Mazes which can be ...
25,389
For a prime p let S(p) = (\sum (p-k)!) \bmod (p) for 1 \le k \le 5. For example, if p=7, (7-1)! + (7-2)! + (7-3)! + (7-4)! + (7-5)! = 6! + 5! + 4! + 3! + 2! = 720+120+24+6+2 = 872. As 872 \bmod (7) = 4, S(7) = 4. It can be verified that \sum S(p) = 480 for 5 \le p \lt 100. Find \sum S(p) for 5 \le p \lt 10^8.
25,390
A polygon is a flat shape consisting of straight line segments that are joined to form a closed chain or circuit. A polygon consists of at least three sides and does not self-intersect. A set S of positive numbers is said to generate a polygon P if: no two sides of P are the same length, the length of every side of P i...
25,391
Let f_5(n) be the largest integer x for which 5^x divides n. For example, f_5(625000) = 7. Let T_5(n) be the number of integers i which satisfy f_5((2 \cdot i - 1)!) \lt 2 \cdot f_5(i!) and 1 \le i \le n. It can be verified that T_5(10^3) = 68 and T_5(10^9) = 2408210. Find T_5(10^{18}).
25,392
Define the sequence a(n) as the number of adjacent pairs of ones in the binary expansion of n (possibly overlapping). E.g.: a(5) = a(101_2) = 0, a(6) = a(110_2) = 1, a(7) = a(111_2) = 2. Define the sequence b(n) = (-1)^{a(n)}. This sequence is called the Rudin-Shapiro sequence. Also consider the summatory sequence of b...
25,393
For any triangle T in the plane, it can be shown that there is a unique ellipse with largest area that is completely inside T. For a given n, consider triangles T such that: - the vertices of T have integer coordinates with absolute value \le n, and - the foci 1 of the largest-area ellipse inside T are (\sqrt{13},0) an...
25,394
Let n be an integer and S(n) be the set of factors of n. A subset A of S(n) is called an antichain of S(n) if A contains only one element or if none of the elements of A divides any of the other elements of A. For example: S(30) = \{1, 2, 3, 5, 6, 10, 15, 30\}. \{2, 5, 6\} is not an antichain of S(30). \{2, 3, 5\} is a...
25,395
A Harshad or Niven number is a number that is divisible by the sum of its digits. 201 is a Harshad number because it is divisible by 3 (the sum of its digits.) When we truncate the last digit from 201, we get 20, which is a Harshad number. When we truncate the last digit from 20, we get 2, which is also a Harshad numbe...
25,396
Consider all lattice points (a,b,c) with 0 \le a,b,c \le N. From the origin O(0,0,0) all lines are drawn to the other lattice points. Let D(N) be the number of distinct such lines. You are given that D(1\,000\,000) = 831909254469114121. Find D(10^{10}). Give as your answer the first nine digits followed by the last nin...
25,397
An unbiased single 4-sided die is thrown and its value, T, is noted. T unbiased 6-sided dice are thrown and their scores are added together. The sum, C, is noted. C unbiased 8-sided dice are thrown and their scores are added together. The sum, O, is noted. O unbiased 12-sided dice are thrown and their scores are added ...
25,398
Consider the triangle with sides \sqrt 5, \sqrt {65} and \sqrt {68}. It can be shown that this triangle has area 9. S(n) is the sum of the areas of all triangles with sides \sqrt{1+b^2}, \sqrt {1+c^2} and \sqrt{b^2+c^2}\, (for positive integers b and c) that have an integral area not exceeding n. The example triangle ...
25,399