Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #17 Jun 13 2018 10:01:35
%S 1,3,5,8,10,12,16,18,20,22,25,27,33,35,37,40,42,44,48,50,52,54,65,67,
%T 69,72,74,76,80,82,84,86,89,91,97,99,101,104,106,108,128,130,132,134,
%U 137,139,141,145,147,149,152,154,160,162,164,166,169,171,173,177,179,181,192,194,196,198,201
%N Tribonacci representation of 2n+1, written in base 10.
%H Robert Israel, <a href="/A305378/b305378.txt">Table of n, a(n) for n = 0..10000</a>
%p L[0]:= [0]: L[1]:= [1]:
%p for d from 2 to 10 do
%p L[d]:= map(t -> (2*t, `if`(t mod 4 <> 3, 2*t+1,NULL)), L[d-1])
%p od:
%p A003726:=map(op,[seq(L[i],i=0..10)]):
%p seq(A003726[i],i=2..nops(A003726),2); # _Robert Israel_, Jun 12 2018
%o (Python)
%o def A305378(n):
%o m, tlist, s = 2*n+1, [1,2,4], 0
%o while tlist[-1]+tlist[-2]+tlist[-3] <= m:
%o tlist.append(tlist[-1]+tlist[-2]+tlist[-3])
%o for d in tlist[::-1]:
%o s *= 2
%o if d <= m:
%o s += 1
%o m -= d
%o return s # _Chai Wah Wu_, Jun 12 2018
%Y Equals A003726(2n+1).
%Y Cf. A278038.
%K nonn,base
%O 0,2
%A _N. J. A. Sloane_, Jun 12 2018
%E More terms from _Robert Israel_, Jun 12 2018