Counting Conundrum

Geometry Level 3

How many real x x satisfying 0 x 2017 0 \leq x \leq 2017 are there such that x sin ( π x ) x \sin(\pi x) is an integer?


Bonus: Can you come up with a simple formula for how many 0 x n 0 \leq x \leq n there are such that x sin ( π x ) x \sin(\pi x) is an integer, where n n is a positive integer?


The answer is 4068290.

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

Brandon Monsen
Aug 23, 2017

Relevant wiki: Trigonometric Functions Problem Solving

Let f ( x ) = x sin ( π x ) f(x)=|x \sin(\pi x)| . Note that counting the number of x x such that f ( x ) f(x) is an integer is the same as the original problem, since

x sin ( π x ) Z x sin ( π x ) N Z x \sin(\pi x) \in \mathbb{Z} \rightarrow |x \sin(\pi x)| \in \mathbb{N} \subset \mathbb{Z}

Also, note the following properties of f ( x ) f(x) :

  • g ( x ) = x g(x)=x is tangent to f ( x ) f(x) if and only if x = n + 1 2 x=n+\frac{1}{2} for some non-negative integer n ( 1 ) n \quad (1)

  • f ( x ) g ( x ) f(x)\leq g(x) for all x 0 ( 2 ) x \geq 0 \quad (2)

  • f ( n ) = 0 f(n)=0 for all integers n ( 3 ) n \quad (3)

Putting it all together, for n x n + 1 n \leq x \leq n+1 , we have that f ( x ) f(x) begins at 0 0 (3), goes up to some maximum n < M < n + 1 n<M<n+1 (1,2) and then returns back to f ( x ) = 0 f(x)=0 when x = n + 1 x=n+1 (3)

From here, we know that if n n is a non-negative integer, for each interval n < x < n + 1 n < x < n+1 we get that f ( x ) f(x) crosses 2 n 2n integers, and that f ( n ) f(n) is also an integer.

Hence we get the 2018 2018 integers from 0 0 to 2017 2017 inclusive, as well as

n = 0 2016 2 n = 2016 ( 2017 ) = 4066272 \sum_{n=0}^{2016} 2n = 2016(2017) = 4066272

The total is 4066272 + 2018 = 4068290 4066272+2018=\boxed{4068290} .

Note: for completeness, we should show that f ( x ) f(x) between n < x < n + 1 n<x<n+1 is strictly increasing up until a maximum, and then strictly decreasing until it once again reaches 0 0 . I can't think of an easy way to show this without using calculus, however.


Bonus:

We get n + 1 n+1 from when x x is an integer, and the rest come from the sum in our solution, which evaluates to n ( n 1 ) n(n-1)

n + 1 + ( n ) ( n 1 ) = n 2 + 1 n+1+(n)(n-1)=\boxed{n^{2}+1}


A graph to better understand solution:

Blue curve: f ( x ) = x f(x)=x

Red curve: f ( x ) = x sin ( π x ) f(x)=\left| x \sin (\pi x) \right|

Good solution. Maybe you could add a picture of the graph of the function which is beautifully simple and clear visualisation of what you just described mathematically.

Kai Ott - 3 years, 9 months ago

Log in to reply

I agree a graph makes this problem much, much easier to see. I added a picture just now to the bottom part

Brandon Monsen - 3 years, 9 months ago

Good solution! The only important thing is to be careful about all those maxima between the roots. If you solve it (using calculus) you will find out that they correspond to the solutions of the equation pi x + tan(pi x) = 0. As you can see in your own plot, the x coordinates of the maxima approach n + 1/2 (the |sin(pi x)| maxima) as x increases. But for lower values of x the maximum between two roots doesn't correspond that much to the one of the function |sin(pi x)|. In this way it would be possible to have more integer values than the calculated.

Lucas Guimarães - 3 years, 9 months ago

Log in to reply

Nice job getting the exact form of the maxima!

I only touched on it briefly, but we can use the fact that x sin ( π x ) x |x \sin( \pi x) | \leq x for all x > 0 x>0 , to give an upper bound on what I defined to be f ( x ) f(x) . If x < n x<n , then f ( x ) < n f(x)<n holds as well.

This is what allows me to say for certain that f ( x ) f(x) doesn't cross any more integers in that interval, since we show using tangents that it goes up and through n 1 n-1 , but it can't actually cross n n while satisfying the inequality

Brandon Monsen - 3 years, 9 months ago

This problem can be approached by converting x*sin(pi*x)=k where k stands for an integer to sin(pi*x)=k/x=y . Then, one has to find how many times hyperbole k/x intercepts sin(pi*x) on a given interval from 0 to 2017. For k>0, the number of intercepts equals 2*Sum(i=1 to i=1008)2ni=2034144 . For k<0, the number of intercepts equals 2016 + 2*Sum(i=1 to i=1007)2ni=2032128 . For special case k=0, hyperbole becomes a line y=0 that intercepts sin(pi*x) 2018-times. So overall the number of solutions is 2034144 + 2032128 + 2018 = 4068290.

Mirek Baudys - 3 years, 9 months ago
Arjen Vreugdenhil
Aug 25, 2017

Relevant wiki: Trigonometric Functions Problem Solving

For n > 0 n > 0 consider the function f ( x ) = x sin ( π x ) f(x) = |x\sin(\pi x)| on the interval n 1 , n ] \langle n-1,n] .

On the first half of the interval, the function increases monotonously from f ( n 1 ) = 0 f(n-1) = 0 to f ( n 1 2 ) = n 1 2 f(n-\tfrac12) = n-\tfrac12 . Thus f n 1 , n 1 2 ] = 0 , n 1 2 ] f\langle n-1,n-\tfrac12] = \langle 0, n-\tfrac12] On the second half of the interval, the function decreases monotonously from f ( n 1 2 ) = n 1 2 f(n-\tfrac12) = n-\tfrac12 to f ( n ) = 0 f(n) = 0 . Thus f n 1 2 , n ] = [ 0 , n 1 2 f\langle n-\tfrac12,n] = [0, n-\tfrac12\rangle The first image contains n 1 n-1 integers; the second image, n n integers. Since the function is strictly monotonous on both parts, it is injective on each half interval, so that:

The interval n 1 , n ] \langle n-1,n] contains 2 n 1 2n - 1 values for x x so that f ( x ) f(x) is an integer.

Removing the absolute value in the definition of f ( x ) f(x) does not change this conclusion for obvious reasons.

Thus on the interval 0 , N ] \langle 0, N] we obtain n = 1 N 2 n 1 = 1 + 3 + 5 + = N 2 \sum_{n=1}^N 2n-1 = 1 + 3 + 5 + \dots = N^2 Finally, the problem asks for the number of integers in the image of the closed interval, [ 0 , N ] [0, N] . We must therefore add one since f ( 0 ) = 0 f(0) =0 . The answer is N 2 + 1 = 201 7 2 + 1 = 4 068 290 . \boxed{N^2 + 1} = 2017^2 + 1 = \boxed{4\,068\,290}.

I'm being extremely nit-picky here, but be careful about when you say f ( x ) f(x) is monotonically decreasing on the second half of the interval. Its maximum is actually slightly after x = n 1 2 x=n-\frac{1}{2} . It doesn't change the outcome of the problem, but it might be worth noting.

Brandon Monsen - 3 years, 9 months ago

Log in to reply

You are right! And a rookie mistake, too... Of course, the maximum M = f ( m ) M = f(m) still lies between n 1 n-1 and n n , so that the interval can be divided in

  • n 1 , m ] \langle n - 1, m] , on which f f is monotonous with image 0 , M ] \langle 0, M] ,

  • [ m , n [m, n\rangle , on which f f is monotonous with image [ 0 , M [0, M\rangle .

The same conclusion follows.

Arjen Vreugdenhil - 3 years, 9 months ago

Log in to reply

Yep, f ( x ) = x sin ( π x ) x f(x)=|x \sin (\pi x)| \leq x for x > 0 x>0 and so its impossible that we actually cross any more integers in that interval, since that would require passing through n n while x < n x<n .

Brandon Monsen - 3 years, 9 months ago
Kevin Hickey
Sep 8, 2017

Relevant wiki: Trigonometric Functions Problem Solving

First notice that x sin ( π x ) x\sin(\pi x) is zero whenever s i n ( π x ) sin(\pi x) is zero. This occurs when x is an integer so 2018 times from 0 to 2017 inclusive.

Then notice that x sin ( π x ) x\sin(\pi x) is equal to x whenever s i n ( π x ) sin(\pi x) is equal to 1 or -1. This occurs between each zero so the graph of f ( x ) = x sin ( π x ) f(x)=x\sin(\pi x) must have two places with a height of -1 somewhere between x=1 and x=2. Then four integer intersections somewhere between x=2 and x=3. Then six integer intersections somewhere between x=3 and x=4. This pattern continues. To count the non-zero intersections we just need the sum: 2+4+6+8+...+4032. So, 2018+ n = 1 2016 2 n \sum_{n=1}^{2016}2n =4068290

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...