login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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