Tricky Algebra Question IV

f ( x ) = 3 x + 2018 2 x + 2017 f(x)=\frac{3x+2018}{2x+2017}

How many integers x x are there such that f ( x ) f(x) is an integer?


The answer is 16.

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.

12 solutions

Jian Hau Chooi
Jul 24, 2018

f ( x ) = 3 x + 2018 2 x + 2017 = 3 x + 3025.5 2 x + 2017 1007.5 2 x + 2017 = 3 2 ( x + 1008.5 x + 1008.5 ) 1 2 ( 2015 2 x + 2017 ) = 3 2 1 2 ( 2015 2 x + 2017 ) \begin{aligned} f(x) &= \frac{3x+2018}{2x+2017} \\ &= \frac{3x+3025.5}{2x+2017} - \frac{1007.5}{2x+2017} \\ &= \frac{3}{2}\bigg(\frac{x+1008.5}{x+1008.5}\bigg) - \frac{1}{2}\bigg(\frac{2015}{2x+2017}\bigg)\\ &= \frac{3}{2} - \frac{1}{2}\bigg(\frac{2015}{2x+2017}\bigg)\\ \end{aligned}

f ( x ) f(x) is an integer \Longrightarrow 2015 2 x + 2017 \large \frac{2015}{2x+2017} is an odd number \Longrightarrow 2 x + 2017 2x+2017 must be the factor of 2015.

2015 = 5 1 × 1 3 1 × 3 1 1 2015 = 5^{1} \times 13^{1} \times 31^{1}

From the above, we found that the factors of 2015 are ± 1 , ± 5 , ± 13 , ± 31 , ± 65 , ± 155 , ± 403 , ± 2015 \pm1, \pm5, \pm13, \pm31, \pm65, \pm155, \pm403, \pm2015 , total 16 16 factors.

Recall: 2 x + 2017 2x+2017 must be the factor or 2015.

Hence, the number of integers x x equal to the number of the factors of 2015 which is 16 \boxed{16} . [Quick Solution —— Prime Number Decomposition Theorem]

Hence, the number of integers x = 2 × ( 1 + 1 ) × ( 1 + 1 ) × ( 1 + 1 ) = 16 . x = 2 \times (1+1) \times (1+1) \times (1+1) = \boxed{16}.

Wiki: https://www.cut-the-knot.org/blue/NumberOfFactors.shtml

Plz explain the last line..how can u say that the number of integers is 16.

Samrit Pramanik - 2 years, 10 months ago

Log in to reply

I've edited my solution for further explanation, please let me know if I've any mistake, thanks!

Jian Hau Chooi - 2 years, 10 months ago

Log in to reply

Ok..thanks..I've understood now.

Samrit Pramanik - 2 years, 10 months ago

Log in to reply

@Samrit Pramanik You're welcome!

Jian Hau Chooi - 2 years, 10 months ago

You could use Euclid's algorithm to get x + 1 2015 x+1 \mid 2015 , and then just do the same as what you did at the end.

Sharky Kesa - 2 years, 10 months ago

Hello Jian. In my solution I use the expression (6x+4036)/(2x+2017). You didn't like it. That's OK, but Binky posted later a solution based on the same expression. You liked it a lot. Is that fair?

A Former Brilliant Member - 2 years, 10 months ago

Log in to reply

Solutions are voted on by users - the author isn't the one who decides which solutions appear at the top. Also, if you look at the solutions to many of the problems on brilliant, you will see duplicate solutions - sometimes explained a little differently that resonates better, sometimes a few votes makes one solution appear at the top more than others. Please continue to provide solutions, because even if it isn't voted up, someone might not understand a higher solution and then see yours.

Chris Brown - 2 years, 10 months ago

Log in to reply

I just overreacted! Sorry and thank you for the advice.

A Former Brilliant Member - 2 years, 10 months ago

f(1)=3(1) + 2018/2(1)+2017=2021/2019 So , f(1) is not integer ....

Suraj Gadhe - 2 years, 10 months ago

Log in to reply

Note that he doesn't say x = 1 x=1 is a solution, but rather 2 x + 2017 = 1 2x+2017=1 . Solve for x x to find the x x -values.

Sharky Kesa - 2 years, 10 months ago

I could find only one integer solution: -1. There can't be any integer solution larger than that because f(x) would be strictly increasing. And f(1) and f(0) are not integers and f(x) cant be greater than 3/2. It cannot be a negative number less than -1 because then the numerator would be less than the denominator.

Joshua Clymer - 2 years, 10 months ago

Log in to reply

Yes, I absolutely agree. I found the other 15 solutions that were proposed to only come close to an integer for f(x). All one has to do is to plug the other 15 solutions into the equation to find that they do not yield an exact integer.

Shannon Lieb - 2 years, 10 months ago

Log in to reply

What does f ( 1008 ) f(-1008) evaluate to?

Sharky Kesa - 2 years, 10 months ago

You are correct, "There can't be any integer solution larger than that"... And indeed all other 15 values are smaller than -1. MUCH smaller, really, the next one is -807.

C . - 2 years, 9 months ago

Have you actually tried substituting those values for 2 x + 2017 2x+2017 ?

Sharky Kesa - 2 years, 9 months ago

its important these factors are odd, since an even factor would not yield a solution

Jochem Jonges - 2 years, 10 months ago

Log in to reply

since 2015 is an odd number, so it won't have even factors.

Jian Hau Chooi - 2 years, 10 months ago

Does this means that "x" can take any of those 16 values and "f(x)" will be an integer number?

Anlev Joel - 2 years, 10 months ago

Log in to reply

2 x + 2017 2x+2017 can take any of those 16 values, not x x . You can figure out the corresponding values of x x from that though.

Sharky Kesa - 2 years, 10 months ago

Is subtracting 1007.5 arbitrary?

Shruti Agarwal - 2 years, 10 months ago
Binky Mh
Aug 6, 2018

f ( x ) = 3 x + 2018 2 x + 2017 f(x)=\frac{3x+2018}{2x+2017} Multiply both sides by 2 2 , and rearrange the top of the fraction to match the divisor: 2 × f ( x ) = 6 x + 4036 2 x + 2017 = 6 x + 6051 2015 2 x + 2017 = 6 x + 6051 2 x + 2017 2015 2 x + 2017 = 3 2015 2 x + 2017 2\times f(x)=\frac{6x+4036}{2x+2017}=\frac{6x+6051-2015}{2x+2017}=\frac{6x+6051}{2x+2017}-\frac{2015}{2x+2017}=3-\frac{2015}{2x+2017} Which can be rearranged to: 2015 = ( 3 2 × f ( x ) ) × ( 2 x + 2017 ) 2015=(3-2\times f(x))\times (2x+2017) As f ( x ) f(x) and x x are both integers, 3 2 × f ( x ) 3-2\times f(x) and 2 x + 2017 2x+2017 must be cofactors of 2015 2015 , and also must be odd. Since all factors of 2015 2015 are odd, they are all viable solutions, and so the number of possible solutions is equal to the number of cofactor pairs of 2015 2015 , which is 16 \boxed{16} .

Thanks for providing another beautiful solution!

Jian Hau Chooi - 2 years, 10 months ago

Hi Binky Mh. My solution is based on the same expression (6x+4036)/(2x+2017), and it was posted earlier (on August 5). Do you think using the same idea is fair???

A Former Brilliant Member - 2 years, 10 months ago

Log in to reply

Sorry, I didn't see your solution when I was checking if this solution had already been shown.

Binky MH - 2 years, 10 months ago

Log in to reply

I had a look at your solution, and although we have similar ideas on how to approach the problem, it looks like we went about finding the solution a little differently.

Binky MH - 2 years, 10 months ago

Hi Binky, I am trying to understand how the 2015 enters the solution process. Could you please elaborate? I would be most grateful. Thank you for your step by step solution process.

James Price - 2 years, 10 months ago

Log in to reply

We want to make the top a multiple of (2x+2017), and since 6x is triple 2x, we want the top to be 3*(2x+2017). This equals (6x+6051). In order to turn 4036 into 6051, we must then subtract 2015 so the equation stays true. Hope that helps.

Binky MH - 2 years, 10 months ago

I think you dropped a minus sign in your rearrangement, though I suspect it doesn't matter...

Mike Torr - 2 years, 10 months ago

Log in to reply

Nice spot! Thanks for pointing it out.

Binky MH - 2 years, 10 months ago

Hi Binky, can you please explain that why factors of 2015 are equal to the number of factors of f(x)?

Shruti Agarwal - 2 years, 10 months ago

Log in to reply

From the equation 2015 = (3 - 2 * f(x)) * (2x + 2017)...

Each pair of factors of 2015 have their respective unique values of f(x) and x. For example:

2015 = 13 * 155

(3 - 2 * f(x)) = 13

(2x + 2017) = 155

f(x) = -(13 - 3)/2

x = (155 - 2017)/2

If (2x + 2017) is not a factor of 2015, then (3 - 2 * f(x)) will have to be a non-integer to balance the equation out. This will result in f(x) also being a non-integer, which means it is not a valid solution. (This also applies in the opposite direction, if f(x) is not a factor).

This means the only cases in which both x and f(x) are integer solutions is when (3 - 2 * f(x)) and (2x + 2017) are cofactors of 2015.

I hope that helps!

Binky MH - 2 years, 10 months ago

Brute force solution using PHP to yield 16 factors:

Sadly this fails if x would have a solution with abs(x)>30000. Or can you prove that there are no such solutions?

KisoX . - 2 years, 10 months ago

Log in to reply

Such a proof would be quite trivial:

For solutions f ( x ) = 3 x + 2018 2 x + 2017 f(x)=\frac{3x+2018}{2x+2017} must be an integer. For x ± x\rightarrow\pm\infty it goes to 3 2 \frac{3}{2} .

Solving for f ( x ) = 1 f(x)=1 gives x = 1 x=-1 . For all x 0 x \geq 0 , 1 < f ( x ) < 1.5 1<f(x)<1.5 , i.e. not an integer.

Solving for f ( x ) = 2 f(x)=2 gives x = 2016 x=-2016 . For all x 2017 x \leq -2017 , 1.5 < f ( x ) < 2 1.5<f(x)<2 , i.e. not an integer.

In conclusion, if x > 2016 |x| > 2016 there will be no solutions, and the list found with this brute force approach is complete.

Roland van Vliembergen - 2 years, 10 months ago

Best solution ever, attempted almost the same way and succeed ;)

Germano Migliastro - 2 years, 10 months ago

Log in to reply

I did it with pen and paper and an ordinary calculator, by finding the values of x corresponding to small values of f(x) and then testing the remaining values of x around -1000. The 16 solutions have a neat separation with respect to each other. Both the steps in f(x) and in x are values in this list: {1,2,4,9,17,45,124,806,-2015}, and this list occurs once left-to-right and once right-to-left (not repeating the end elements).

Roland van Vliembergen - 2 years, 10 months ago

Exactly my results (done in bc )

Bert Seegmiller - 2 years, 10 months ago

I think it is cheating

Licensed Avenger - 2 years, 10 months ago

When replacing x=1 in the formula we obtain f(x)=2021 / 2019, which is not an integer. Probably we need to revisit this answer.

Víctor Palomino - 2 years, 10 months ago

Log in to reply

You're aware x=1 is not a solution right?

Shane Grant - 2 years, 8 months ago

python solution :

-------

count=0

for x in range(-100000,0):

if (((3*x)+2018)%((2*x)+2017)) == 0 :
    count+=1

print(count)

-------

Tirth Patel - 2 years, 10 months ago

Log in to reply

Intelligent guy

Supriya Manna - 2 years, 9 months ago

Lol! You still need to prove no solution is possible beyond your search window... which is easy with differential calculus as f asymptotically approximates to 3/2 on both sides.

Mauricio Álvarez - 2 years, 9 months ago

Log in to reply

Nothing to do only have to test it

Supriya Manna - 2 years, 9 months ago
Kenneth Tan
Aug 7, 2018

Rewrite f ( x ) = 3 x + 2018 2 x + 2017 = x + 1 2 x + 2017 + 1 f(x)=\frac{3x+2018}{2x+2017}=\frac{x+1}{2x+2017}+1 , for this to be an integer, x + 1 2 x + 2017 \frac{x+1}{2x+2017} has to be an integer.

Let x + 1 2 x + 2017 = k \frac{x+1}{2x+2017}=k where k k is an integer, we have, by Simon's Favorite Factoring Trick :

x + 1 = 2 x k + 2017 k x+1=2xk+2017k 2 x k x + 2017 k 1 = 0 2xk-x+2017k-1=0 4 x k 2 x + 4034 k 2 = 0 4xk-2x+4034k-2=0 ( 2 x + 2017 ) ( 2 k 1 ) = 2015 (2x+2017)(2k-1)=-2015

Now since 2015 = 5 × 13 × 31 2015=5\times13\times31 , it has 2 × 2 × 2 = 8 2\times2\times2=8 factors, that means if we include the negatives, 2015 -2015 will have 16 16 factors. Every factor is odd, which matches the parity of the terms ( 2 x + 2017 ) (2x+2017) and ( 2 k 1 ) (2k-1) , which are both also odd. Therefore the number of integers x x such that f ( x ) f(x) is an integer equals to the number of factorizations of 2015 -2015 , which is 16 16 .

If 2 n + 2017 2n+2017 divides 3 n + 2018 3n+2018 , then it divides also 3 ( 2017 + 2 n ) 2 ( 3 n + 2018 ) 3 \cdot(2017+2n) -2 \cdot (3n+2018) ) which is 2015 2015 . The expression 2017 + 2 n 2017+2n ranges over the odd integers (try plugging in n = 1 , n = 2 , . . . n=-1,n=-2,... and you will obtain 2015 , 2013 , . . . 2015, 2013,... .

Since 2015 = 5 13 31 2015=5 \cdot 13 \cdot 31 , it has a total number of 2 2 2 = 8 2 \cdot 2\cdot2=8 odd positive divisors. Now you can choose the sign of each positive divisor (if 65 65 divides 2015 2015 so does 65 -65 ) leading to 2 8 = 16 2 \cdot 8 =16 possibilities, which can all be realized varying n n .

If the last part is unclear, try constructing a divisor of 2015 2015 from its prime factors: you can choose if you want to include 5 5 or not (two options) and the same goes for other factors (when you choose none, you obtain 5 0 1 3 0 3 1 0 = 1 5^0\cdot13^0\cdot31^0=1 .

Generalizing this reasoning, a number whose prime factorization is p 1 a 1 p 2 a 2 p m a m p_1^{a_1} \cdot p_2^{a_2 }\cdot \dots \cdot p_m^{a_m} has ( a 1 + 1 ) ( a m + 1 ) (a_1+1)\cdot\dots\cdot(a_m+1) positive divisors.

2015 = 5 * 13 * 31 without 403 but with the negative ones

Michael Konrad - 2 years, 10 months ago

Log in to reply

Thanks for pointing it out, now the solution should be correct

Gabriele Manganelli - 2 years, 9 months ago
Ryan Chatterjee
Aug 10, 2018

We need to have 2018 + 3 n 2017 + 2 n = k \frac{2018 + 3n}{2017 + 2n} = k for some integer k k . Multiply out the denominator:

2018 + 3 n = 2017 k + 2 n k 2018 + 3n = 2017 k + 2 n k ,

and group all the terms together on one side and set the other side equal to zero:

2017 k + 2 n k 3 n 2018 = 0 2017 k + 2 n k - 3 n - 2018 = 0 .

Dividing everything by 2 2 gives:

n k 3 2 n + 2017 2 k 1009 = 0 n k - \frac{3}{2} n + \frac{2017}{2} k -1009 = 0 .

This almost looks like the setup for Simon's Favorite Factoring Trick . In this case we would have j = 2017 2 , i = 3 2 j = \frac{2017}{2}, i = - \frac{3}{2} , but the problem is 1009 i j = 6051 4 -1009 \not= i j = -\frac{6051}{4} . To get this expression into the desired form, add 6051 4 -\frac{6051}{4} to both sides and apply the factoring trick:

( k 3 2 ) ( n + 2017 2 ) 1009 = 6051 4 (k - \frac{3}{2})(n + \frac{2017}{2}) - 1009 = -\frac{6051}{4} ,

( k 3 2 ) ( n + 2017 2 ) = 1009 6051 4 = 2015 4 (k-\frac{3}{2})(n + \frac{2017}{2}) = 1009 - \frac{6051}{4} = - \frac{2015}{4} ,

and multiplying both sides by 4 4 :

( 2 k 3 ) ( 2 n + 2017 ) = 2015 (2 k - 3)(2 n + 2017) = - 2015 .

Because 2015 = ( 5 1 ) ( 1 3 1 ) ( 3 1 1 ) 2015 = (5^1) (13^1) (31^1) it has ( 1 + 1 ) ( 1 + 1 ) ( 1 + 1 ) = 8 (1+1)*(1+1)*(1+1) = 8 factors, so 2015 -2015 has 16 16 factors among the negative and positive integers. The expressions 2 k 3 2 k - 3 and 2 n + 2017 2 n + 2017 must both correspond to a factor of 2015 -2015 , since both are integers. Thus there are 16 16 possible integral values for 2 n + 2017 2n+2017 . n n must take the form 2017 ± m 2 \frac{-2017 \pm m}{2} , where m m is one of the 8 8 factors of 2015 2015 . So there are 16 16 corresponding possible values for n n (they are: 2016 , 1 , 1210 , 807 , 1086 , 931 , 1041 , 976 , 1024 , 993 , 1015 , 1002 , 1011 , 1006 , 1009 , 1008 -2016, -1, -1210, -807, -1086, -931, -1041, -976, -1024, -993, -1015, -1002, -1011, -1006, -1009, -1008 ). So the answer is 16 16 .

Vinod Kumar
Aug 6, 2018

Just use script "Diophantine y=(3x+2018)/(2x+2017) on integers" in WolframAlpha, and you get list of 16 pairs (x,y) of integers, Answer=16.

Peter Boyajian
Aug 12, 2018

One line in Mathematica:

Reduce[3x+2018==n(2x+2017),{x,n},Integers]

Yeilds all 16 solutions

Sean Mahoney
Aug 9, 2018

I first changed f ( x ) = 3 x + 2018 2 x + 2017 f(x')= \frac{3x'+2018}{2x'+2017} into the equivalent fraction g ( x ) = 2015 + 3 x 2015 + 2 x g(x) = \frac{2015+3x}{2015+2x} where x' = x - 1 This just made the equation look simpler without changing the mathematics

Then I looked at 2015 + 3 x 0 m o d ( 2015 + 2 x ) 2015+3x \equiv 0 mod(2015 + 2x) considering that A + B 0 m o d ( 2015 + 2 x ) A+B \equiv 0 mod(2015 + 2x) we can look at the remainder from 2015 and 3x separately.

This allows for an interesting change of perspective 2015 mod(2015 + 2x) can be written as -2x mod(2015 + 2x) , because as 2015+2x increases 2015 stays constant and the remainder is simply -2x.

Rewriting 2015 + 3 x 0 m o d ( 2015 + 2 x ) 2015+3x \equiv 0 mod(2015 + 2x) gives 2 x + 3 x 0 m o d ( 2015 + 2 x ) -2x + 3x \equiv 0 mod(2015 + 2x) or x 0 m o d ( 2015 + 2 x ) x \equiv 0 mod(2015 + 2x) This brings us to an interesting result as 2015 + 2x increases by 2, x is only increasing by one, and therefore the congruence does not hold for positive x values. Essentially as x approaches infinity we get a horizontal Asymptote at 3/2.

So we can think about negative x values. As x gets more negative in g(x) the numerator decreases faster to 0 than the denominator. Then when x = -806, the numerator is -403 and the denominator is 403. As x gets more and more negative we can reason that the denominator will get closer to 0, resulting in multiple integer solutions. After it passes 0, both the numerator and denominator will be negative, and just like the positive x solutions there will be a point where the numerator is moving faster than the denominator but not fast enough to illicit integer multiples of it.

From here I ran a small bit of java code to calculate the numbers
public static void congruence() { ArrayList<Integer> solutions = new ArrayList<>(); int x = 0; while(2015-2 x >-10000) { for(int i =-10000;i<10000;i++){ if((2015-2 x)*i==x){ solutions.add(x); } } x++; } System.out.print(solutions + "\n" + solutions.size() + "\n"); newbe(solutions); }

public static void newbe(ArrayList<Integer> solutions) { for(Integer e:solutions){ int numerator = 3 (-e-1)+2018; int denominator = 2 (-e-1) + 2017; System.out.println(numerator + " " + denominator); } } }

The last x value I got was -2015 making g ( x ) = 4030 2015 = 2 1 g(x) = \frac{-4030}{-2015} = \frac{2}{1} since g(x) is approaching a horizontal Asymptote of 3/2, there will not be a 1/1 fraction, and the 16 values the code generated are the only 16.

Another brute-force solution, using SAS this time (using more extreme values of x does not change the number of solutions):

data a; do x=-10000 to 10000; y= (3 x+2018) / (2 x+2017); if y-int(y)=0 then output; end; run;

proc contents data=a; run;

Duane Tiemann
Aug 8, 2018

Let N be the result of (3x+2018)/(2x+2017).

Solving for x gives:

x=(2018-2017N)/(2N-3)

This converges to -1008.5 as N increases as -2017N/2N dominates.

Brute force inspection of positive and negative intergers for N as x approaches -1008.5 from above and below gives the result. Once we get x > -1009 and < -1008 from below and above we can stop. Not very sophisticated, but it gets there.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...