OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..10000
EXAMPLE
The fifth prime is 11, 11 in base 3 is (1,0,2) so a(5)=1+0+2=3.
MATHEMATICA
Table[Plus @@ IntegerDigits[Prime[n], 3], {n, 1, 100}] (* Vincenzo Librandi, Mar 25 2014 *)
PROG
(Sage) [sum(i.digits(base=3)) for i in primes_first_n(200)]
(Magma) [&+Intseq(NthPrime(n), 3): n in [1..100]]; // Vincenzo Librandi, Mar 25 2014
(PARI) a(n) = vecsum(digits(prime(n), 3)); \\ Michel Marcus, Mar 07 2020
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Tom Edgar, Mar 22 2014
STATUS
approved