#C12134. Prime Digit Sum
Prime Digit Sum
Prime Digit Sum
Given a list of integers, your task is to filter out the prime numbers and compute the sum of the digits for each prime number. A prime number is defined as an integer \( n \) greater than 1 that has no positive divisors other than 1 and \( n \) itself. In formal terms, a number is prime if it satisfies:
\( n > 1 \) and for every integer \( i \) such that \( 2 \leq i \leq \sqrt{n} \), \( n \) is not divisible by \( i \).
For each prime number found in the input list, compute the digit sum (i.e. the sum of all its digits) and output the result in ascending order of the prime numbers. If no prime numbers are found, output nothing.
inputFormat
The input is provided in a single line containing a space-separated list of integers. The line may be empty.
outputFormat
For each prime number identified in the input, output a line in the format prime: digit_sum
in ascending order of the prime numbers. If there are no prime numbers, output nothing.
2 3 5 7 11 13 17
2: 2
3: 3
5: 5
7: 7
11: 2
13: 4
17: 8
</p>