OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..2306
EXAMPLE
MAPLE
F:= proc(n) F(n):= `if`(n<2, n, F(n-1)+F(n-2)) end:
b:= proc(n) local j;
if n=0 then 0
else for j from 2 while F(j+1)<=n do od;
b(n-F(j))+2^(j-2)
fi
end:
a:= n-> b(2^n):
seq(a(n), n=0..35);
PROG
(Python)
def A305876(n):
m, tlist, s = 2**n, [1, 2], 0
while tlist[-1]+tlist[-2] <= m:
tlist.append(tlist[-1]+tlist[-2])
for d in tlist[::-1]:
s *= 2
if d <= m:
s += 1
m -= d
return s # Chai Wah Wu, Jun 14 2018
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Alois P. Heinz, Jun 12 2018
STATUS
approved