Trapezoidal Numbers

T ( x , y ) T(x, y) is the number of circles in a trapezoidal arrangement such that x x is the number of circles in the top row and y y is the number of circles in the bottom row. Each row has one fewer circle than the row beneath it does.

What is the only number between 10000 and 20000 that cannot be a value of T ( x , y ) T(x, y) for positive integers x x and y y such that x < y ? x < y?


The answer is 16384.

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.

15 solutions

Michael Mendrin
Jun 20, 2018

T ( x , y ) = 1 2 ( y x + 1 ) ( y + x ) T(x,y)=\frac{1}{2}(y-x+1)(y+x)

which cannot be a power of 2 2 , since both factors cannot both be even. Now, since the problem asks to find the "only number" between 10000 10000 and 20000 20000 , the number has to be 16384 = 2 14 16384=2^{14} . Proving that it is the only number is another matter.

All the odd numbers can be expressed as T ( x , x + 1 ) = 2 x + 1 T(x,x+1) = 2x+1 .

Let all even numbers with at least one odd factor be expressed as ( 2 a ) ( 2 b + 1 ) (2a)(2b+1) . Then

y = 2 a + b y=2a+b
x = 2 a b x=2a-b

or

y = b + 2 a y=b+2a
x = b 2 a + 1 x=b-2a+1

whichever is greater between 2 a , b 2a, b .

The only numbers that cannot be expressed in this way are even numbers with no odd factors.

Nice solution!

David Vreken - 2 years, 11 months ago

Michael: You show how all odds can be represented, and all numbers with one or more odd factors can be represented. You state that numbers with all even factors cannot be represented either way. Which part of your proof shows/indicates there is not a third way? Are you relying on the problem statement to know this?

Update: I missed that 16384 = 2^14, so never mind.

Ian Leslie - 2 years, 11 months ago

Log in to reply

It's the first sentence, "...since both factors cannot both be even". Give any x , y x, y , both ( x y + 1 ) (x-y+1) and ( x + y ) (x+y) cannot be even. if one is even, the other is odd. Powers of 2 2 can never be a trapezoidal number.

Edit: Okay, so you caught it. I've updated my solution to point out that 16384 = 2 14 16384=2^{14}

Michael Mendrin - 2 years, 11 months ago

Michael: Is there a factor of 1/2 missing with (2a)(2b + 1)? When I sub back in the x and y values I need to drop the 1/2 in the expression for T(x,y) to get (2a)(2b + 1).

Ian Leslie - 2 years, 11 months ago

Log in to reply

Oh, that again, a "loose 1 2 \frac{1}{2} ". Fixed. Try that again now.

Thanks for pointing this out.

Michael Mendrin - 2 years, 11 months ago

What about prime numbers between 10000 and 20000, they cannot have any other factor than 1 and themselves so, the equation cannot be a prime number, can it ??

parvesh kumar - 2 years, 11 months ago

Log in to reply

Parvesh, T(x,y) can be prime: here's a simple example. Pick x of 8 and y of 9, which would be a trapezoid of two rows, or 8+9 =17 total circles. Using the formula above: 1/2(9+8)(9-8+1) =1/2(17)(2)= 17.

Now, this isn't a prime between 10000 and 20000, but ANY prime, P, can be formed by choosing: x = P/2 -1/2 and y = P/2 +1/2

T(x,y)= 1/2((P/2+1/2)+(P/2-1/2))((P/2+1/2)-(P/2-1/2)+1)

Which reduces to: T(x,y)= 1/2(P)(2)= P.

Now, even the prime 2 will work in the above formula, but the trapezoid formed will have only 1 row, with 2 circles.

Jeremy Fischman - 2 years, 11 months ago

Log in to reply

Thank you @Jeremy Fischman , that's what I wanted to know. And thank you @parvesh kumar for asking the question!

Neville Reid - 2 years, 11 months ago

As far as i could understand it is consistent to the following formula 1/2 h(a+b) that is the same equation for the trapezoid, and as you can notice from the shown examples that the a=1/2 b ,so this derives us to the point that the equation should give us 1/2 h(a+2a), and the H is equal to the a+1 ,so with a little of simplicity to the equation it would become 3/2a(a+1), and as a result the formula that could be derived that the T would be equal to X+6, X+9, X+12, X+15,so it's increasing by 3 in the addition with no exceptions ,so why we have a determined value from 10000 to 20000, otherwise I didn't understand what he wants in the question.

Abdelghany Alaa - 2 years, 11 months ago

Log in to reply

It was coincidence that all the pictures showed examples where a = 1/2b and h = a + 1, but these are not necessary conditions for T.

David Vreken - 2 years, 11 months ago

T(x,y) is actually the sum of the integers from x until y (incl.), the reason for this being each following row having one more circle than the previous one.

Joël Ganesh - 2 years, 11 months ago

@ David Vreken - Your problem statement is redundant at the end. You do not need to state x< y, because that was already covered in the information above.

Dennis Rodman - 2 years, 8 months ago

Log in to reply

Yes, that's true. Thanks! (Unfortunately, I cannot edit this problem any more.)

David Vreken - 2 years, 8 months ago
Zico Quintina
Jun 20, 2018

A slightly less formal way to see that any number k N k \in \mathbb{N} with at least one odd factor (i.e. a number that's not a power of 2 2 ) can be written as a trapezoidal number: Let k = m ( 2 n + 1 ) k = m(2n + 1) , for m , n N m,n \in \mathbb{N} . Then if we use m m as the middle term in a series (strictly speaking, a summation), and then add in the n n integers directly before and after m m , the series will have a sum of m ( 2 n + 1 ) m(2n + 1) , because in a sequence consisting of an odd number of consecutive terms, the middle term is always the average.

For example, for k = 77 = 7 × 11 k = 77 = 7 \times 11 , we can start with 7 7 , and then add in the five integers directly before and after 8 8 :

77 = 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 = T ( 2 , 12 ) 77 = 2 + 3 + 4 + 5 + 6 + {\color{#D61F06}7} + 8 + 9 + 10 + 11 + 12 = T(2, 12)

It is possible that there may be some negative integers in the series when first written; e.g. for k = 52 = 4 × 13 k = 52 = 4 \times 13 , we start with 4 4 , and then add in the six integers directly before and after 4 4 , which gives us

52 = - 2 + - 1 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 52 = \text{-}2 + \text{-}1 + 0 + 1 + 2 + 3 + {\color{#D61F06}4} + 5 + 6 + 7 + 8 + 9 + 10

but then we can easily just remove the negatives, their positive counterparts, and zero, which will leave the same sum with a proper trapezoidal representation:

52 = 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = T ( 3 , 10 ) 52 = 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = T(3, 10)

Note we can always do this 'removal', as there have to be fewer negatives than positives in the initial series, otherwise the initial k k would also be negative.

I like this solution, too! Very creative!

David Vreken - 2 years, 11 months ago
Jeffrey Zhou
Jun 21, 2018

T ( x , y ) = y ( y + 1 ) 2 x ( x 1 ) 2 = y 2 + y x 2 + x 2 = ( y + x ) ( y x + 1 ) 2 T(x,y)\ = \frac { y(y+1) }{ 2 } -\frac { x(x-1) }{ 2 }\\ \quad =\frac { { y }^{ 2 }+y-{ x }^{ 2 }+x }{ 2 }\\ \quad = \frac { (y+x)(y-x+1) }{ 2 }

Setting y x + 1 y-x+1 equal to 2 2 :

y x + 1 = 2 y + x = n 2 y 1 = n y-x+1=2\\ y+x = n\\ \rightarrow\ 2y-1=n

Initially it appear that n n must be an odd number, but this is only because we set y x + 1 y-x+1 equal to 2. If we instead set it equal to 3:

2 y 2 = n 2y-2=n

Therefore n n must have at least one odd factor, and as such for n n to not be a solution, it must be a power of 2. The only power of 2 within the range is 16384 16384 .

We haven't completely arrived at "Therefore n must have at least one odd factor". Do you see why?
Do you know how to complete the proof?

Calvin Lin Staff - 2 years, 11 months ago

Log in to reply

No. Can you please explain?

Vaishnav Vishal - 2 years, 11 months ago

Log in to reply

All he has shown is "If we set y x + 1 = 2 y - x + 1 = 2 or 3, then n n must have at least one odd factor".
He has not shown what happens if y x + 1 = 4 , 5 , y - x + 1 = 4, 5, \ldots , where it might be possible that n n does not need an odd factor.

So, it's a minor gap to close, which can be done in a similar manner as what he did above.

Calvin Lin Staff - 2 years, 11 months ago

Whats the best calculator to use

Andrew Charles - 2 years, 11 months ago
Kelvin Hong
Jul 9, 2018

We can obtain a expression for T ( x , y ) T(x,y) :

T ( x , y ) = x + ( x + 1 ) + + y = ( 1 + 2 + . . . + y ) [ 1 + 2 + . . . + ( x 1 ) ] = y ( y + 1 ) 2 x ( x 1 ) 2 \begin{aligned}T(x,y)&=x+(x+1)+\dots+y\\&=(1+2+...+y)-[1+2+...+(x-1)]\\&=\frac{y(y+1)}{2}-\frac{x(x-1)}{2}\end{aligned}

And let an integer n n be its value. Then 2 n = y 2 + y x 2 + x = ( y + x ) ( y x ) + ( y + x ) = ( y + x ) ( y x + 1 ) \begin{aligned}2n&=y^2+y-x^2+x\\&=(y+x)(y-x)+(y+x)\\&=(y+x)(y-x+1)\end{aligned} Now we split in two cases.

When x y ( m o d 2 ) x\equiv y\pmod2 , we have n = y + x 2 ( y x + 1 ) n=\dfrac{y+x}2(y-x+1) . Because y > x y>x , the term y x + 1 y-x+1 must be an odd number larger than 1.

When x ≢ y ( m o d 2 ) x\not\equiv y\pmod2 , we have n = ( y + x ) y x + 1 2 n=(y+x)\dfrac{y-x+1}{2} . Because both x , y x,y are positive integers, so y + x y+x would also be an odd integer larger than 1.

As a result, we cannot have n n to have the only factor 2 2 , so the only answer cannot obtain is 2 14 = 16384 2^{14}=\boxed{16384} .

Binky Mh
Jul 9, 2018

We can produce any odd number n n with T ( n 1 2 , n + 1 2 ) T(\frac{n-1}{2},\frac{n+1}{2}) .

We can produce any multiple of any odd number, as the number of circles in an odd-height trapezium is equal to its height multiplied by length of the middle row.

This means we must find an even number with only even prime factors. As 2 2 is the only even prime, our solution must be the only power of 2 2 between 10 , 000 10,000 and 20 , 000 20,000 : 2 14 = 16384 2^{14}=\boxed{16384} .

Quick visual for the second point:

Binky MH - 2 years, 11 months ago
Arjen Vreugdenhil
Jul 11, 2018

Generalization

Let the prime factorization of N N be N = 2 e 2 3 e 3 5 e 5 p e p . N = 2^{e_2}\cdot 3^{e_3}\cdot 5^{e_5}\cdots p^{e_p}\cdots. Then the number of ways in which N N can be expressed in the desired form is X ( n ) : = # { ( x , y ) T ( x , y ) = N } = ( e 3 + 1 ) ( e 5 + 1 ) ( e p + 1 ) 1. X(n) := \#\{(x,y)|T(x,y) = N\} = (e_3+1)\cdot (e_5+1)\cdots (e_p+1)\cdots - 1. We see that X ( n ) = 0 X(n) = 0 iff e 3 = e 5 = = 0 e_3 = e_5 = \cdots = 0 , i.e. the prime factorization of N N no odd prime factors. Therefore N N is at best a power of 2, which in this case requires N = 16384 N = \boxed{16384} .


Proof of this expression:

We have N = T ( x , y ) = 1 2 y ( y + 1 ) 1 2 x ( x 1 ) = 1 2 ( y x + 1 ) ( y + x ) = : 1 2 A B N = T(x,y) = \tfrac12 y (y+1) - \tfrac12 x(x-1) = \tfrac12(y - x + 1)(y + x) =: \tfrac12 A B The factors A = y x + 1 A = y - x + 1 and B = y + x B = y + x have opposite parity, i.e. one is odd and the other is even.

Thus we are looking for factorings of the form 2 N = A B 2N = AB , with A A and B B of opposite parity and A < B A<B . We take out all factors 2, i.e. we write N = 2 e 2 m m = 3 e 3 5 e 5 p e p is odd . N = 2^{e_2} \cdot m\ \ \ \ m = 3^{e_3}\cdot 5^{e_5}\cdots p^{e_p}\cdots \ \text{is odd}. Let m = u v m = uv be any factoring of m m ; now set A = u A = u and B = 2 e 2 + 1 v B = 2^{e_2+1}v , and swap them if necessary to ensure that A < B A < B . Let x = 1 2 ( B A + 1 ) , y = 1 2 ( B + A 1 ) . x = \tfrac12(B - A + 1),\ \ \ y = \tfrac12(B + A - 1). Then T ( x , y ) = N T(x,y) = N as required; and the number of pairs ( x , y ) (x,y) is equal to the number of factors of m m , that is, ( e 3 + 1 ) ( e 5 + 1 ) ( e p + 1 ) (e_3+1)\cdot (e_5+1)\cdots (e_p+1)\cdots .

However , for each value of N N we must rule out the trivial factoring with u = 1 u = 1 . This leads to A = 1 A = 1 and B = 2 N B = 2N , so that x = y = 2 N x = y = 2N , violating the condition x < y x < y . Therefore we subtract one and obtain the final count X ( n ) = ( e 3 + 1 ) ( e 5 + 1 ) ( e p + 1 ) 1. X(n) = (e_3+1)\cdot (e_5+1)\cdots (e_p+1)\cdots - 1.

To illustrate, consider the case N = 90 N = 90 , with e 2 = 1 e_2 = 1 and m = 45 = 3 2 5 1 m = 45 = 3^2\cdot 5^1 ; there are ( 2 + 1 ) ( 1 + 1 ) = 6 (2+1)(1+1) = 6 ways to factor 45 = u v 45 = uv :

u v A B x y 1 45 1 180 90 90 3 15 3 60 29 31 5 9 5 36 16 20 9 5 9 20 6 14 15 3 12 15 2 13 45 1 4 45 21 24 \begin{array}{cc|cc|cc} u & v & A & B & x & y \\ \hline 1 & 45 & 1 & 180 & 90 & 90 \\ 3 & 15 & 3 & 60 & 29 & 31 \\ 5 & 9 & 5 & 36 & 16 & 20 \\ 9 & 5 & 9 & 20 & 6 & 14 \\ 15 & 3 & 12 & 15 & 2 & 13 \\ 45 & 1 & 4 & 45 & 21 & 24 \\ \hline \end{array} The first row of this table violates the condition x < y x < y , so that we are left with X ( 90 ) = 6 1 = 5 X(90) = 6 - 1 = 5 .

Great generalization! Thanks for sharing.

David Vreken - 2 years, 11 months ago
Mykyta Shvets
Jul 10, 2018

With the help of some python code and a formula T ( a , b ) = 1 2 ( b + a ) ( b a + 1 ) T(a, b)=\frac{1}{2}(b+a)(b-a+1) :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# Set of all integers 10000 to 20000
nleft = set(range(10000, 20001))

# Iterate through possible pairs (a, b)
for b in range(1, 10000):
    for a in range(1, b):
        # Apply formula
        r = (b + a) * (b - a + 1) // 2
        # Remove resulting integer from the set
        if r in nleft:
            nleft.remove(r)
    # Show progress
    print(len(nleft))
    if(len(nleft) == 1):
        break

# Print the set
print(nleft)

# Output
# nleft = {16384}

Lovely! Great way to use code. Made me smile :)

Mikhail Rogachevsky - 2 years, 11 months ago

Log in to reply

Thanks! ...though I should have probably figured it out by myself

Mykyta Shvets - 2 years, 11 months ago
Tom Verhoeff
Jul 9, 2018

It is the power of 2 between 10000 and 20000, which is 16384 \fbox{16384} .

See Rectangular and Trapezoidal Arrangements , where I show that the number of trapezoidal arrangements of n n items (including the degenerate case of all items on a line) equals the number of odd divisors of n n . The powers of 2 are the only numbers with exactly one odd divisor, viz. 1.

Great article! Thanks for sharing!

David Vreken - 2 years, 11 months ago
Hazem Salem
Jul 20, 2018

I struggled with this question and finally solved it. I found that this is level 2 in number theory, but I want to ask the experts how hard is this question

Lance Kuanwu
Jul 15, 2018

In python i created a list of numbers from 10000 to 20000, then i started writing functions to remove numbers based on rules for each stack: So we remove: 1 stack: not allowed 2 stacks: all numbers when added to 1 is divisible by 2 3 stacks: all numbers divisible by 3 4 stacks: all numbers when added to 2 is divisible by 4 5 stacks: all numbers divisible by 5 6 stacks: all numbers when added to 3 is divisible by 6

And you quickly realized the pattern for N stacks: If N is odd, all numbers divisible by N should be removed. If N is even, all numbers, when added to N/2, is divisible by N should be removed. So just write one single function with these two rules and run the list through it. And voila!

Akshay Kumar Jha
Jul 13, 2018

This method is a bit inductive but it does help here:

T(x,y)= =z(say)=x+(x+1)+(x+2)+…+[x+(y-x)]

=((y(y+1))/2)-((x(x-1))/2)

=(y+x)(y-x+1)/2

Now, y>x. So, let y=x+n.

z=(2x+n)(n+1)/2.

Let Z n Z_n represent the set of values of z corresponding to n.

Now, z k z_k = ( k + 1 ) × ( ( 2 x + k ) / 2 ) (k+1) \times ((2x+k)/2)

Case 1: k is odd :

k+1 is even.

Then, k+1/2 may be odd or even.

But, 2 x + k 2x + k is odd ( e v e n + o d d even + odd = odd).

So, z k z_k = o d d × o d d odd \times odd

Or, z k z_k = o d d × e v e n odd \times even

Case 2: k is even :

2 x + k 2x + k is even ( e v e n + e v e n even + even =even) But k+1 is odd.

So, z k z_k = o d d × e v e n odd \times even

Reader may verify that Z 1 Z_1 ={3,5,7,9,11,…} covers all odd numbers except 1.

Let's hunt for even numbers.

The even numbers are of the form o d d × e v e n odd \times even , which rules out the presence of (integral) powers of 2 in any of the set Z k Z_k .

The only (integral) power of 2 between 10000 and 20000 is 16384.

Hence, the answer is 16384.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import numpy as np

def cartesian(*arrays):
    mesh = np.meshgrid(*arrays)  # standard numpy meshgrid
    dim = len(mesh)  # number of dimensions
    elements = mesh[1].size  # number of elements, any index will do
    flat = np.concatenate(mesh).ravel()  # flatten the whole meshgrid
    reshape = np.reshape(flat, (dim, elements)).T  # reshape and transpose
    return reshape

lo_thresh = 10000
hi_thresh = 20000
T_val = []
max_circles_bot_row = lo_thresh
all_vals = np.array(np.arange(lo_thresh,hi_thresh+1),dtype='int32')
x = np.arange(1,max_circles_bot_row)
data = np.array(cartesian(x, x),dtype='int32')
y = data[data[:,0] < data[:,1]]
balls = np.array((np.ptp(y,axis=1)+1) * np.mean(y,axis=1), dtype='int32')
balls = np.unique(balls)
vals = balls[np.where(np.logical_and(balls>=lo_thresh, balls<=hi_thresh))]
if len(np.setdiff1d(all_vals, vals)) == 1:
    print 'The only number between %d and %d that cannot be a value of T(x,y) = %d'\
        %(lo_thresh, hi_thresh, np.setdiff1d(all_vals, vals)[0])

1
The only number between 10000 and 20000 that cannot be a value of T(x,y) = 16384

Jc 506881
Jul 10, 2018

Another way of interpreting the set of all possible values of T ( x , y ) T(x, y) is as the set of all possible sums of two or more consecutive positive integers. Now, any number with an odd factor is expressible as the sum of consecutive integers. For example, if n = 5 k n = 5*k , then n = ( k 2 ) + ( k 1 ) + k + ( k + 1 ) + ( k + 2 ) n = (k-2) + (k-1) + k + (k+1) + (k+2) . The only number between 10000 and 20000 that doesn't have an odd factor is 2 14 = 16384 2^{14} = 16384 .

Manhar Singh
Jul 9, 2018

Let us express T as a function of n and y where n is the number of slabs and y is the number of balls in the bottom row. So, T(n,y) = y + (y-1) + (y-2) + ...... + (y-n+1) T(n,y) = ny - (1 + 2 +3 + ..... + (n-1)) T(n,y) = ny - n ( n 1 ) 2 \frac{n(n-1)}{2}
Now, letting T(n,y) = k and rearranging the expression, we get y = k n \frac{k}{n} + ( n 1 ) 2 \frac{(n-1)}{2} .If n is odd, for y to be integer, k has to be a multiple of n .So k can be of the form 3n , 5n , 7n .... (n cannot be 1) .If n is even, for y to be integer, k has to be an odd multiple of n 2 \frac{n}{2} .So, k should be of the form 2n+1 , 4n+2 , 6n+3 , 8n+4 ....... .So, all odd numbers can be achieved as they are of the form 2n+1 .This leaves us with even numbers .All even numbers are either of the form 4n or 4n+2 .4n+2 can be achieved .So, we are left with 2 and multiples of 4 .2 because in 4n+2, n cannot be 0 .All multiple of 4 can be expressed as 8n or 8n+4 .8n+4 can be achieved .So, we are left with 2,4 and multiples of 8 .This pattern tells us that a number of the form 2^x cannot be achieved if n is even .This form cannot be achieved if n is odd .So the question reduces to finding the number of the form 2^x that lies between 10000 and 20000 .The answer is 16384 (2^14)

Yuan Xue
Jul 8, 2018

Let us think about sorting all possible values of T ( x , y ) T(x,y) where x < y x<y by the number of rows.

As x < y x<y , we have 2 rows at least. In the situation of 2 rows, the minimum possible value is T ( 1 , 2 ) = 3 T(1,2)=3 , and all other values can be represented as 3 + 2 k , 3+2k, where k k is a non-negative integer.

Similarly, in the situation of n n rows, the possible values are T ( 1 , n ) + n k , T(1,n)+nk, where k k is a non-negative integer.

For T ( 1 , n ) = n ( n + 1 ) 2 T(1,n)=\dfrac{n(n+1)}{2} , we can make a statement as follow. If n n is even, then T ( 1 , n ) = n ( n + 1 ) 2 n 2 ( m o d n ) . T(1,n)=\frac{n(n+1)}{2}\equiv \frac n2({\rm mod}\,n).

If n n is odd and n 1 n\ne 1 , then T ( 1 , n ) = n ( n + 1 ) 2 0 ( m o d n ) . T(1,n)=\frac{n(n+1)}{2}\equiv 0({\rm mod}\,n).

Now consider the situations where n = 2 , 4 , 8 , , 2 m n=2,4,8,\ldots,2^m\ldots . These situations tell us that the values in the form 2 k + 1 , 4 k + 2 , 8 k + 4 , 16 k + 8 , , 2 m k + 2 m 1 , 2k+1, 4k+2, 8k+4, 16k+8, \ldots, 2^mk+2^{m-1}, \ldots are all possible. And they can quickly cover almost every positive integer, except those of the form 2 m 2^m .

And between 10000 and 20000 there is only one single number is the power of 2. It is 16384.

On the other hand, if n n is odd and n 1 n\ne 1 , there is no chance for n n to become a factor of 16384.

And If n n is an even number but not a power of 2, T ( 1 , n ) T(1,n) at least has an odd factor which is not 1. Therefore 16384 is not a possible value here.

In conclusion, 16384 is the ONLY number between 10000 and 20000, who can't be a value of T ( x , y ) T(x,y) , where (x<y).

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...