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.

A073780 Number of 1's in base 3 representation of n-th prime.

Original entry on oeis.org

0, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 3, 3, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 3, 3, 3, 3, 1, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 3, 1, 3, 3, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 3, 3, 3, 5, 3, 3, 3, 3, 1, 3, 5, 3, 3, 3, 3, 5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 3, 3, 3, 3
Offset: 1

Views

Author

Zak Seidov Aug 11 2002

Keywords

Examples

			a1(11)=3 as 11th prime, 31, is 1011 in base 3 representation.
		

Crossrefs

Programs

  • Mathematica
    a1[n_] := Length[Cases[IntegerDigits[Prime[n], 3], 1]]
    Table[DigitCount[n,3,1],{n,Prime[Range[100]]}] (* Harvey P. Dale, Feb 23 2015 *)

Formula

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