All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Just Math
Distinct Values of an Expression Involving Floor Function (Posted on 2023-06-06) Difficulty: 3 of 5
Find the number of distinct values of this expression:
⌊N/4⌋ - ⌊N/7⌋ - ⌊N/14⌋ - ⌊N/28⌋

Notes:
1) ⌊x⌋ is the floor of x, which is the greatest integer less than or equal to x.
2) Adapted from a problem appearing in Singapore Mathematical Olympiad, Junior 2022.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution and reasoning Comment 1 of 1
Let Q = Floor( N/28 ). Then we can write N = 28Q + A, where 0 <= A < 28. 

Define F = Floor( N/4) - Floor( N/7) - Floor( N/14 ) - Floor( N/28). Then 
F = ( 7Q + Floor( A/4) ) - (4Q + Floor( A/7) )- (2Q + Floor( A/14) ) - (Q + Floor( A/28) ) 
  = Floor( A/4) - Floor( A/7) - Floor( A/14) - Floor( A/28)

So F can take on at most 28 values, corresponding to A taking on integer values between 0 and 27.
As A increases, F can change values only when we reach a multiple of 4, 7 or 14. 
We see that 

When A = 0, 1, 2, or 3, F is given by 0
When A = 4, 5, or 6, F is given by 1
When A = 7, F is given by 0
When A = 8, 9, 10, or 11, F is given by 1
When A = 12 or 13, F is given by 2
When A is 14 or 15, F is given by 0
When A is 16, 17, 18 or 19, F is given by 1
When A is 20, F is given by 2
When A is 21, 22 or 23, F is given by 1
When A is 24, 25, 26, or 27, F is given by 2

Hence, the only values F can take on are 0, 1 and 2, that is, three possible values

Edited on June 6, 2023, 4:57 pm
  Posted by FrankM on 2023-06-06 16:53:10

Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (8)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information