login
Number of zeros in ternary representation of 2^n.
8

%I #29 May 10 2024 08:52:15

%S 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,

%T 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,

%U 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

%N Number of zeros in ternary representation of 2^n.

%C Conjecture from _N. J. A. Sloane_: a(n) > 0 for n > 15, see A102483.

%H Robert Israel, <a href="/A104320/b104320.txt">Table of n, a(n) for n = 0..10000</a>

%F a(n) = A077267(A000079(n)).

%F a(A104321(n))=n and a(m)<>n for m < A104321(n).

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

%p f:= n -> numboccur(0, convert(2^n,base,3)):

%p map(f, [$0..100]); # _Robert Israel_, Nov 17 2019

%t Table[DigitCount[2^n,3,0],{n,0,90}] (* _Harvey P. Dale_, May 06 2014 *)

%o (PARI) a(n) = my(d=vecsort(digits(2^n, 3))); #setintersect(d, vector(#d)) \\ _Felix Fröhlich_, Nov 17 2019

%o (PARI) a(n) = #select(d->!d, digits(2^n, 3)); \\ _Ruud H.G. van Tol_, May 09 2024

%o (Magma) [Multiplicity(Intseq(2^n,3),0):n in [0..90]]; // _Marius A. Burtea_, Nov 17 2019

%Y Cf. A004642, A007089.

%K nonn,base

%O 0,9

%A _Reinhard Zumkeller_, Mar 01 2005