Smith Number Calculator

Check whether a composite number's digit sum equals the digit sum of its prime factors with multiplicity.

Math and PercentUpdated 2026-11-182 min read
Smith Number Calculator
A whole number from 2 to 1,000,000.
Digit sum of n
...
Digit sum of prime factors...
Classification...

What it does

A Smith number is a composite integer whose digit sum equals the sum of the digits of its prime factors, counting repeated factors each time. The idea was named after Albert Wilansky, who noticed the property in his brother in law's telephone number.

The name joke number is sometimes used as well. Every prime trivially has equal digit sums, so the definition excludes primes and requires the number to be composite to make the property meaningful.

The test factors n, adds the digits of each prime factor as many times as its exponent, and compares the total with the digit sum of n itself. This page performs both sums and prints them side by side so the comparison is easy to verify.

For 22 the digits add to four, and the prime factors 2 and 11 have digits adding to two plus one plus one, also four. The number 23 has matching sums too, but it is prime, so it is not a Smith number.

The input limit is one million, which keeps factoring immediate in a browser. Results are exact and the tool reports a clear error outside the range.

How to use

  1. Enter a whole number n from 2 to 1,000,000.
  2. Read the classification in the main result box.
  3. Check the digit sum of your number beside it.
  4. Compare with the digit sum of the prime factors.
  5. The default n = 22 reproduces the worked example.
  6. Try n = 23 to see a prime that is excluded despite matching sums.

Formula

S(n) = sum of digits of n; F(n) = sum of digits of each prime factor, repeated by exponent; n is Smith when n is composite and S(n) = F(n)
n
The composite integer being tested.
S(n)
The sum of the decimal digits of n.
F(n)
The summed digits of the prime factors with multiplicity.

Multiplicity matters because 4 has factors 2 and 2, so its factor digit sum is two plus two. Primes are excluded by definition even though their two sums would coincide. All digit sums use base ten.

Worked example

Example: n = 22

The page opens with n = 22.

  1. Add the digits of 22: 2 + 2 = 4.
  2. Factor 22 as 2 x 11.
  3. Add the digits of the factors: 2 for the prime 2 and 1 + 1 for 11, total 4.
  4. The two sums match and 22 is composite.
  5. The tool reports digit sum 4, factor digit sum 4, and Smith number.
  6. For 23 the sums also match, but 23 is prime, so the verdict is Not a Smith number.

Reference table

Small Smith numbers
nDigit sumFactor digit sumSmith
442 + 2 = 4Yes
2242 + 1 + 1 = 4Yes
2355No, prime
2793 + 3 + 3 = 9Yes
58132 + 2 + 9 = 13Yes

Limits

  • Only composite integers from 2 to 1,000,000 are accepted.
  • Prime inputs are rejected by definition even when sums match.
  • Base ten digit sums are used throughout.
  • The tool does not search for nearby Smith numbers.

Common mistakes

  • Counting a prime as a Smith number because the sums match.
  • Ignoring multiplicity in the prime factorization.
  • Using the digital root rather than the full digit sum.
  • Adding the prime factors themselves instead of their digits.
  • Assuming every composite number with an even digit sum qualifies.

Try it yourself

Quick checks. Answers sit tucked under each question.

Is 22 a Smith number?

Yes. Both digit sums are 4 and 22 is composite.

Is 23 a Smith number?

No. The sums match but 23 is prime.

Is 27 a Smith number?

Yes. 2 + 7 = 9 and 3 + 3 + 3 = 9.

Questions

Why are primes excluded?

Otherwise every prime would qualify trivially, since its only factor is itself.

How is the name pronounced?

It is pronounced like the surname Smith.

What does multiplicity mean here?

A repeated prime factor is included once for each copy in the factorization.

Does the base matter?

Yes, and this page uses base ten.

Are values exact?

Yes. Factorization and digit sums use integers only.

What input range is accepted?

Composite integers from 2 through 1,000,000.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.