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.

A073781 Number of 2's in base-3 representation of n-th prime.

Original entry on oeis.org

1, 0, 1, 1, 1, 0, 2, 1, 2, 1, 0, 0, 1, 1, 2, 3, 2, 2, 1, 3, 2, 3, 1, 2, 1, 2, 1, 3, 0, 1, 1, 2, 2, 1, 2, 2, 2, 1, 2, 2, 3, 2, 2, 1, 3, 1, 2, 3, 3, 2, 4, 4, 4, 2, 1, 2, 3, 0, 1, 1, 0, 2, 1, 2, 2, 3, 1, 0, 2, 2, 1, 2, 1, 1, 1, 2, 2, 2, 3, 1, 2, 2, 4, 1, 2, 2, 3, 3
Offset: 1

Views

Author

Zak Seidov Aug 11 2002

Keywords

Examples

			a(7)=2 as 7th prime 17 is 122 in base-3 representation.
		

Crossrefs

Programs

  • Mathematica
    a2[n_] := Length[Cases[IntegerDigits[Prime[n], 3], 2]]
    DigitCount[Prime[Range[90]],3,2] (* Harvey P. Dale, May 11 2016 *)

Formula

a(n) = A081603(A000040(n)). - Michel Marcus, Oct 02 2013