# How to find the sum of digits of $p^q$ when $p$ and $q$ are large integers?

Is there any formula to get direct value for this function.

$F(p,q)$ = sum of digits in $p^q$

I know that i can compute $p^q$ and sum up the digits. But I want to find it when $p$ and $q$ are big numbers. So is there any number theory formula for this?

Edit: $1<=p<=9$ , $q<3000$

• With your edit, it looks like a programming challenge. 9^3000 has only 2863 decimal digits, so it looks like the challenge is to implement a big number operation to make $p^q$ and add the digits. The ranges seem chosen to make it accessible to brute force if you do the big number thing. – Ross Millikan Nov 17 '14 at 6:01
• I don't want to do bruteforce here. – Boston Nov 17 '14 at 6:20

## 1 Answer

Not that I know of, and why do you think there should be? Sum of digits is dependent on the base. If there are divisibility relations between $p$ and $q$, maybe.

• no there is no such relation. – Boston Nov 17 '14 at 5:43