[go: up one dir, main page]

login
Difference between 2^n and the next larger or equal power of 3.
2

%I #11 Apr 16 2023 15:55:41

%S 0,1,5,1,11,49,17,115,473,217,1163,139,2465,11491,3299,26281,111611,

%T 46075,269297,7153,545747,2685817,588665,5960299,26269505,9492289,

%U 62031299,253202761,118985033,625390555,88519643,1339300753

%N Difference between 2^n and the next larger or equal power of 3.

%F a(n) = 3^ceiling(log_3(2^n)) - 2^n.

%t dp23[n_]:=Module[{t=2^n},3^Ceiling[Log[3,t]]-t]; Array[dp23,40,0] (* _Harvey P. Dale_, Nov 20 2015 *)

%o (PARI) for(n=1,50,print1(3^ceil(log(2^n)/log(3))-2^n","))

%Y Cf. A056577, A063003, A063005.

%K easy,nonn

%O 0,3

%A _Jens Voß_, Jul 02 2001

%E More terms from _Ralf Stephan_, Mar 21 2003