Submit | All submissions | Best solutions | Back to list |
ABNDNTNM - Abundant numbers |
An abundant number has factors that sum to more than itself; thus 12 is abundant as 1 + 2 + 3 + 4 + 6 = 16 > 12; so is 42 as 1 + 2 + 3 + 6 + 7 + 14 + 21 = 54 > 42.
Actually, this is an unusual property; write a program that given integers M and N computes the number of abundant numbers between M and N inclusive.
Input
One line of input featuring two integers M and N. M < N < 231.
Output
A single integer on its own line, representing the count of abundant numbers between M and N.
Example
Input: 204 1007 Output: 201
Added by: | handee |
Date: | 2020-06-13 |
Time limit: | 1s-3s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |