From year to year

How many positive integers cannot be expressed in the form 2015 a + 2016 b 2015a + 2016b for non-negative integers a a and b b ?


The answer is 2029105.

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.

3 solutions

A corollary to the Chicken Mcnugget Theorem states that, for positive coprime integers m , n m,n , there are exactly ( m 1 ) ( n 1 ) 2 \dfrac{(m - 1)(n -1)}{2} positive integers which cannot be expressed in the form a m + b n am + bn for non-negative integers a , b a,b . In this case m = 2015 , n = 2016 m = 2015, n = 2016 , giving us an answer of

( 2015 1 ) ( 2016 1 ) 2 = 2029105 \dfrac{(2015 - 1)(2016 - 1)}{2} = \boxed{2029105} .

Are there any restrictions on m m and n n ? What if both m m and n n are even? (Say like m = 4 m=4 , n = 6 n=6 )

Janardhanan Sivaramakrishnan - 5 years, 3 months ago

Log in to reply

Yes, sorry, I forgot to specify that m , n m,n must be coprime for this formula to apply. I've made the appropriate edit.

Brian Charlesworth - 5 years, 3 months ago

Why is it called the Chickdn McNugget theorem , haha?

A Former Brilliant Member - 5 years, 3 months ago

Log in to reply

The "origin story" is provided in the link. :)

Brian Charlesworth - 5 years, 3 months ago
Zk Lin
Mar 1, 2016

I did it the old-fashioned way since I didn't realize the existence of Chicken Mcnugget Theorem until I read the wiki. Thanks for introducing this neat theorem through the question :)

We call n n representable if n n can be expressed as 2015 a + 2016 b 2015a+2016b for non-negative integers a , b a,b .

Claim: For n > 4062240 = ( 2015 ) ( 2016 ) n > 4062240= (2015)(2016) , n n is always representable.

Proof:

Write 4062240 = ( 2015 ) ( 2016 ) 4062240=(2015)(2016) . We have

4062240 + 1 = ( 2015 ) ( 2015 ) + ( 2016 ) ( 1 ) 4062240+1=(2015)(2015)+(2016)(1)

4062240 + 2 = ( 2015 ) ( 2014 ) + ( 2016 ) ( 2 ) 4062240+2=(2015)(2014)+(2016)(2)

\cdots

4062240 + 2016 = ( 2015 ) ( 0 ) + ( 2016 ) ( 2016 ) = ( 2015 ) ( 2016 ) + ( 2016 ) ( 1 ) 4062240+2016=(2015)(0)+(2016)(2016)=(2015)(2016)+(2016)(1)

4062240 + 2017 = ( 2015 ) ( 2015 ) + ( 2016 ) ( 2 ) 4062240+2017=(2015)(2015)+(2016)(2)

\cdots

It is obvious that this can be continued, so any n > 4062240 n > 4062240 can be represented indeed.

Now, we will attempt to devise an algorithm to generate the set of "representable" integers for n 4062240 n \leq 4062240 .

Note that if c = 2015 d c=2015d , then

c + 1 = 2015 ( d 1 ) + 2016 ( 1 ) c+1=2015(d-1)+2016(1)

c + 2 = 2015 ( d 2 ) + 2016 ( 2 ) c+2=2015(d-2)+2016(2)

\cdots

c + d = 2015 ( 0 ) + 2016 ( d ) c+d=2015(0)+2016(d) .

Therefore, if c c is representable, so are c + 1 , c + 2 , c + d c+1,c+2 \cdots, c+d .

We claim that if we take d = 1 , 2 , , 2015 d=1,2, \cdots, 2015 , we will generate the whole set of representable integers for n 4062240 n \leq 4062240 .

Proof that the algorithm generates all members of the set:

Note that we have a + b = d k + k = d a+b=d-k+k=d for d = 1 , 2 , , 2015 d=1,2, \cdots ,2015 . For d > 2015 , n = 2015 a + 2016 b > 2015 ( 2016 ) = 4062240 d>2015, n=2015a+2016b>2015(2016)=4062240 , which lies outside the range we are interested in. Note also that for every d d , our algorithm generates a complete 2 2 -partition of d d as non-zero integers ordered pairs ( a , b ) (a,b) , thus generating every member of the set.

Proof that every member of the set is unique:

Since 2015 ( d + 1 ) = c + 2015 > c + d 2015(d+1)=c+2015>c+d is true for d < 2015 d < 2015 , it is easy to see that there is no overlap of representation for d 2014 d \leq 2014 . We need not worry about cases where d + 1 > 2015 d > 2014 d+1>2015 \implies d>2014 since this implies 2015 ( d + 1 ) 2015 ( 2016 ) 2015(d+1)\geq 2015(2016) , but our algorithm has already terminated at this point, taking note of the fact that 2015 ( 2016 ) 2015(2016) is already generated when d = 2015 c + d = 2016 ( 2015 ) d=2015 \implies c+d=2016(2015) .

Taking d = 1 , 2 , , 2015 d=1,2, \cdots, 2015 , we have

d = 1 2015 ( d + 1 ) = ( 2015 ) ( 2016 ) 2 + 2015 \displaystyle \sum_{d=1}^{2015} (d+1) = \frac{(2015)(2016)}{2}+2015 representable integers for 1 n 4062240 1 \leq n \leq 4062240 .

Therefore, the desired answer is ( 2015 ) ( 2016 ) ( 2015 ) ( 2016 ) 2 2015 = 2029105 (2015)(2016)-\frac{(2015)(2016)}{2}-2015=\boxed{2029105} .

Moderator note:

Great that you re-discovered this proof!

Great! Thanks for posting the "first principles", (aka "old-fashioned"), solution. :)

Brian Charlesworth - 5 years, 3 months ago
Joe Mansley
Mar 12, 2021

Let N = 2015 N=2015 . Any integer can be uniquely written as N p + q Np+q where 0 q < N 0 \leq q < N .

We want know if a , b : N ( a + b ) + b = N p + q \exists a,b: N(a+b)+b=Np+q .

If p q p \geq q , choose a = p q , b = q a=p-q, b=q , and we have a solution.

Since b q b \equiv q , b q b \geq q .

So if p < q p<q then a + b b q > p a+b \geq b \geq q > p and b q b \geq q Therefore N ( a + b ) + b > N p + q N(a+b)+b>Np+q so there's no solution.

So we just need to count the ( p , q ) (p,q) s.t. p < q p<q

For p = 0 p=0 there are N 1 N-1 values of q, for p = 1 p=1 there are N 2 N-2 values of q, ....

So the answer is N 1 + N 2 + . . . + 1 = ( N 1 ) N / 2 N-1+N-2+...+1=(N-1)N/2

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...