The floor function turns up all over the AMC 10 and 12: in equations like x⌊x⌋=50, in long sums like ⌊1⌋+⌊2⌋+⋯+⌊100⌋, and in counting how many different values an expression takes. The tools are few: split x into integer and fractional parts, group terms where the floor is constant, and pair terms that add up nicely.
Integer and fractional parts
Definition
Floor and fractional part
⌊x⌋ is the greatest integer less than or equal to x. The fractional part is {x}=x−⌊x⌋, so 0≤{x}<1 and x=⌊x⌋+{x}.
Watch negatives: ⌊−2.3⌋=−3, not −2. The single most useful restatement is
⌊x⌋=n⟺n≤x<n+1(n an integer).
To solve an equation with a floor, name the floor: set n=⌊x⌋, solve for x in terms of n, and then impose n≤x<n+1 to find which n are allowed.
A few facts you'll use constantly:
⌊x+m⌋=⌊x⌋+m for any integer m.
⌊dn⌋ is the number of multiples of d from 1 to n (you used this in Legendre's formula).
⌊x⌋+⌊y⌋≤⌊x+y⌋≤⌊x⌋+⌊y⌋+1.
Sums of floors
Group by value. In ∑⌊k⌋, the value is m for every k from m2 to (m+1)2−1, which is 2m+1 values of k. So instead of adding 100 terms, you add about 10 blocks.
Pair up. If gcd(a,n)=1 and 1≤k≤n−1, then nak is never an integer, and
⌊nak⌋+⌊na(n−k)⌋=a−1,
because the two fractions add up to exactly a and neither is an integer. Pairing k with n−k gives the following.
Two floor-sum tools
Grouping:⌊f(k)⌋ is constant on blocks of k; count the size of each block and multiply.
Pairing: if gcd(a,n)=1, then k=1∑n−1⌊nak⌋=2(a−1)(n−1).
Counting distinct values
How many different values does ⌊Nk2⌋ take? While consecutive values of Nk2 differ by less than 1 (that is, 2k+1<N), the floor can't skip any integer, so every integer in the range appears. Once they differ by at least 1, every new k gives a new value. Split the range at that point and count each part.
Worked example: An equation with a floor
Find the positive real number x with x⌊x⌋=27.
If 0<x<1 the product is 0, so x≥1. Let n=⌊x⌋≥1. Then x=n27, and you need n≤n27<n+1, that is n2≤27<n2+n. Only n=5 works: 25≤27<30. So x=527=5.4. Check: 5.4⋅5=27.
Worked example: Grouping
Find ⌊1⌋+⌊2⌋+⋯+⌊100⌋.
For m=1,…,9, the value m appears 2m+1 times, and ⌊100⌋=10 appears once. So the sum is
∑m=19m(2m+1)+10=2⋅285+45+10=625,
using 12+⋯+92=285 and 1+⋯+9=45.
Worked example: Pairing
Find k=1∑30⌊317k⌋.
gcd(7,31)=1, so pairing k with 31−k gives 15 pairs, each adding to 7−1=6. The sum is 15⋅6=90, matching 2(7−1)(31−1)=90.
Worked example: Counting distinct values
How many distinct numbers are in the list ⌊10012⌋,⌊10022⌋,…,⌊1001002⌋?
Consecutive terms of 100k2 differ by 1002k+1, which is less than 1 for k≤49. So from k=1 to k=50 the floors climb from 0 to 25 without skipping: 26 values. From k=50 on the gaps are at least 1.01, so k=51,…,100 each give a new, larger value: 50 more. The total is 76.
Common mistake
Two classic traps. First, ⌊−x⌋=−⌊x⌋ unless x is an integer: ⌊−5.4⌋=−6. Second, after naming n=⌊x⌋ and solving, you must check n≤x<n+1. Most candidate values of n fail that check.
Practice
Practice 1
What is ⌊2026⌋+⌊32026⌋?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
Practice 2
What is the positive real number x with x⌊x⌋=50?
Practice 3
For how many positive integers n≤100 is ⌊2n⌋+⌊3n⌋+⌊6n⌋=n?
Practice 4
Find k=1∑100⌊3k⌋.
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
Practice 5
What is k=1∑40⌊4113k⌋?
Practice 6
For how many positive integers n≤100 is ⌊n⌋ a divisor of n?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
Practice 7
How many distinct numbers are in the list
⌊20012⌋,⌊20022⌋,⌊20032⌋,…,⌊2002002⌋?
Practice 8
Find k=1∑1000⌊log2k⌋.
Enter a number. Fractions like 3/4 and sqrt(2) are OK.