cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A305380 Tribonacci representation of 2^n, written in base 10.

This page as a plain text file.
%I A305380 #31 Jun 14 2018 10:39:16
%S A305380 1,2,4,9,19,41,88,195,418,1033,2195,4705,10282,21850,49160,104465,
%T A305380 223780,550294,1186344,2525345,5514438,11817057,26297040,56201282,
%U A305380 138856076,295217708,632609378,1382640428,2974062096,6603081730,14149570820,34976354857,74361996963
%N A305380 Tribonacci representation of 2^n, written in base 10.
%H A305380 Alois P. Heinz, <a href="/A305380/b305380.txt">Table of n, a(n) for n = 0..2000</a>
%p A305380 T:= proc(n) T(n):= (<<0|1|0>, <0|0|1>, <1|1|1>>^n)[2, 3] end:
%p A305380 b:= proc(n) option remember; local j;
%p A305380       if n=0 then 0
%p A305380     else for j from 2 while T(j+1)<=n do od;
%p A305380          b(n-T(j))+2^(j-2)
%p A305380       fi
%p A305380     end:
%p A305380 a:= n-> b(2^n):
%p A305380 seq(a(n), n=0..35);  # _Alois P. Heinz_, Jun 12 2018
%o A305380 (Python)
%o A305380 def A305380(n):
%o A305380     m, tlist, s = 2**n, [1,2,4], 0
%o A305380     while tlist[-1]+tlist[-2]+tlist[-3] <= m:
%o A305380         tlist.append(tlist[-1]+tlist[-2]+tlist[-3])
%o A305380     for d in tlist[::-1]:
%o A305380         s *= 2
%o A305380         if d <= m:
%o A305380             s += 1
%o A305380             m -= d
%o A305380     return s # _Chai Wah Wu_, Jun 12 2018
%Y A305380 Equals A003726(2^n).
%Y A305380 Cf. A000073, A278038, A305876.
%K A305380 nonn,base
%O A305380 0,2
%A A305380 _N. J. A. Sloane_, Jun 12 2018
%E A305380 a(9)-a(24) from _Robert Israel_, Jun 12 2018
%E A305380 Terms a(25) and beyond from _Alois P. Heinz_, Jun 12 2018