OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..2000
MAPLE
T:= proc(n) T(n):= (<<0|1|0>, <0|0|1>, <1|1|1>>^n)[2, 3] end:
b:= proc(n) option remember; local j;
if n=0 then 0
else for j from 2 while T(j+1)<=n do od;
b(n-T(j))+2^(j-2)
fi
end:
a:= n-> b(2^n):
seq(a(n), n=0..35); # Alois P. Heinz, Jun 12 2018
PROG
(Python)
def A305380(n):
m, tlist, s = 2**n, [1, 2, 4], 0
while tlist[-1]+tlist[-2]+tlist[-3] <= m:
tlist.append(tlist[-1]+tlist[-2]+tlist[-3])
for d in tlist[::-1]:
s *= 2
if d <= m:
s += 1
m -= d
return s # Chai Wah Wu, Jun 12 2018
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Jun 12 2018
EXTENSIONS
a(9)-a(24) from Robert Israel, Jun 12 2018
Terms a(25) and beyond from Alois P. Heinz, Jun 12 2018
STATUS
approved