27 lines
1.3 KiB
Text
27 lines
1.3 KiB
Text
[[wp:Smith numbers|Smith numbers]] are numbers such that the [[Sum_digits_of_an_integer|sum of the decimal digits of the integers]] that make up that number is the same as the sum of the decimal digits of its prime factors excluding 1.
|
|
|
|
By definition, all primes are ''excluded'' as they (naturally) satisfy this condition!
|
|
|
|
Smith numbers are also known as ''joke'' numbers.
|
|
|
|
|
|
;Example
|
|
Using the number '''166'''<br>
|
|
Find the prime factors of '''166''' which are: '''2''' x '''83'''<br>
|
|
Then, take those two prime factors and sum all their decimal digits: '''2 + 8 + 3''' which is '''13'''<br>
|
|
Then, take the decimal digits of '''166''' and add their decimal digits: '''1 + 6 + 6''' which is '''13'''<br>
|
|
Therefore, the number '''166''' is a Smith number.
|
|
|
|
|
|
;Task
|
|
Write a program to find all Smith numbers ''below'' 10000.
|
|
|
|
|
|
;See also
|
|
* from Wikipedia: [[https://en.wikipedia.org/wiki/Smith_number Smith number]].
|
|
* from MathWorld: [[http://mathworld.wolfram.com/SmithNumber.html Smith number]].
|
|
* from OEIS A6753: [[https://oeis.org/A006753 OEIS sequence A6753]].
|
|
* from OEIS A104170: [[https://oeis.org/A104170 Number of Smith numbers below 10^n]].
|
|
* from The Prime pages: [[http://primes.utm.edu/glossary/xpage/SmithNumber.html Smith numbers]].
|
|
<br><br>
|
|
|