|
|
A305380
|
|
Tribonacci representation of 2^n, written in base 10.
|
|
2
|
|
|
1, 2, 4, 9, 19, 41, 88, 195, 418, 1033, 2195, 4705, 10282, 21850, 49160, 104465, 223780, 550294, 1186344, 2525345, 5514438, 11817057, 26297040, 56201282, 138856076, 295217708, 632609378, 1382640428, 2974062096, 6603081730, 14149570820, 34976354857, 74361996963
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
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):
|
|
PROG
|
(Python)
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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|