Brilli the Fortune Teller

Brilli the ant states that "Given any set of 30 distinct integers from 1 to 50 (inclusive), there must exist 2 integers whose absolute difference is exactly N N ."

What is the sum of all possible values of N N in which the statement is always true?

Details and assumptions

You may use the fact that 30 × 29 2 = 435 \frac{30 \times 29} {2} = 435 .


The answer is 320.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

4 solutions

Michael Tong
Sep 2, 2013

Clearly, 1 N 49 1 \leq N \leq 49 and N N is an integer. Additionally, N < 30 N < 30 since there exists a counter example for all N 30 N \geq 30 , e.g. ( 1 , 2 , 3 , . . . 30 ) (1, 2, 3, ... 30) .

The N N that satisfy the equation can be found by finding the values of N N which have a counterexample. We will find this in the following way: Starting with 1 1 , list N N integers in a row, then skip the next N N integers, then list the next N N integers, etc. until we reach 50 50 . For example, for N = 17 N = 17 , we have 1 , 2 , 3 , . . . 17 , 35 , 36 , 37 , . . . 49 , 50 1, 2, 3, ... 17, 35, 36, 37, ... 49, 50 . If the number of integers in this listing is at least 30, then we have a counter example for that value of N N , that is, any 30 element subset of those integers would be a counter example. If it is below 30, then more integers must be added who necessarily have an absolute difference of N N with an already listed integer. The number of integers in this sequence can be calculated by the following formulae:

If 50 N \lfloor \frac {50}{N} \rfloor is odd, then 50 N 1 2 N + N 30 \frac {\lfloor \frac{50}{N} \rfloor - 1}{2} N + N \geq 30

If 50 N \lfloor \frac {50}{N} \rfloor is even, then 50 50 2 N N 30 50 - \lfloor \frac{50}{2N} \rfloor N \geq 30

Calculation can be facilitated by looking at numbers in groups. For example, when 17 N 25 17 \leq N \leq 25 , that is, 50 N = 2 \lfloor \frac{50}{N} \rfloor = 2 , plugging it into the equation we get 50 N 30 N 20 50 - N \geq 30 \rightarrow N \leq 20 , meaning that there exists a counter example for 17 N 20 17 \leq N \leq 20 .

After a bit of calculation we find that N = 10 , 15 N 20 , N 30 N = 10, 15 \leq N \leq 20, N \geq 30 have counter examples and, thus, the rest of them do not. Adding the sum of the valid values we get S N = 320 S_N = 320 .

Moderator note:

It is somewhat surprising that the set N N is so disjoint. You can find a difference of 8 , 9, 11, 12, but not of 10.

I don't know of an easy way to generalize this to numbers other than 30, 50. All of the calculations will need to be done again, though there's a pattern to the madness.

Crap the odd formula should be 50 N 1 2 N + N \frac {\lfloor \frac {50}{N} \rfloor - 1}{2}N + N

Michael Tong - 7 years, 9 months ago

Could you explain how you got those formulas? Nice solution though.

Tim Sudijono - 7 years, 9 months ago

Log in to reply

The odd formula was messed up (I fixed it in the comments). Define a "cycle" to be 2 N 2N integers in length, in which you "keep" N N of them (like in the counting method I suggested). For example, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 1, 2, 3, 4, 5, 6, 7, 8 --> 1 , 2 , 3 , 4 1, 2, 3, 4 for N = 4 N = 4 .

If 50 N \lfloor \frac{50}{N} \rfloor is odd, that means there 0 or more full cycles along with at least half of a cycle. The number of full cycles is calculated by 50 N 1 2 \frac {\lfloor \frac{50}{N}\rfloor - 1}{2} and each cycle has N N elements, so you multiply that by N N . In the next at least half cycle, since it is at least half then you have another N N integers in that cycle despite it not being a full cycle. For example, take 16 16 . For 1 32 1 - 32 (A full cycle) you have 1 , 2 , 3 , . . . 16 1, 2, 3, ... 16 = 16 elements and for 33-50 (Less than a full cycle, but more than half) you have 33 , 34 , 35...48 33, 34, 35 ... 48 = 16 elements.

On the other hand, if 50 N \lfloor \frac{50}{N} \rfloor is even, then that means there are some number of full cycles along with a partial cycle that is less than half of the elements. For each full cycle you get N N elements as usual, and then for the remainder of the integers, since it's less than half, all of the remainder can be put into the set without having a difference of N N with any other element. Thus, ( 50 N ) ( N 2 ) + 50 50 N N 50 50 N N 2 (\lfloor \frac {50}{N} \rfloor)(\frac {N}{2}) + 50 - \lfloor \frac {50}{N}\rfloor N \rightarrow 50 - \lfloor \frac {50}{N} \rfloor \frac{N}{2} is the number of elements (I realize this is different from the formula that I gave, but it gets the exactly same answer. I just realized overnight that this formula is a bit more correspondent to how I derived it)

Michael Tong - 7 years, 9 months ago
Tim Vermeulen
Sep 3, 2013

Let

S = { 1 , 2 , 3 , , 50 } . S = \{ 1, 2, 3, \dots, 50 \}.

If we can make t t pairs ( a , b ) (a,b) with t 21 t \geq 21 from the integers from 1 1 to 50 50 such that a b = N \lvert a - b \rvert = N , then by the pigeonhole principle, given any set

T S with T = 30 , T \subset S \quad \text{ with } \lvert T \rvert = 30,

there are two integers p , q T p,q \in T such that ( p , q ) (p,q) is one of those pairs. This is because there are 50 2 t 50 - 2t integers not in a pair and thus there are at most

30 ( 50 2 t ) = 2 t 20 30 - (50 - 2t) = 2t - 20

integers in t t pairs, and

t 21 t 20 1 2 t 20 t + 1 > t . t \geq 21 \implies t - 20 \geq 1 \implies 2t - 20 \geq t + 1 > t.

Therefore, we wish to find the sum of all possible values of N N such that we can pair up at least 42 42 of the numbers in S S such that each two elements of a pair have an absolute difference of T T .

Let's denote a succesful set of pairings of at least 21 21 pairs for a certain N N by S N S_N . For example,

S 1 = { ( 1 , 2 ) , ( 3 , 4 ) , ( 5 , 6 ) , ( 7 , 8 ) , , ( 41 , 42 ) } . S_1 = \{ (1,2), (3,4), (5,6), (7,8), \dots, (41,42) \}.

Let V N , k V_{N,k} be the set of pairs

( m + k 2 N , m + N + k 2 N ) with 1 m N . (m + k \cdot 2N, m + N + k \cdot 2N) \quad \text{ with } 1 \leq m \leq N.

For example,

V 3 , 0 = { ( 1 , 4 ) , ( 2 , 5 ) , ( 3 , 6 ) } V_{3,0} = \{ (1,4), (2,5), (3,6) \}

and

V 3 , 1 = { ( 7 , 10 ) , ( 8 , 11 ) , ( 9 , 12 ) } . V_{3,1} = \{ (7,10), (8,11), (9,12) \}.

Note that V 3 , 0 V_{3,0} contains 3 3 pairs with the integers from 1 1 to 6 6 such that each pair consists of two integers with an absolute difference of 3 3 . Similarly, V 3 , 1 V_{3,1} contains 3 3 pairs with the integers from 7 7 to 12 12 in that way.

In general, V N , k V_{N,k} contains N N pairs with the integers from 1 + k 2 N 1 + k \cdot 2N to ( k + 1 ) 2 N (k+1) \cdot 2N such that each pair consists of two integers with an absolute difference of N N .

Let

W N = V N , 0 V N , 1 V N , 2 V N , x with x = 21 N 1. W_N = V_{N,0} \cup V_{N,1} \cup V_{N,2} \cup \dots \cup V_{N,x} \quad \text{ with } x = \left\lceil \frac{21}{N} \right\rceil - 1.

We know that V N , k = N \lvert V_{N,k} \rvert = N for all k k , and that V N , a V_{N,a} and V N , b V_{N,b} are disjoint for all distinct integers a , b a,b , so

W N = 21 N N 21 N N = 21. \lvert W_N \rvert = \left\lceil \frac{21}{N} \right\rceil \cdot N \geq \frac{21}{N} \cdot N = 21.

Note that the largest integer in any pair of W N W_N is no more than W N 2 \lvert W_N \rvert \cdot 2 . This implies that if W N 50 2 = 25 \lvert W_N \rvert \leq \frac{50}{2} = 25 , then S N = W N S_N = W_N , because then the largest integer in W N W_N does not exceed 25 2 = 50 25 \cdot 2 = 50 , and as shown above, W N 21 W_N \geq 21 .

If 26 W N 29 26 \leq \lvert W_N \rvert \leq 29 , then we obtain S N S_N by taking W N W_N and removing the 2 W N 50 2 \cdot \lvert W_N \rvert - 50 pairs that contain the 2 W N 50 2 \cdot \lvert W_N \rvert - 50 integers in W N W_N exceeding 50 50 , after which we're left with a set containing

W N ( 2 W N 50 ) = 50 W N 50 29 = 21 \lvert W_N \rvert - \left( 2 \cdot \lvert W_N \rvert - 50 \right) = 50 - \lvert W_N \rvert \geq 50 - 29 = 21

pairs, satisfying S N 21 S_N \geq 21 .

So,there exists a set S N S_N for some N N as long as

W N 29 21 N N 29 21 N 29 N . \lvert W_N \rvert \leq 29 \implies \left\lceil \frac{21}{N} \right\rceil \cdot N \leq 29 \implies \left\lceil \frac{21}{N} \right\rceil \leq \frac{29}{N}.

If N > 29 N > 29 , then

29 N < 1 = 21 N , \frac{29}{N} < 1 = \left\lceil \frac{21}{N} \right\rceil,

so N 29 N \leq 29 . By simply checking each value, we obtain that

N { 1 , 2 , 3 , , 29 } { 10 , 15 , 16 , 17 , 18 , 19 , 20 } . N \in \{ 1,2,3,\dots,29 \} \setminus \{ 10,15,16,17,18,19,20 \}.

To check that N 10 N \not = 10 , consider the set

{ 1 , 2 , 3 , , 10 , 21 , 22 , 23 , , 30 , 41 , 42 , 43 , , 50 } , \{1,2,3,\dots,10, \quad 21,22,23,\dots,30, \quad 41,42,43,\dots,50 \},

which contains 30 30 integers of which there are no two with an absolute difference of 10 10 .

To check that 15 N 20 15 \leq N \leq 20 is also impossible, consider the set

{ 1 , 2 , 3 , , 15 , 36 , 37 , 38 , , 50 } , \{ 1,2,3,\dots,15, \quad 36,37,38,\dots,50 \},

which contains 30 30 integers of which the absolute difference of two of its elements is either less than 15 15 or larger than 20 20 .

So, the sum of all possible values of N N such that there exists a set S N S_N and thus the conditions are satisfied is

( 1 + 2 + 3 + + 29 ) ( 10 + 15 + 16 + 17 + 18 + 19 + 20 ) = 29 30 2 115 = 435 115 = 320 . \begin{aligned} &(1 + 2 + 3 + \dots + 29) - (10 + 15 + 16 + 17 + 18 + 19 + 20) \\[1em] = &\frac{29 \cdot 30}{2} - 115 \\[1em] = &435-115 \\[1em] = &\boxed{320}. \end{aligned}

Matt McNabb
Sep 6, 2013

Let f ( X ) f(X) be the size of the largest possible set that has no two integers with difference N N

We can divide the 50 integers up into N N buckets. Here's an example for N = 9 N=9 : 1 , 10 , 19 , 28 , 37 , 46 2 , 11 , 20 , 29 , 38 , 47 3 , 12 , 21 , 30 , 39 , 48 4 , 13 , 22 , 31 , 40 , 49 5 , 14 , 23 , 32 , 41 , 50 6 , 15 , 24 , 33 , 42 7 , 16 , 25 , 34 , 43 8 , 17 , 26 , 35 , 44 9 , 18 , 27 , 36 , 45 \begin{aligned} 1,&10,19,28,37,46 \\ 2,&11,20,29,38,47\\ 3,&12,21,30,39,48\\ 4,&13,22,31,40,49\\ 5,&14,23,32,41,50\\ 6,&15,24,33,42\\ 7,&16,25,34,43\\ 8,&17,26,35,44\\ 9,&18,27,36,45\\ \end{aligned} If any bucket has at least 4 4 members in the set, then two of them must be adjacent and therefore have difference 9 9 . So, by the pigeonhole principle, f ( 9 ) = 9 3 f(9) = 9*3 .

Generalizing from this example, for each N we can divide it as 50 = q N + r 50 = qN + r , where q q is the number of complete columns, and r r is the number of rows in the last column.

Then if q q is odd, f ( N ) = N q + 1 2 f(N) = N{q+1 \over 2} . And if q q is even, f ( N ) = N q 2 + r f(N) = N{q\over 2} + r .

Now, we want to find all N N so that f ( N ) 30 f(N) \ge 30 . We can categorize these by considering values for q q in turn, remembering that q = 50 N q = \lfloor{50\over N}\rfloor and r < N r < N :

q = 1 , f ( N ) = N , N { 26 , 27 , . . . , 50 } q=1, f(N) = N, N \in \{26, 27,...,50\} : 21 solutions N > 30 N \gt 30

q = 3 , f ( N ) = 2 N , N { 13 , 14 , 15 , 16 } q=3, f(N) = 2N, N \in \{13,14,15,16\} : 2 solutions N = 15 , N = 16 N=15, N=16

q = 5 , f ( N ) = 3 N , N { 9 , 10 } q=5, f(N) = 3N, N \in \{9, 10\} : 1 solution N = 10 N=10

q = 7 , f ( N ) = 4 N , N = 7 q=7, f(N) = 4N, N = 7 : no solutions

q = 9 , f ( N ) = 5 N q=9, f(N) = 5N : no solutions

q = 25 , f ( N ) = 13 N , N = 2 q=25, f(N) = 13N, N = 2 : no solutions

q = 2 , f ( N ) = N + r , N { 17 , 18 , . . . , 25 } q=2, f(N) = N + r, N \in \{17,18,...,25\} : 4 solutions N = 17 , N = 18 , N = 19 , N = 20 N=17, N=18, N=19, N=20

q = 4 , f ( N ) = 2 N + r , N { 11 , 12 } q=4, f(N) = 2N + r, N \in \{11,12\} : no solutions

q = 6 , f ( N ) = 3 N + r , N = 8 , r = 2 q=6, f(N) = 3N + r, N = 8, r=2 : no solutions

q = 8 , f ( N ) = 4 N + r , N = 6 , r = 2 q=8, f(N) = 4N + r, N = 6, r=2 : no solutions

q = 10 , f ( N ) = 5 N + r , N = 5 , r = 0 q=10, f(N) = 5N + r, N =5, r=0 : no solutions

q = 12 , f ( N ) = 6 N + r , N = 4 , r = 2 q=12, f(N) = 6N + r, N = 4, r=2 : no solutions

q = 16 , f ( N ) = 8 N + r , N = 3 , r = 2 q=16, f(N) = 8N + r, N = 3, r=2 : no solutions

The question is asking for all the values of N N which are not solutions, i.e. 1 9 , 11 14 , 21 29 1-9, 11-14, 21-29 which add up to 320 \boxed{320} .

This is fairly ugly although I think it is generalizable. A trick is to consider the columns instead of the rows - for example with N=9, we have 9 numbers "on", then 9 numbers "off", then 9 "on" and so on. so we will need 5 lots of 9 in order to get 3x9 numbers "on", and then 9 more "off", and then 3 more "on" to make 30, so we would need 6x9+3 = 57 numbers to consider in order for N=9 to be a solution. We can work this out for each N and then consider the ones that work out to 50 or less.

Matt McNabb - 7 years, 9 months ago
Nicola Mignoni
Jul 13, 2019

Following @Michael Tong solution, it's possible to find a general condition. Given the set of integers from 1 1 to M M and a subset of size S S , there must exist 2 integers whose absolute difference is exactly N N , if

F ( N ) < S \displaystyle F(N)<S

where

F ( N ) = { N 1 2 M N + ( M m o d N ) , if M N 0 m o d 2 N 1 2 M N , otherwise \displaystyle F(N)=\begin{cases} \displaystyle N \bigg\lceil\frac{1}{2} \bigg\lfloor \frac{M}{N} \bigg\rfloor \bigg\rceil + (M \mod{N}), & \text{if} \ \displaystyle \bigg\lfloor \frac{M}{N} \bigg\rfloor \equiv 0 \mod{2} \\[10pt] \displaystyle N \bigg\lceil\frac{1}{2} \bigg\lfloor \frac{M}{N} \bigg\rfloor \bigg\rceil, & \text{otherwise} \end{cases}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...