Divisor List
This JavaScript program lists all the divisors of the given integer.
The program
Instructions
In the input text field, enter the number whose divisors will be listed, then click the List divisors
button. The number must be between 2 and 9 007 199 254 740 992 (253), inclusive.
Examples:
- 18: 1, 2, 3, 6, 9, 18
- 43: 1, 43 (prime)
- 1681: 1, 41, 1681 (perfect square)
Warning: If the number is large, the program will hang. This is because the running time is proportional to the square root of the input number (O(√n)). Although most browsers allow the user to stop scripts that run for excessively long, you should not assume this; be prepared to forcibly terminate the browser program.
Links
Last modified: 2008-04-16-Wed
Created: 2007-08-16-Thu