1
$\begingroup$

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$

$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – Ross Millikan Nov 17 '14 at 6:01
  • $\begingroup$ I don't want to do bruteforce here. $\endgroup$ – Boston Nov 17 '14 at 6:20
1
$\begingroup$

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.