cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A239619 Base 3 sum of digits of prime(n).

Original entry on oeis.org

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

Views

Author

Tom Edgar, Mar 22 2014

Keywords

Examples

			The fifth prime is 11, 11 in base 3 is (1,0,2) so a(5)=1+0+2=3.
		

Crossrefs

Programs

  • Magma
    [&+Intseq(NthPrime(n),3): n in [1..100]]; // Vincenzo Librandi, Mar 25 2014
    
  • Mathematica
    Table[Plus @@ IntegerDigits[Prime[n], 3], {n, 1, 100}] (* Vincenzo Librandi, Mar 25 2014 *)
  • PARI
    a(n) = vecsum(digits(prime(n), 3)); \\ Michel Marcus, Mar 07 2020
  • Sage
    [sum(i.digits(base=3)) for i in primes_first_n(200)]
    

Formula

a(n) = A053735(A000040(n)).