Smith number program in Java | ICSE and ISC

Опубликовано: 09 Ноябрь 2024
на канале: Knowledge Circle
3,138
202

Smith Number
A Smith number is a composite number whose sum of digits equals to the sum of digits of its prime factors, excluding 1. It is also known as a joke number.
Smith Number Example
Example 1: Suppose, we want to check the number 85 is smith or not.
Sum of digits = 8 + 5 = 13
Prime factors of 85 is: 5,17
Sum of digits of its prime factors = 5 + 1+ 7 = 13
Compare the sum of digits with the sum of digits of its prime factors i.e. 13=13. Both are equal. Hence, the given number (85) is a smith number.
#smithnumberinjava
#jokenumberinjava
#javaprogramming
#icsecomputerapplication
#isccomputerscience