login
A239619
Base 3 sum of digits of prime(n).
7
2, 1, 3, 3, 3, 3, 5, 3, 5, 3, 3, 3, 5, 5, 5, 7, 5, 5, 5, 7, 5, 7, 3, 5, 5, 5, 5, 7, 3, 5, 5, 7, 5, 5, 7, 7, 7, 3, 5, 5, 7, 5, 5, 5, 7, 5, 7, 7, 7, 7, 9, 9, 9, 5, 5, 5, 7, 3, 5, 5, 5, 7, 5, 7, 7, 7, 5, 5, 7, 7, 5, 7, 7, 7, 5, 7, 7, 7, 9, 5, 7, 7, 9, 5, 7, 7, 9
OFFSET
1,1
LINKS
FORMULA
a(n) = A053735(A000040(n)).
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