Challenge :
Given two non-negative integers (X and Y > 1)
calculate the sum of digits of their powers . i.e : sum of digits of X ^ Y
.
Input :
Two non-negative integers X
and Y
Output :
The sum of digits of X raised to power Y X ^ Y
.
Examples :
5 , 2 ---> 7
9 , 4 ---> 18
3 , 17 ---> 27
Both numbers will be greater than 1
Restrictions :
This is code-golf so shortest code (in bytes) for each language wins.
Notes :
All input will be valid. i.e : Both inputs will be greater than 1 and will be integers.
1
since in baseX>1
,X
is10
, soX^Y
is 1 followed byY
zeros. that's always the sum of the digits, and the question didn't specify what base must be used. \$\endgroup\$