login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A063003
Difference between 3^n and the next larger or equal power of 2.
4
0, 1, 7, 5, 47, 13, 295, 1909, 1631, 13085, 6487, 84997, 517135, 502829, 3605639, 2428309, 24062143, 5077565, 149450423, 985222181, 808182895, 6719515981, 2978678759, 43295774645, 267326277407, 252223018333, 1856180682775
OFFSET
0,3
LINKS
FORMULA
a(n) = 2^(ceiling(log_2(3^n))) - 3^n.
MATHEMATICA
Table[2^Ceiling@ Log2@ # - # &[3^n], {n, 0, 26}] (* Michael De Vlieger, Sep 30 2017 *)
PROG
(PARI) { default(realprecision, 50); t=1/log(2); for (n=0, 200, write("b063003.txt", n, " ", 2^ceil(t*log(3^n)) - 3^n) ) } \\ Harry J. Smith, Aug 15 2009
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jens Voß, Jul 02 2001
EXTENSIONS
More terms from Marc LeBrun, Jul 11 2001
STATUS
approved