Let , where denotes the greatest integer less than or equal to . How many distinct values does assume for ?
- A)
- B)
- C)
- D)
- E)
Answer
A
Key insight
Each term depends only on the part of x after the decimal point. As it grows, f steps up once at each fraction with bottom at most 10.
Solution
Step 1: only the part after the decimal point matters.
1. Split into its whole part and its leftover part , where . For example, gives and .
2. Then , and is a whole number. So .
3. Each term becomes .
4. So
which depends only on . We only need to study from up to (not including) .
Step 2: watch as grows.
- At every term is , so .
- As increases, never goes down. It goes up by each time reaches a whole number, that is, at .
- So climbs in steps. It goes up at every fraction between and whose bottom number is at most , and it stays flat between them. Each step is a real increase, so every flat stretch has a new, larger value.
- The number of different values is (the starting value ) plus the number of different step points.
Step 3: count the step points. Several fractions name the same point (), so count each point once, by writing it in lowest terms and sorting by its bottom number:
| bottom number | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| fractions in lowest terms | |||||||||
| how many |
That is step points.
So takes different values.
The answer is .
Why this works
The expression is built to cancel the whole-number part of , so a problem about all becomes a problem about . A total that only ever steps up has one more value than it has step points. The real work is not counting the same point twice, which is why each fraction is written in lowest terms. (The numbers in the last row are often written : how many numbers from to share no common factor with .)
The trap
Counting all 45 fractions j/k as separate steps. Equal fractions such as 1/2, 2/4 and 3/6 are the same point, so they give only one step.
Concise solution
Write with and . Then with an integer, so and each term is
Thus depends only on the fractional part, and we may take .
Each is a nondecreasing step function of that jumps by exactly when passes an integer, i.e. at for . So is nondecreasing, starts at , and increases exactly when crosses a fraction in whose reduced denominator is at most . Every crossing strictly raises , so takes one value on each interval between consecutive jump points, and different intervals give different values.
The number of distinct values is therefore plus the number of distinct fractions in with denominator at most . Counting reduced fractions by denominator with Euler's :
So takes distinct values.
The answer is .
Review in the AoPS books
- Introduction to Number Theory, Chapter 1: Integers: The Basics
- Introduction to Algebra, Chapter 16: Functions
- Introduction to Number Theory, Chapter 11: Decimals and Fractions
- Intermediate Algebra, Chapter 20: Some Advanced Strategies (§20.2)
Techniques
Map the objects to something easier to count · Substitute to simplify (u = x+1/x, shifting, scaling)