6 kyu
Math challenge #3 [Medium]
70 of 83goldenratio161
Description:
Let
where denotes the greatest integer smaller than or equal to x (floor function),
and denotes the smallest integer greater than or equal to x. (ceiling function)
Examples:
⌊6.7⌋ = 6
⌈4.3⌉ = 5
Task
Given a positive integer n, return the value of f(n)
mod 1000000007
.
1 <= n <= 10^5
Credit: I saw this interesting question on a Prime Newtons video.
His channel is here: https://www.youtube.com/@PrimeNewtons
Also, please check out the rest of the katas in this series! https://www.codewars.com/collections/math-challenges-1
appreciate any feedback given, thank you!
Mathematics
Similar Kata:
Stats:
Created | Oct 23, 2024 |
Published | Oct 23, 2024 |
Warriors Trained | 256 |
Total Skips | 4 |
Total Code Submissions | 393 |
Total Times Completed | 83 |
Python Completions | 70 |
JavaScript Completions | 21 |
Total Stars | 2 |
% of votes with a positive feedback rating | 82% of 19 |
Total "Very Satisfied" Votes | 14 |
Total "Somewhat Satisfied" Votes | 3 |
Total "Not Satisfied" Votes | 2 |
Total Rank Assessments | 11 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |