Advertisement

Factor calculator

Enter two non-zero integers with magnitudes at most one trillion. Factors are listed for each absolute value, followed by their common positive factors.

Calculator

Factors of first magnitude
1, 2, 3, 4, 6, 8, 12, 24
Factors of second magnitude
1, 2, 3, 4, 6, 9, 12, 18, 36
Common positive factors
1, 2, 3, 4, 6, 12
Factor pairs
24: 1 × 24; 2 × 12; 3 × 8; 4 × 6 | 36: 1 × 36; 2 × 18; 3 × 12; 4 × 9; 6 × 6

Advertisement

How this calculator works

A factor divides a number without remainder. Trial divisors up to the square root reveal both members of each factor pair. A perfect-square middle factor is included once. Negative inputs are treated by magnitude; the listed positive factors also describe the magnitudes of their negative factors.

Formula

If n mod d = 0, then d and n/d are factors. Check 1 <= d <= sqrt(n). Common factors belong to both factor lists.

Worked example

24 has positive factors 1, 2, 3, 4, 6, 8, 12, 24. The common factors of 24 and 36 are 1, 2, 3, 4, 6, 12.

Advertisement

Frequently asked questions

Why is zero rejected?

Every non-zero integer divides zero, so there is no finite complete factor list.

Is 1 prime?

No. It has one positive factor, while a prime has exactly two: 1 and itself.

Why is there an input limit?

Trial division grows with the square root of the magnitude. The limit bounds the work while keeping all arithmetic within exact safe integers.

Sources

Advertisement