Will 3 r 3^r divides n n ?

Let f ( n ) = n 3 r f(n)=\dfrac{n}{3^r} where n n is an integer, and r r is the largest nonnegative integer such that n n is divisible by 3 r 3^r . Find the number of distinct values of f ( n ) f(n) where 1 n 2017 1≤n≤2017 .

1347 1346 1345 1344

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.

2 solutions

2017 2017 3 1345 2017-\left\lfloor \frac{2017}{3}\right\rfloor\Rightarrow 1345

Doing the problem per the definition directly:

Length [ Union [ Table [ ( n n 3 IntegerExponent [ n , 3 ] ) ( n ) , { n , 2017 } ] ] ] 1345 \text{Length}\left[\text{Union}\left[\text{Table}\left[\left(n\to \frac{n}{3^{\text{IntegerExponent}[n,3]}}\right)(n),\{n,2017\}\right]\right]\right] \Rightarrow 1345

Reading the Wolfram Mathematica expression into English: the size of the set (Length) reduced from the list (Union) that results from applying the function ( n n 3 IntegerExponent [ n , 3 ] ) \left(n\to \frac{n}{3^{\text{IntegerExponent}[n,3]}}\right) to the integers ( n n ) from 1 to 2017 in turn gives 1345 1345 . The function evaluation IntegerExponent [ n , 3 ] \text{IntegerExponent}[n,3] returns the number of factors of 3 in n n .

This problem is equivalent to asking how many integers between 1 and 2017, inclusive, do not contain a factor of 3, as the residual after removing the factors of 3 is still a positive integer and will be included in that manner:

Tally [ Table [ IntegerExponent [ n , 3 ] , { n , 2017 } ] ] ( 0 1345 1 448 2 150 3 50 4 16 5 6 6 2 ) \text{Tally}[\text{Table}[\text{IntegerExponent}[n,3],\{n,2017\}]]\Rightarrow \left( \begin{array}{cc} 0 & 1345 \\ 1 & 448 \\ 2 & 150 \\ 3 & 50 \\ 4 & 16 \\ 5 & 6 \\ 6 & 2 \\ \end{array} \right)

The number is 2017- the number of multiples of 3, which is 672. So the number is 2017-672=1345

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...