Aliquot Sequence Calculator

Aliquot sequences, cycles and divisor sums.

  • Cycles named
  • Divisor sums exact
  • Classes to a million
Rings of soft clay beads joined in loops of different lengths on a small rounded clay table in daylight, one loop closed beside a single straight link.

The guide

Add up what divides you: where aliquot sequences end, and where nobody knows

An aliquot sequence replaces a number by the sum of its proper divisors, again and again. Some end at 0, some lock into a loop, and a few have defeated every attempt to follow them.

  • 220, 284 the smallest amicable pair
  • 178 steps from 138 down to 0
  • 180 billion the peak of the sequence from 138 (about)
  • 28 length of the cycle through 14316
  • 276 the first start whose fate is unknown
Read the full guide Fold the guide 8 min · 12 sources

Take 10. The numbers below it that divide it are 1, 2 and 5, and they add up to 8. Do the same to 8 and you get 7. Do it to 7 and you get 1, and 1 has nothing below it to add, so the next number is 0. The Wikipedia article on aliquot sequences writes that run as 10, 8, 7, 1, 0, and it is the shortest honest picture of what this page does.

Not every start is so tame. The sequence that begins at 6 never moves. The one that begins at 220 swings between two numbers for ever. The one that begins at 138 climbs to about 180 billion before it comes back down to 0 after 178 steps. And the one that begins at 276 has been followed so far that nobody can say how it ends. One rule, applied again and again, produces all of it.

One rule, applied again and again

An aliquot sequence starts with a positive whole number and replaces each term by the sum of its proper divisors, meaning the divisors smaller than the number itself. The article writes that sum as s(n), which equals the sum of all the divisors, called sigma of n, minus n. OEIS entry A001065 lists the same thing as the sum of the divisors of n that are less than n. Two details trip people up. The number 1 divides everything above it, so it always counts. The number itself never counts, so s(1) is 0.

Both slips are easy to make by hand. Add the number to its own sum and s(6) comes out as 12 instead of 6, so no perfect number ever appears. Leave out the 1 and s(7) comes out as 0 instead of 1, so a prime seems to vanish without passing through 1. The tool lists the working for any term you pick, so either mistake is visible on the screen.

Nobody finds the divisors of a large number by trying every candidate below it. The article on the divisor function describes sigma as multiplicative. For a number written as a product of prime powers, sigma is the product of the sigma of each power. The sigma of p to the power e is 1 + p + p squared, and so on up to p to the power e.

That turns the task into factoring. Once the prime powers are known, the sum falls out of a short product.

Here is a worked example you can reproduce. The number 220 is 2 squared times 5 times 11. The three factors give 1 + 2 + 4 = 7, 1 + 5 = 6 and 1 + 11 = 12, and 7 times 6 times 12 is 504. Take away 220 and s(220) is 284. Now factor 284, which is 2 squared times 71: 7 times 72 is again 504, and 504 minus 284 is 220. The two numbers send each other back.

The article on amicable numbers does the same sums by listing divisors. For 220 they are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110, which add up to 284. For 284 they are 1, 2, 4, 71 and 142, which add up to 220. The product formula and the plain list agree, and the tool runs both on every term it shows.

Comparing s(n) with n sorts every number into one of three classes. If s(n) is above n the number is abundant, if it is below n the number is deficient, and if the two are equal the number is perfect. The Abundant number article gives 12 as the first abundant number, because 1 + 2 + 3 + 4 + 6 is 16. Among the numbers 1 to 100 this page counts 22 abundant, 76 deficient and 2 perfect. The article’s list of abundant numbers below 100 has 21 entries, and 100 itself is the 22nd, since its proper divisors add up to 117.

Four ways for a sequence to end

Most sequences end at 0. The article says every such sequence must finish with a prime, then 1, then 0: a prime has exactly one proper divisor, which is 1, and 1 has none. The starts that reach 1 include every number from 1 to 5. The first start that does not is 6, and the article’s list of starts that never reach 1 continues 25, 28, 95, 119, 143 and 220.

A perfect number equals the sum of its proper divisors, so its sequence is 6, 6, 6, with period 1. Six is 1 + 2 + 3 and 28 is 1 + 2 + 4 + 7 + 14. The Perfect number article lists the first seven as 6, 28, 496, 8128, 33550336, 8589869056 and 137438691328. Euclid showed that when 2 to the p minus 1 is prime, 2 to the p minus 1 times that prime is perfect, and Euler proved much later that every even perfect number has this form. Nobody knows whether an odd perfect number exists.

A sequence does not have to start on its loop. The sequence of 95 goes 95, 25, 6, 6, so it falls onto 6 after two steps although 95 is not perfect. The article calls numbers like 95 aspiring numbers. This page says it in plain words instead: it names the cycle it reached and how many steps led into it.

Two different numbers are amicable when each is the sum of the proper divisors of the other, and (220, 284) is the smallest pair. The article gives the first ten pairs, ending with (63020, 76084) and (66928, 66992). It also says it is unknown whether infinitely many pairs exist. Thabit ibn Qurra devised a rule for producing some pairs around the year 850. The second pair, (1184, 1210), was found only in 1867 by a sixteen-year-old, B. Nicolo I. Paganini, having been overlooked by earlier mathematicians.

Longer loops are called sociable. The first two sociable chains were found and named by Paul Poulet in 1918. The chain through 12496 has five members: 12496, 14288, 15472, 14536 and 14264, and then back to 12496. The article gives a cycle of four through 1264460 and a cycle of 28 through 14316. Those two chains, the 5 and the 28, are the only sociable ones below one million. No cycle of length 3 is known.

The sequences that refuse to settle

Whether every sequence must end in one of those four ways is a conjecture credited to Catalan and Dickson. The alternative, the article notes, would be a start whose sequence is infinite yet never repeats. Guy and Selfridge believed the conjecture to be false and conjectured that some sequences grow without bound. So the question is not settled, and it is not even clear which way an honest bet should go.

Some sequences wander very far before they settle. The sequence of 138 begins 138, 150, 222, 234, 312, 528, 960 and 2088, keeps climbing and falling, and peaks at 179,931,895,322, a figure the article gives, before returning to 1. This page counts 178 steps from 138 to 0, with the last three terms 59, 1 and 0. Press the 138 example to see the whole run laid out on a log scale, where a climb to billions and a fall to single digits both fit on one chart.

The smallest start whose fate is unknown is 276. The article names the first five candidates after D. H. Lehmer: 276, 552, 564, 660 and 966. OEIS entry A131884 lists numbers conjectured to have an infinite, aperiodic sequence, beginning 276, 306, 396, 552, 564, 660, 696, 780, 828, 888, 966 and 996. The word conjectured matters: nobody has proved that any of these runs for ever.

This page follows 276 through 396, 696, 1104, 1872 and 3770 and carries on. At step 74 the sequence reaches 100,509,779,504,316, which is above the page’s value cap of 10 to the 14th power, so the page stops and says so. That is a statement about the cap and not about 276. The tool cannot tell you how the sequence of 276 ends, and neither can anything else at present.

That is the whole difficulty. A sequence still climbing at step 74 looks exactly like one that is about to fall.

What the numbers on the page can be trusted for

Every term is held as an ordinary JavaScript number. The MDN page on BigInt gives 9007199254740991 as the largest safe integer, and the divisor sum of any number up to 10 to the 14th power stays far below it, so every sum is exact. The self-check also recomputes a thousand large numbers in BigInt, multiplies the prime powers back together and tests each prime separately.

Factoring is trial division by the primes up to 10 million. A remainder below 10 to the 14th power that has no prime factor up to 10 million must itself be prime, because the next prime after 10 million is 10,000,019 and its square is already above 10 to the 14th power. That argument is why the page can factor every number up to its cap completely, with no probabilistic shortcut.

The factoring runs in a Web Worker. The MDN article on the Web Workers API describes this as a script operation in a background thread, separate from the main thread of the page, which is why the page stays responsive while it sieves the primes and follows a long sequence. A cancel button stops the worker and leaves the last finished answer on screen.

The classes panel sorts every number up to a limit you choose, to a ceiling of 1,000,000. Up to that ceiling there are 247,545 abundant numbers, 752,451 deficient numbers and 4 perfect numbers, which are 6, 28, 496 and 8128. The first 23 amicable pairs the panel finds match the data in OEIS entry A259180, from (220, 284) to (280540, 365084).

What the page cannot do is just as plain. It cannot settle an open case such as 276, it cannot factor a number above 10 to the 14th power, and it does not search for new cycles. When a sequence reaches a cap, the verdict says that the fate is not decided here, which is a different statement from saying it never ends.

Sources

Every source consulted for this guide. Links checked November 10, 2026.

  1. Aliquot sequence - Wikipedia Wikipedia (CC BY-SA 4.0)
  2. Amicable numbers - Wikipedia Wikipedia (CC BY-SA 4.0)
  3. Perfect number - Wikipedia Wikipedia (CC BY-SA 4.0)
  4. Sociable number - Wikipedia Wikipedia (CC BY-SA 4.0)
  5. Abundant number - Wikipedia Wikipedia (CC BY-SA 4.0)
  6. Divisor function - Wikipedia Wikipedia (CC BY-SA 4.0)
  7. A001065 - OEIS The On-Line Encyclopedia of Integer Sequences (CC BY-SA 4.0)
  8. A000396 - OEIS The On-Line Encyclopedia of Integer Sequences (CC BY-SA 4.0)
  9. A259180 - OEIS The On-Line Encyclopedia of Integer Sequences (CC BY-SA 4.0)
  10. A131884 - OEIS The On-Line Encyclopedia of Integer Sequences (CC BY-SA 4.0)
  11. BigInt - JavaScript | MDN MDN Web Docs (CC BY-SA 2.5 or later)
  12. Web Workers API - Web APIs | MDN MDN Web Docs (CC BY-SA 2.5 or later)