Smith Number Calculator

Number

VerdictSmith number
Digit sum18
Prime-factor digit sum18
Prime factorization2 x 3^2 x 37
How this was calculated
  1. Digit sum: the digits of 666 add to 18.
  2. Factor 666 into prime factors: 666 = 2 x 3^2 x 37.
  3. Adding the digits of the prime factors (with multiplicity) gives 18.
  4. The two sums match (18 vs 18), so 666 is a Smith number.

This Smith number calculator checks whether a whole number is a Smith number. A Smith number is a composite number whose digit sum equals the sum of the digits of its prime factors, counted with multiplicity. Enter a number and the calculator factors it, adds the digits of the original number, adds the digits of each prime factor as many times as it appears, and tells you whether the two totals match. For example, 666 is the classic case: its digits sum to 18, and its factors 2 x 3^2 x 37 contribute 2 + 3 + 3 + 3 + 7 = 18. The smallest Smith number is 22, with digit sum 4 and factors 2 x 11 contributing 2 + 1 + 1 = 4. Not every composite qualifies: 120 has digit sum 3, but 2^3 x 3 x 5 contributes 14, so it is not a Smith number. Because the definition requires a composite number, the calculator requires at least 2 prime factors, so primes can never be reported as Smith numbers.

The method behind the calculator is the standard definition itself: full prime factorization with multiplicity, then a digit-sum comparison. That is the accepted basis for this kind of calculation, and it is exactly how the classic examples above are verified, so the result is not a shortcut or an approximation. On this page you will find the formula written out, step-by-step workings for each result, worked examples such as 666, 22 and 120, and the sources behind the definition. Use it to test a single number, check homework, or explore how Smith numbers are built from their prime factors.

Worked examples

The classic 666

(666)

VerdictSmith number
Digit sum18
Prime-factor digit sum18
Prime factorization2 x 3^2 x 37

Small Smith number 22

(22)

VerdictSmith number
Digit sum4
Prime-factor digit sum4
Prime factorization2 x 11

120 is not Smith

(120)

VerdictNot a Smith number
Digit sum3
Prime-factor digit sum14
Prime factorization2^3 x 3 x 5

The definition, carefully

A Smith number is a composite number whose digit sum equals the sum of the digits of its prime factors, counted with multiplicity. Every word in that sentence is doing work, so it is worth taking them one at a time. The number must be composite, the two sums must match exactly, and the factors must be broken down all the way to primes. A smith number calculator applies this test for you, but the definition is where the interesting cases live, and it is the part most people skim past.

Start with "with multiplicity." When a prime factor appears more than once, it counts every single time it appears. Take 666, the classic example. Its digits sum to 18. Its prime factorization is 2 x 3^2 x 37, which means the factor 3 shows up twice. So the factor side of the sum is 2 + 3 + 3 + 3 + 7, which is 18, and the two sides match. If you counted the factor 3 only once, the factor sum would come to 15 and 666 would fail the test. Multiplicity is not a technicality; it is what makes the definition work.

Next, the digits of a multi-digit prime factor are added individually. The factor 37 contributes 3 + 7, not 37. This trips people up because it is tempting to treat each prime factor as a single unit, but the rule is about digits on both sides of the equation. The same logic appears in the smallest Smith number, 22. Its digit sum is 4. Its factorization is 2 x 11, and the factor 11 contributes 2 + 1 + 1, which is 4. Notice that 11 is added digit by digit; writing it as eleven would give a factor sum of 13 and the example would collapse. The pattern holds for every factor, no matter how many digits it has.

The composite requirement is just as strict. Primes can never be Smith numbers, because the definition requires a composite number, and the calculator enforces this by requiring at least 2 prime factors. A prime has only one prime factor, itself, so it cannot satisfy the condition. That is also why the search for examples starts at 22 rather than at the first prime.

A negative example makes the rule concrete. 120 is not a Smith number. Its digits sum to 3, but its factorization is 2^3 x 3 x 5, and the factor digits sum to 2 + 2 + 2 + 3 + 5, which is 14. The two sides are far apart, so 120 is excluded. When you work through cases like these by hand, the definition stops being a sentence and becomes a procedure: sum the digits, factor completely, expand repeated factors, add the digits of each prime factor, and compare. The calculator does the same steps, in the same order, every time.

Two rules decide most borderline cases: repeated prime factors count every time they appear, and each multi-digit prime factor is split into its digits before adding. Miss either one and a correct Smith number can look wrong.

Working 666

The number 666 is the example most often used to explain what a Smith number is, and it is worth walking through step by step. The definition says a Smith number is a composite number whose digit sum equals the sum of the digits of its prime factors, counted with multiplicity. To test 666 with a smith number calculator, you need two separate sums: one from the digits of the number itself, and one from the digits of its prime factorization. The example works because both sums land on the same total, 18.

Start with the digits of 666. Adding them gives 6 + 6 + 6 = 18. That is the first half of the comparison. Now factor 666 into primes. The factorization is written as 2 x 3^2 x 37. Because the definition counts factors with multiplicity, the repeated 3 is written out each time it appears: 2, 3, 3, 37. Adding the digits of those factors gives 2 + 3 + 3 + 3 + 7 = 18. The two sums match, so 666 qualifies as a Smith number.

The table below lays out the two sums side by side so the match is easy to see.

Part of the testWhat is addedSum
Digits of 6666 + 6 + 618
Digits of the prime factors (2 x 3^2 x 37)2 + 3 + 3 + 3 + 718
Both sums reach 18: the digits of 666 add to 18, and the factors 2 x 3^2 x 37 contribute 2 + 3 + 3 + 3 + 7 = 18.

Near misses

Most numbers you type into a smith number calculator will not be Smith numbers, and the gap between the two sums is usually the reason. The definition sets a strict bar: a composite number qualifies only when its digit sum equals the sum of the digits of its prime factors, counted with multiplicity. When those two totals drift apart, the number is simply a near miss, and near misses are far more common than hits.

Take 120. Its digits add up to 1 + 2 + 0 = 3, a small total because the digits themselves are small. Now break it into prime factors: 2^3 x 3 x 5. Counting multiplicity means the factor 2 appears three times, so the factor-digit sum is 2 + 2 + 2 + 3 + 5 = 14. The digit sum is 3 and the factor sum is 14, a gap of 11. Nothing about 120 is close to equality; the two sides land in entirely different ranges. Running 120 through a smith number calculator returns a clear no, and the side-by-side totals show exactly why.

Contrast that with a genuine hit. The smallest Smith number is 22: its digits sum to 4, and its factors 2 x 11 contribute 2 + 1 + 1 = 4. The classic example is 666: the digits sum to 18, and the factors 2 x 3^2 x 37 contribute 2 + 3 + 3 + 3 + 7 = 18. In both cases the two sums meet exactly, which is what the definition demands.

Cases like 120 illustrate why Smith numbers are sparse. Digit sums grow slowly, roughly with the number of digits, while factor-digit sums depend on how many prime factors a number has and how large those factors are. For many composites the factor sum runs well ahead of the digit sum, as with 120, so the two totals rarely coincide. Equality is the exception rather than the rule, which is why scanning a range turns up relatively few Smith numbers.

One more boundary matters when you check results. Primes can never be Smith numbers, because the definition requires a composite number. The calculator enforces this by requiring at least 2 prime factors, so a prime input is rejected rather than scored as a match. A near miss like 120 and a prime both come back as non-Smith numbers, but for different reasons: 120 fails on the arithmetic, while a prime fails on eligibility.

120: digit sum 3, factor sum 14 (2^3 x 3 x 5 gives 2 + 2 + 2 + 3 + 5). A gap of 11 — a near miss, not a Smith number.

A named curiosity

The name is the most human detail about the whole idea. Albert Wilansky, a mathematician at Lehigh University, coined the term in 1982 after noticing something odd about his brother-in-law Harold Smith's telephone number. The number happened to satisfy the strange digit condition, and Wilansky named the class of numbers after the relative who supplied the example. It is a small, affectionate origin story for a concept that is otherwise pure arithmetic curiosity.

The condition itself is easy to state. A Smith number is a composite number whose digit sum equals the sum of the digits of its prime factors, counted with multiplicity. "Counted with multiplicity" means you write out repeated factors individually rather than collapsing them into exponents. The classic example is 666: its digits sum to 18, and its factorization 2 x 3^2 x 37 contributes 2 + 3 + 3 + 3 + 7 = 18. The smallest example is 22, whose digit sum is 4, matched by 2 x 11 contributing 2 + 1 + 1 = 4. Not every candidate passes: 120 has a digit sum of 3, but 2^3 x 3 x 5 contributes 14, so it is not a Smith number.

If you want to test a number yourself, a smith number calculator saves you the manual bookkeeping. The work is not hard, but it is easy to slip: you have to factor the number completely, keep every repeated prime separate, add the digits of each factor, then add the digits of the original number and compare the two totals. A single missed factor or a dropped repeated prime throws off the result. The calculator handles the factorization and the digit sums, so you can focus on the pattern rather than the arithmetic.

One rule deserves emphasis because it is easy to forget. Primes can never be Smith numbers, since the definition requires a composite number. A prime's only factor is itself, which would make the comparison trivial rather than interesting. The calculator enforces this by requiring at least two prime factors, which keeps the results meaningful.

These numbers remain a recreational staple rather than a research frontier. They show up in puzzle columns and number-theory hobby pages, appreciated for the pleasing coincidence they capture rather than for any deep role in mathematics. That is part of their charm: a condition simple enough to check by hand, named for a telephone number, and still fun to test on whatever number happens to be in front of you.

Remember: primes are excluded by definition. A Smith number must be composite, so the calculator requires at least two prime factors.

FAQs

Is 666 a Smith number?

Yes. 666 is the classic case. Its digits sum to 18. Its prime factorization is 2 x 3^2 x 37, and adding the digits of those factors gives 2 + 3 + 3 + 3 + 7 = 18. Because the digit sum of the number (18) equals the digit sum of its factors (18), 666 is a Smith number.

What is the smallest Smith number?

22 is the smallest Smith number. Its digits sum to 2 + 2 = 4. Its prime factors are 2 x 11, and adding the digits of those factors gives 2 + 1 + 1 = 4. Since the two sums match, 22 qualifies, and no smaller composite number satisfies the definition.

Is 120 a Smith number?

No. The digits of 120 sum to 1 + 2 + 0 = 3. Its prime factorization is 2^3 x 3 x 5, and adding the digits of those factors gives 2 + 2 + 2 + 3 + 5 = 14. Because 3 does not equal 14, 120 is not a Smith number.

Can a prime be a Smith number?

No. Smith numbers are composite by definition, so a prime can never be one. For a prime, the digit sum of its factors trivially equals its own digit sum, since the only factor is the number itself. That trivial match is exactly why the definition excludes primes.

What does 'with multiplicity' mean?

It means repeated prime factors are counted each time they appear. In a factorization like 2^3, the factor 2 contributes three separate times to the factor digit sum, giving 2 + 2 + 2 = 6. You do not collapse the repeated factor into a single entry.

How are multi-digit factors handled?

Multi-digit factors are handled digit by digit. The factor 37 contributes 3 + 7 = 10 to the factor digit sum rather than 37. That digit-by-digit treatment is what makes 666 balance at 18: 2 + 3 + 3 + 3 + 7 = 18, matching the digit sum of 666 itself.

Sources

Related calculators

Abundant Number Calculator
Classify any whole number as abundant, perfect or deficient from its aliquot sum: the sum of its proper divisors, the abundance or deficiency against the number itself, and the s(n)/n ratio that puts perfect numbers exactly at one.
Perfect Number Calculator
Classify a number as perfect, abundant or deficient by comparing it with the sum of its proper divisors (its aliquot sum).
Prime Factorization Calculator
Break any whole number up to a trillion into its prime factors — with divisor count, divisor sum and largest prime factor.