Question: A Smith number is a nonprime integer such that the sum of its digits is the sum of the digits in its prime factorization. For

A Smith number is a nonprime integer such that the sum of its digits is the sum of the digits in its prime

factorization. For example,

58 is a Smith number because 58 = 2 * 29 and 5 + 8 = 2 + 2 + 9

See https://en.wikipedia.org/wiki/Smith_number

See also https://oeis.org/A006753

Write a C program that inputs a sequence of integers terminated by 0. For each positive nonprime N

the program reports whether N is a Smith number.

Example program run (updated 1/26 to show treatment of negative and prime inputs)

N: 8

N: 17

N: 4

Yes

N: 10

No

N: 727

No

N: 728

Yes

N: 729

Yes

N: 777

No

N: 4937775

Yes

N: 121

Yes

N: 100

No

N: 1000

No

N: 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!