OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = ds_prime(n)(n^n), where ds_prime(n) = digital sum base the n-th prime.
a(n) = n^n - (prime(n)-1)*Sum{k>0} ( floor(n^n/prime(n)^k) ).
EXAMPLE
a(2) = ds_prime(2)(2^2) = ds_3(4) = 1+1 = 2;
a(10) = ds_prime(5)(5^5) = ds_11(3125) = 2+3+9+1 = 15.
MATHEMATICA
Table[Total[IntegerDigits[n^n, Prime[n]]], {n, 50}] (* G. C. Greubel, Sep 23 2016 *)
PROG
(PARI) a(n) = vecsum(digits(n^n, prime(n))); \\ Michel Marcus, Sep 24 2016
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Hieronymus Fischer, Dec 24 2007
STATUS
approved