Let where is an integer, and is the largest nonnegative integer such that is divisible by . Find the number of distinct values of where .
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 0 1 7 − ⌊ 3 2 0 1 7 ⌋ ⇒ 1 3 4 5
Doing the problem per the definition directly:
Length [ Union [ Table [ ( n → 3 IntegerExponent [ n , 3 ] n ) ( n ) , { n , 2 0 1 7 } ] ] ] ⇒ 1 3 4 5
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 → 3 IntegerExponent [ n , 3 ] n ) to the integers ( n ) from 1 to 2017 in turn gives 1 3 4 5 . The function evaluation IntegerExponent [ n , 3 ] returns the number of factors of 3 in 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 , 2 0 1 7 } ] ] ⇒ ⎝ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎛ 0 1 2 3 4 5 6 1 3 4 5 4 4 8 1 5 0 5 0 1 6 6 2 ⎠ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎞