OFFSET
0,3
COMMENTS
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..10945 (terms 0..10000 from Alois P. Heinz)
FORMULA
a(n+1) = min{([a(n)/2]+1)*2^k} such that it is not yet in the sequence. - Gerard Orriols, Jun 07 2014
MAPLE
a(n) = rewrite_0to0_x1to1(fibbinary(j)) (where fibbinary(j) = A003714[ n ])
rewrite_0to0_x1to1 := proc(n) option remember; if(0 = n) then RETURN(n); else RETURN((2 * rewrite_0to0_x1to1(floor(n/(2^(1+(n mod 2)))))) + (n mod 2)); fi; end;
fastfib := n -> round((((sqrt(5)+1)/2)^n)/sqrt(5)); fibinv_appr := n -> floor(log[ (sqrt(5)+1)/2 ](sqrt(5)*n)); fibinv := n -> (fibinv_appr(n) + floor(n/fastfib(1+fibinv_appr(n)))); fibbinary := proc(n) option remember; if(n <= 2) then RETURN(n); else RETURN((2^(fibinv(n)-2))+fibbinary_seq(n-fastfib(fibinv(n)))); fi; end;
# second Maple program:
b:= proc(n) is(n=0) end:
a:= proc(n) option remember; local h; h:= iquo(a(n-1), 2)+1;
while b(h) do h:= h*2 od; b(h):=true; h
end: a(0):=0:
seq(a(n), n=0..100); # Alois P. Heinz, Sep 22 2014
MATHEMATICA
b[n_] := n==0; a[n_] := a[n] = Module[{h}, h = Quotient[a[n-1], 2] + 1; While[b[h], h = h*2]; b[h] = True; h]; a[0]=0; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Feb 27 2016, after Alois P. Heinz *)
PROG
(PARI)
A007814(n) = valuation(n, 2);
A000265(n) = (n/2^valuation(n, 2));
A048679(n) = if(!n, n, A106151(2*A003714(n))); \\ Antti Karttunen, May 13 2018, after Reinhard Zumkeller's May 09 2005 formula.
(Python)
from itertools import count, islice
def A048679_gen(): # generator of terms
return map(lambda n: int(bin(n)[2:].replace('01', '1'), 2), filter(lambda n:not (n<<1)&n, count(0)))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved