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.

Original entry on oeis.org

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
Offset: 0

Views

Author

N. J. A. Sloane, Jun 12 2018

Keywords

Crossrefs

Equals A003726(2^n).

Programs

  • 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
  • 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

Extensions

a(9)-a(24) from Robert Israel, Jun 12 2018
Terms a(25) and beyond from Alois P. Heinz, Jun 12 2018