Project Nayuki


Calculate divisors (JavaScript)

Program

Divisors:

Description

This JavaScript program lists all the divisors of the given integer. The number must be between 1 and 253.

If the number is very large, the program may hang for a few seconds. This is because the worst-case running time for the number n is O(√n).

The source code is available for viewing.

Examples

More info