Small, Smaller, Smallest

Let a b \displaystyle \frac ab be the smallest of the fractions that are greater than 13 15 \displaystyle \frac {13}{15} where a , b < 500 a,b < 500 are positive integers.

What is the value of a + b a+b ?


The answer is 911.

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.

7 solutions

Daniel Liu
Dec 28, 2013

Note that we want 13 15 < a b \dfrac{13}{15}<\dfrac{a}{b} , or 15 a 13 b > 0 15a-13b>0 ; we want to minimize 15 a 13 b 15a-13b . Since a , b a,b are integers, the smallest difference possible between 15 a 13 b 15a-13b is 1 1 ; therefore we let 15 a 13 b = 1 15a-13b=1 . Parameterizing for a a and b b , we get that a = 13 n + 7 a=13n+7 and b = 15 n + 8 b=15n+8 . Now note that the higher n n gets, the closer a b \dfrac{a}{b} gets to 13 15 \dfrac{13}{15} . Therefore, we want the highest n n possible. Obviously, 13 n + 7 < 15 n + 8 13n+7<15n+8 . We let 15 n + 8 < 500 15n+8<500 , and solving for the maximum n n gets gives us n = 32 n=32 . Plugging this back into a a and b b , we get that a = 423 a=423 and b = 488 b=488 . Our answer is therefore 423 + 488 = 911 423+488=\boxed{911} .

Nice work, Daniel! There is one tricky point here. We need to minimize a b 13 15 = 15 a 13 b 15 b . \frac{a}{b}-\frac{13}{15}=\frac{15a-13b}{15b}. This is not quite the same as minimizing 15 a 13 b . 15a-13b. So how do you know that 15 a 13 b = 1 15a-13b=1 gives the smallest answer? What if 15 a 13 b = 2 15a-13b=2 is better, because it allows for higher b ? b?

Alexander Borisov - 7 years, 5 months ago

Log in to reply

Well, if 15 a 13 b 2 15a-13b \geq 2 ,

a b 13 15 = 15 a 13 b 15 b 2 15 b 2 15 × 500 > 1 15 × 488 = 423 488 13 15 \frac{a}{b} - \frac{13}{15} = \frac{15a-13b}{15b} \geq \frac{2}{15b} \geq \frac{2}{15 \times 500} > \frac{1}{15 \times 488} = \frac{423}{488} - \frac{13}{15}

Wei Jie Tan - 7 years, 5 months ago

Log in to reply

Yes, this is the missing part of the argument. Great job!

Alexander Borisov - 7 years, 5 months ago

Am I wrong?

Wei Jie Tan - 7 years, 5 months ago

Log in to reply

@Wei Jie Tan no you are right

Aditya Kumar - 7 years, 3 months ago

if difference between 15a and 13b is minimum it implies that the difference between a/b and 13/15 is minimum so we take 15a-13b=1

A Former Brilliant Member - 7 years, 5 months ago

Log in to reply

This is not quite true: the size of the denominator also matters. For example, 27 31 \frac{27}{31} is closer than 7 8 \frac{7}{8} to 13 15 . \frac{13}{15}.

Alexander Borisov - 7 years, 5 months ago

May I know how did you arrive at

a = 13 n + 7 and b = 15 n + 8 a = 13n +7 \text{ and } b = 15n +8

? Thanks!

Fan Zhang - 7 years, 5 months ago

Log in to reply

There’s a theorem for Diophantine equations like this one that goes like this:

Theorem. The equation s a + t b = c sa + tb = c has a solution in integers if and only if d c d | c where d = ( s , t ) d = (s , t) . If ( a 0 , b 0 ) (a_0 , b_0) is any particular solution of the equation, then all solutions are given by

a = a 0 ( t / d ) n a = a_0 - (t/d)n and b = b 0 + ( s / d ) n b = b_0 + (s/d)n

where n n is an arbitrary integer.

For 15 a 13 b = 1 15a - 13b = 1 , d = 1 d = 1 and ( 7 , 8 ) (7 , 8) is a solution. So,

a = 7 + 13 n a = 7 + 13n and b = 8 + 15 n b = 8 + 15n

Sadman Sakib - 7 years, 5 months ago

Log in to reply

Can you please explain the notation, in layman's terms? I have no idea what | in d|c is supposed to mean.

Carl Araya - 7 years, 5 months ago

Log in to reply

@Carl Araya The notation d c d|c means that d d divides c c , or, in other words, c c is a multiple of d d .

Alexander Borisov - 7 years, 5 months ago

Log in to reply

@Alexander Borisov Ok thanks!

Carl Araya - 7 years, 5 months ago

d=(s,t) and d divides c can't understand this statement. Will it be d=gcd(s,t) ?

Md Saiful Islam - 7 years, 5 months ago

d=(s,t) and d divides c

can't understand this statement.

Will it be d=gcd(s,t) ?

Md Saiful Islam - 7 years, 5 months ago

Log in to reply

@Md Saiful Islam You are right , ( a , b ) (a,b) means the gcd of a a and b b and also [ a , b ] [a,b] means the lcm of a a and b b .

Sadman Sakib - 7 years, 5 months ago

yeah. same question. this is the most important part.

Christian Baldo - 7 years, 5 months ago

See here .

Rahul Saha - 7 years, 5 months ago

How did you get a=13n+7 and b=15n+8 ? I know it simplifies to 1=1, but how did you derive it?

Carl Araya - 7 years, 5 months ago

Log in to reply

Look at Sadman Sakib's post somewhere at the top of the replies.

Wei Jie Tan - 7 years, 5 months ago

Really nice solution!!

Biswadeep Sen - 7 years, 3 months ago

Very good!!

Aran Pasupathy - 6 years, 3 months ago
Rares B.
Dec 29, 2013

Let A = { a b a , b < 500 and 13 15 < a b } A=\{ \frac{a}{b} | a,b<500 \mbox{ and } \frac{13}{15}<\frac{a}{b}\} , we then have to find m i n ( A ) min(A) . Suppose a b \frac{a}{b} is an arbitrary fraction in A A , then : 13 15 < a b 13 b 15 < a \frac{13}{15}<\frac{a}{b} \Rightarrow \frac{13b}{15}<a . Obviously for a fixed b b , a a must be as small as possible (a fraction gets smaller as the numerator decreases) and the last inequality must hold at the same time. This is possible if we take a a to be the smallest integer bigger than 13 b 15 \frac{13b}{15} or in other words : a = 13 b 15 + 1 a={\lfloor{\frac{13b}{15}}\rfloor}+1 , where x \lfloor x \rfloor is the floor of x .

*Assertion 1 : * If ’b’ is a positive integer then 13 15 < 13 b 15 + 1 b a b for any ’a’ for which 13 15 < a b \mbox{If 'b' is a positive integer then } {\frac{13}{15}<\frac{{\lfloor{\frac{13b}{15}}\rfloor}+1}{b}\le\frac{a}{b}} \mbox{ for any 'a' for which } \frac{13}{15}<\frac{a}{b}

We'll prove this by contradiction : Suppose there is a a and b b such that : 13 15 < a b \frac{13}{15}<\frac{a}{b} , but 13 b 15 + 1 b > a b \frac{{\lfloor{\frac{13b}{15}}\rfloor}+1}{b}>\frac{a}{b} .Then : 13 b 15 < a < 13 b 15 + 1 \frac{13b}{15}<a < \lfloor{\frac{13b}{15}}\rfloor+1 , 13 b 15 13 b 15 13 b 15 < a < 13 b 15 + 1 \lfloor \frac{13b}{15} \rfloor \le \frac{13b}{15} \Rightarrow \lfloor \frac{13b}{15} \rfloor<a < \lfloor{\frac{13b}{15}}\rfloor+1 \Rightarrow contradiction , there can't be an integer between two consecutive integers .

Now the problem is finding the minimum of : 13 b 15 + 1 b { \frac{{\lfloor{\frac{13b}{15}}\rfloor}+1}{b} } where b { 1 , 2 , . . . , 499 } b \in \{1,2,...,499\} .This sequence behaves rather strangely , locally it's neither increasing nor decreasing but globally it decreases to 13 15 \frac{13}{15} .

Let's turn our attention to the Divison Theorem for now , which says that for all integers n , m n ,m we can find only one pair of numbers q Z , r { 0 , 1 , . . . , m 1 } q\in\mathbb{Z},r\in\{0,1,...,m-1\} such that : n = q m + r n=q*m+r .Intuitively q q is the amount of times m m goes into n n , or better said q q is the biggest number for which m q n q n m q = n m mq\le n \Rightarrow q\le\frac{n}{m} \Rightarrow q=\lfloor \frac{n}{m} \rfloor .And we'll denote the remainder when n n is divided by m m by r ( n , m ) r(n,m) n = m n m + r ( n , m ) n m = n r ( n , m ) m \Rightarrow n=m*\lfloor \frac{n}{m} \rfloor+r(n,m) \Rightarrow \lfloor \frac{n}{m} \rfloor = \frac{n-r(n,m)}{m} , for all integers n , m n,m .

Then 13 b 15 = 13 b r ( 13 b , 15 ) 15 \lfloor{\frac{13b}{15}}\rfloor= \frac{13b-r(13b,15)}{15} , and the whole expression we have to minimize becomes : 13 b 15 + 1 b = 13 b r ( 13 b , 15 ) 15 + 1 b = 13 b r ( 13 b , 15 ) + 15 15 b = 13 b + 15 r ( 13 b , 15 ) 15 b = 13 15 + 1 15 15 r ( 13 b , 15 ) b { \frac{{\lfloor{\frac{13b}{15}}\rfloor}+1}{b} } = \frac{\frac{13b-r(13b,15)}{15}+1}{b} = \frac{\frac{13b-r(13b,15)+15}{15}}{b} =\frac{13b+15-r(13b,15)}{15b}=\frac{13}{15}+\frac{1}{15}\frac{15-r(13b,15)}{b} . The only part we have to minimize is 15 r ( 13 b , 15 ) b \frac{15-r(13b,15)}{b} , the rest of it doesn't depend on b b .From the Division Theorem we have b = 15 q + r 15 r ( 13 b , 15 ) b = 15 r ( 13 15 q + 13 r , 15 ) 15 q + r = 15 r ( 13 r , 15 ) 15 q + r b=15q+r \Rightarrow \frac{15-r(13b,15)}{b}=\frac{15-r(13*15q+13r,15)}{15q+r} =\frac{15-r(13r,15)}{15q+r} . Keeping q q fixed ,let's try to find for which remainder that fraction is the smallest , we have two cases :

1) 0 r 7 0\le r \le 7

If r = 0 r=0 then 15 r ( 13 r , 15 ) 15 q + r = 1 q \frac{15-r(13r,15)}{15q+r}=\frac{1}{q} , otherwise r ( 13 r , 15 ) = r ( 15 + 13 r , 15 ) = r ( 15 + 13 r + 2 r 2 r , 15 ) = r ( 15 + 15 r 2 r , 15 ) = r(13r,15)=r(15+13r,15)=r(15+13r+2r-2r,15)=r(15+15r-2r,15)= r ( 15 2 r , 15 ) = 15 2 r 15 ( 15 2 r ) 15 q + r = 2 r 15 q + r r(15-2r,15)=15-2r \Rightarrow \frac{15-(15-2r)}{15q+r}=\frac{2r}{15q+r} .As r r grows so does 2 r 15 q + r \frac{2r}{15q+r} , so its smallest value is when r = 1 r=1 : 2 15 q + 1 \frac{2}{15q+1} .This is less than 1 q \frac{1}{q} .

2) 8 r 14 8\le r \le 14

r ( 15 2 r , 15 ) = r ( 30 2 r , 15 ) = 30 2 r 15 r ( 13 r , 15 ) 15 q + r = 2 r 15 15 q + r r(15-2r,15)=r(30-2r,15)=30-2r \Rightarrow \frac{15-r(13r,15)}{15q+r}=\frac{2r-15}{15q+r} , again this grows with r r .The smallest possible value is when r = 8 r=8 : 1 15 q + 8 \frac{1}{15q+8} .Between 2 15 q + 1 \frac{2}{15q+1} and 1 15 q + 8 \frac{1}{15q+8} , the later is the smallest \Rightarrow For a fixed q q , 15 r ( 13 r , 15 ) 15 q + r \frac{15-r(13r,15)}{15q+r} is the smallest when r = 8 r=8 .And obviously for a fixed r r , 15 r ( 13 r , 15 ) 15 q + r \frac{15-r(13r,15)}{15q+r} gets smaller as q q grows . Let's denote 15 r ( 13 r , 15 ) 15 q + r \frac{15-r(13r,15)}{15q+r} by E ( b ) E(b) , q q and r r are simply the quotient and the remainder when b b is divided by 15.The last number between 1 and 499 to have a remainder of 8 is 488 , so E ( 488 ) E ( n ) , 0 < n < 494 E(488) \le E(n) , 0< n<494 .Now E ( 496 ) < E ( 497 ) < . . . < E ( 499 ) E(496) < E(497) <... < E(499) and E ( 496 ) > E ( 495 ) E(496) > E(495) since 496 has a remainder of 1 .We only need to know whether E ( 488 ) < E ( 496 ) E(488) < E(496) or not .

Looking at the more general statement : E ( 15 q + 8 ) < E ( 15 ( q + 1 ) + 1 ) E(15q+8)<E(15(q+1)+1) \Leftrightarrow 1 15 q + 8 < 2 15 q + 1 \frac{1}{15q+8}<\frac{2}{15q+1} , so E ( 15 q + 8 ) < E ( 15 ( q + 1 ) + 1 ) E(15q+8)<E(15(q+1)+1)

The fractions is the smallest when b = 488 b=488 , and a = 13 b 15 + 1 = 423 a= \lfloor{\frac{13b}{15}\rfloor}+1 = 423 .

a + b = 911 a+b= \boxed{911}

Santanu Banerjee
Dec 29, 2013

JAVA CODE ::

import java.io.*;

import java.math.*;

public class SmallSmallerSmallest

{

public static void main(String args[])throws IOException

{

    double i=0.0,j=0.0,k=13.0/15.0,l=0,m=10000.0,x=0.0,y=0.0;

    for(i=1.0;i<500.0;i+=1.0)

    {

        for(j=1.0;j<500.0;j+=1.0)

        {

            l=i/j;

            if(l>k)

            {

                if(m>l)

                {

                    m=l;

                    x=i;

                    y=j;

                }

            }

        }

    }

    System.out.println((x+y));

}

}

OUTPUT :: 911.0

It is the Best of Number Theory who reshared this not the Best of Computer Science.

Sadman Sakib - 7 years, 5 months ago

Log in to reply

Indeed.

But really, there's no reason not to tackle this via programming.

Joeie Christian Santana - 6 years, 3 months ago
Forretrio Wong
Jan 1, 2014

It follows from the property of Farey sequence that if a real number x x is between a b \frac{a}{b} and c d \frac{c}{d} then the farey median a + b c + d \frac{a+b}{c+d} is a new estimate to x x and we iterate to get the best two fractional estimate and the answer is of course the larger ones.

Simple question with clear algorithmic solution. We start from 0 1 \frac{0}{1} and 1 1 \frac{1}{1} , the next one is 1 2 \frac{1}{2} ... and we get our answers eventually.

but is is only brute force with a bit of ingenuity,it will take time to solve this question by your process,but hey new solutions are always welcome

Aditya Kumar - 7 years, 3 months ago
Carsten Meyer
Sep 9, 2019

A solution with Diophantine equations

For simplicity, let N : = 500 N:=500 ..

  • Let us analyse the condition for 0 < a , b < N 0<a,\:b<N : a b > ! 13 15 15 a 13 b > ! 0 LHS is integer 15 a 13 b = l > 0 , l N \begin{aligned} \frac{a}{b}&\overset{!}{>}\frac{13}{15}&&\Leftrightarrow&15a-13b&\overset{!}{>}0&\underset{\text{LHS is integer}}{\Leftrightarrow}&&15a-13b&=l>0,&l\in\mathbb{N} \end{aligned}

The integers a , b a,\:b are a solution to a Diophantine Equation ! We can be sure a solution exists, because 13 , 15 13,\:15 are coprime. Use Euclid's Algorithm to find the general solution: \[\begin{align} \begin{array}{r|r|r|r} n&p_n&a_n&x_n\\ \hline -2&15&\%&\red{8}\\ -1&-13&\%&\green{7}\\ 0&2&-1&1\\ 1&1&-7&0\\ 2&0&2&1 \end{array}&&\Rightarrow&&

\begin{pmatrix} a\\b \end{pmatrix}&=\begin{pmatrix} \green{7}&13\\ \red{8}&15 \end{pmatrix}\begin{pmatrix} l\\\Psi \end{pmatrix},&&&l&\in\mathbb{N},&\Psi\in\mathbb{Z} \end{align}\]

  • The restriction 0 < a , b < N 0<a,\:b < N together with l > 0 l>0 leads to a restriction for t : = Ψ / l t:=\Psi/l : 0 < a , b < N Ψ l = t ( 8 15 ; min { N 15 l 8 15 , N 13 l 7 13 } ) = : I ( l ) ( ) \begin{aligned} 0&<a,\:b<N&\Rightarrow&&\frac{\Psi}{l}=t\in\left(-\frac{8}{15};\:\min\left\{\frac{N}{15l}-\frac{8}{15},\:\frac{N}{13l}-\frac{7}{13}\right\}\right)=:I(l)&&(*) \end{aligned}

  • Insert the solution of the Diophantine Equation into a , b a,\:b : a b = 7 l + 13 Ψ 8 l + 15 Ψ = 7 + 13 t 8 + 15 t = 13 15 + 1 15 1 15 t + 8 = : f ( t ) , t = Ψ l \frac{a}{b}=\frac{7l+13\Psi}{8l+15\Psi}=\frac{7+13t}{8+15t}=\frac{13}{15}+\frac{1}{15}\cdot\frac{1}{15t+8}=:f(t),\qquad t=\frac{\Psi}{l}

  • Notice that f f is strictly decreasing for t I ( l ) t\in I(l) - if we want to minimize a b = f ( t ) \frac{a}{b}=f(t) , we need to maximize the upper bound of I ( l ) I(l) in ( ) (*) ! As that decreases with l > 0 l>0 , we need to use l = 1 l=1 :

Ψ = Ψ 1 < min { N 8 15 , N 7 13 } = N = 500 32 3 5 Ψ = 32 , ( a b ) = ( 7 13 8 15 ) ( 1 32 ) = ( 423 488 ) \begin{aligned} \Psi&=\frac{\Psi}{1}<\min\left\{\frac{N-8}{15},\:\frac{N-7}{13}\right\}\underset{N=500}{=}32\:\frac{3}{5}&&\Rightarrow&\Psi=32,&& \begin{pmatrix} a\\b \end{pmatrix}&=\begin{pmatrix} 7&13\\ 8&15 \end{pmatrix}\begin{pmatrix} 1\\32 \end{pmatrix}=\begin{pmatrix} 423\\ 488 \end{pmatrix} \end{aligned}

  • a , b a,\:b are coprime; the answer is a + b = 911 a+b=\boxed{911}
Manojkumar P
Apr 19, 2016
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
var arr=[];var num=[];k=0;
for(i=0;i<500;i++)
for(j=1;j<500;j++)
{
a=i/j;b=13/15;
if(a>b)
{
arr.push(a);
num[k]={nr:i,dr:j,va:a}
k++;
}
}
num.sort(function(a, b){return a.va-b.va});
document.write(num[0].nr+num[0].dr);

Geoff Pilling
Apr 8, 2016

You might want to specify that a and b are positive integers. Otherwise you could get arbitrarily close to 13/15th, by choosing, for example, a = -13,000,000,001 and b = -15,000,000,000 (both less than 500, but a/b just barely > 13/15)

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...