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.

A104320 Number of zeros in ternary representation of 2^n.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 1, 1, 1, 4, 1, 0, 4, 2, 3, 3, 3, 3, 3, 7, 7, 9, 5, 6, 6, 4, 4, 3, 5, 6, 7, 9, 9, 10, 6, 6, 9, 9, 8, 9, 8, 7, 13, 12, 13, 9, 5, 9, 8, 6, 16, 13, 9, 10, 11, 11, 7, 14, 13, 13, 9, 12, 14, 15, 15, 11, 11, 17, 15, 19, 14, 19, 12, 18, 15, 11, 10, 16, 15, 14, 14, 13, 17, 14
Offset: 0

Views

Author

Reinhard Zumkeller, Mar 01 2005

Keywords

Comments

Conjecture from N. J. A. Sloane: a(n) > 0 for n > 15, see A102483.

Examples

			n=13: 2^13=8192 -> '102020102', a(13) = 4.
		

Crossrefs

Programs

  • Magma
    [Multiplicity(Intseq(2^n,3),0):n in [0..90]]; // Marius A. Burtea, Nov 17 2019
  • Maple
    f:= n -> numboccur(0, convert(2^n,base,3)):
    map(f, [$0..100]); # Robert Israel, Nov 17 2019
  • Mathematica
    Table[DigitCount[2^n,3,0],{n,0,90}] (* Harvey P. Dale, May 06 2014 *)
  • PARI
    a(n) = my(d=vecsort(digits(2^n, 3))); #setintersect(d, vector(#d)) \\ Felix Fröhlich, Nov 17 2019
    
  • PARI
    a(n) = #select(d->!d, digits(2^n, 3)); \\ Ruud H.G. van Tol, May 09 2024
    

Formula

a(n) = A077267(A000079(n)).
a(A104321(n))=n and a(m)<>n for m < A104321(n).