We define a number N
as peculiar if it is divisible by the integer part of its square root. Formally, N
is peculiar if:
\(N \bmod \lfloor \sqrt{N}\rfloor = 0\)
Given a range [L, R], implement a function to determine how many integers within this range (inclusive) are peculiar.
Examples
Example 1
Input: L=1, R=10
Output: 7
Explanation: The peculiar numbers between 1 and 10 are 1,2,3,4,6,8,9.
Exampl…
Keep reading with a 7-day free trial
Subscribe to Puzzle Spree to keep reading this post and get 7 days of free access to the full post archives.