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.

Previous Showing 21-27 of 27 results.

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

A356823 Tribternary numbers.

Original entry on oeis.org

0, 1, 3, 4, 9, 10, 12, 27, 28, 30, 31, 36, 37, 81, 82, 84, 85, 90, 91, 93, 108, 109, 111, 112, 243, 244, 246, 247, 252, 253, 255, 270, 271, 273, 274, 279, 280, 324, 325, 327, 328, 333, 334, 336, 729, 730, 732, 733, 738, 739, 741, 756, 757, 759, 760, 765, 766, 810, 811, 813, 814, 819
Offset: 1

Views

Author

Tanya Khovanova and PRIMES STEP Senior group, Aug 29 2022

Keywords

Comments

These are numbers whose ternary representations consist only of zeros and ones and do not have three consecutive ones.
The sequence of Tribternary numbers can be constructed by writing out the Tribonacci representations of nonnegative integers and then evaluating the result in ternary.
These are Tribbinary numbers written in base 2 and evaluated in base 3.
These numbers are similar to Fibbinary numbers A003714, Fibternary numbers A003726, and Tribbinary numbers A060140.
Tribbinary numbers A060140 are a subsequence.
Subsequence of A005836.
The number of Tribternary numbers less than any power of three is a Tribonacci number.
We can generate this sequence recursively: start with 0 and 1; then, if x is in the sequence add 3x, 9x+1, and 27x+4 to the sequence.
The n-th Tribternary number is divisible by 3 if the n-th term of the Tribonacci word is a. Respectively, the n-th Tribbinary number is of the form 9x+1 if the n-th term of the Tribonacci word is b, and the n-th Tribbinary number is of the form 27x+4 if the n-th term of the Tribonacci word is c.
Every nonnegative integer can be written as a sum of three Tribternary numbers.
Every number has a Tribternary multiple.

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 1000], SequenceCount[IntegerDigits[#, 3], {1, 1, 1}] == 0 && SequenceCount[IntegerDigits[#, 3], {2}] == 0 &]
  • Python
    import heapq
    from itertools import islice
    def agen(): # generator of terms, using recursion in Comments
        x, h = None, [0]
        while True:
            x, oldx = heapq.heappop(h), x
            if x != oldx:
                yield x
                for t in [3*x, 9*x+1, 27*x+4]: heapq.heappush(h, t)
    print(list(islice(agen(), 62))) # Michael S. Branicky, Aug 30 2022

A356965 a(n) is the sum of the tribonacci numbers in common in the greedy and lazy tribonacci representations of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 0, 8, 9, 10, 11, 12, 0, 1, 15, 16, 17, 18, 19, 13, 21, 22, 23, 0, 1, 2, 3, 28, 29, 30, 24, 32, 33, 34, 35, 36, 24, 25, 39, 40, 41, 42, 43, 0, 1, 2, 3, 4, 5, 6, 7, 52, 53, 54, 55, 56, 44, 45, 59, 60, 61, 62, 63, 57, 65, 66, 67, 44, 45, 46
Offset: 0

Views

Author

Rémy Sigrist, Sep 06 2022

Keywords

Comments

This sequence is to tribonacci numbers (A000073) what A356771 is to Fibonacci numbers (A000045).

Examples

			For n = 58:
- with T = A000073,
- the greedy representation of 58 is: T(9) + T(7) + T(3),
- the lazy representation of 58 is: T(9) + T(6) + T(5) + T(4) + T(3),
- so a(59) = T(9) + T(3) = 45.
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n) = A356964(A003796(n+1) AND A003726(n+1)) (where AND denotes the bitwise AND operator).
a(n) <= n with equality iff n belongs to A356899.
a(n) = 0 iff n belongs to A356966.

A356966 Numbers with no common terms in their greedy and lazy tribonacci representations.

Original entry on oeis.org

0, 7, 13, 24, 44, 81, 88, 149, 156, 162, 274, 287, 298, 504, 511, 528, 548, 927, 934, 940, 971, 1008, 1015, 1705, 1718, 1729, 1786, 1793, 1854, 1861, 1867, 3136, 3143, 3160, 3180, 3285, 3292, 3298, 3410, 3423, 3434, 5768, 5775, 5781, 5812, 5849, 5856, 6042
Offset: 1

Views

Author

Rémy Sigrist, Sep 06 2022

Keywords

Comments

Also numbers k such that the binary expansions of A003726(k+1) and A003796(k+1) have no common 1's.
Also positions of 0's in A356965.
This sequence is to tribonacci numbers (A000073) what A331467 is to Fibonacci numbers (A000045).
This sequence includes tribonacci numbers >= 7.

Examples

			With T = A000073:
- the greedy representation of 13 is: T(7),
- the lazy representation of 13 is: T(6) + T(5) + T(4),
- there are no common terms,
- so 13 belongs to this sequence.
		

Crossrefs

Programs

  • PARI
    See Links section.

A305378 Tribonacci representation of 2n+1, written in base 10.

Original entry on oeis.org

1, 3, 5, 8, 10, 12, 16, 18, 20, 22, 25, 27, 33, 35, 37, 40, 42, 44, 48, 50, 52, 54, 65, 67, 69, 72, 74, 76, 80, 82, 84, 86, 89, 91, 97, 99, 101, 104, 106, 108, 128, 130, 132, 134, 137, 139, 141, 145, 147, 149, 152, 154, 160, 162, 164, 166, 169, 171, 173, 177, 179, 181, 192, 194, 196, 198, 201
Offset: 0

Views

Author

N. J. A. Sloane, Jun 12 2018

Keywords

Crossrefs

Equals A003726(2n+1).
Cf. A278038.

Programs

  • Maple
    L[0]:= [0]: L[1]:= [1]:
    for d from 2 to 10 do
      L[d]:= map(t -> (2*t, `if`(t mod 4 <> 3, 2*t+1,NULL)), L[d-1])
    od:
    A003726:=map(op,[seq(L[i],i=0..10)]):
    seq(A003726[i],i=2..nops(A003726),2); # Robert Israel, Jun 12 2018
  • Python
    def A305378(n):
        m, tlist, s = 2*n+1, [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

More terms from Robert Israel, Jun 12 2018

A305878 For any number n >= 0: apply the map 0 -> "0", 1 -> "01", 2 -> "011" to the ternary representation of n and interpret the result as a binary string.

Original entry on oeis.org

0, 1, 3, 2, 5, 11, 6, 13, 27, 4, 9, 19, 10, 21, 43, 22, 45, 91, 12, 25, 51, 26, 53, 107, 54, 109, 219, 8, 17, 35, 18, 37, 75, 38, 77, 155, 20, 41, 83, 42, 85, 171, 86, 173, 347, 44, 89, 179, 90, 181, 363, 182, 365, 731, 24, 49, 99, 50, 101, 203, 102, 205, 411
Offset: 0

Views

Author

Rémy Sigrist, Jun 13 2018

Keywords

Comments

This sequence is a ternary analog of A048678.
This sequence is a permutation of A003726.

Examples

			The first terms, alongside the ternary representation of n and the binary representation of a(n), are:
  n   a(n)  tern(n)  bin(a(n))
  --  ----  -------  ---------
   0     0        0          0
   1     1        1          1
   2     3        2         11
   3     2       10         10
   4     5       11        101
   5    11       12       1011
   6     6       20        110
   7    13       21       1101
   8    27       22      11011
   9     4      100        100
  10     9      101       1001
  11    19      102      10011
  12    10      110       1010
		

Crossrefs

Programs

  • PARI
    a(n) = if (n==0, 0, my (d=n%3); a(n\3) * 2^(d+1) + (2^d-1))

Formula

a(0) = 0.
a(3*n) = 2*a(n).
a(3*n + 1) = 4*a(n) + 1.
a(3*n + 2) = 8*a(n) + 3.
A000120(a(n)) = A053735(n).

A356974 Irregular triangle T(n, k) read by rows, n >= 0, k = 1..A117546(n); the n-th row contains the numbers m such that A356964(m) = n, in increasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 32, 29, 33, 30, 34, 31, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 48, 47, 49, 50, 51, 52, 53, 54, 55, 56, 64, 57, 65, 58, 66, 59, 67, 60, 68, 61, 69, 62, 70
Offset: 0

Views

Author

Rémy Sigrist, Sep 07 2022

Keywords

Comments

This sequence is to tribonacci numbers (A000073) what A345101 is to Fibonacci numbers (A000045).
This sequence (when interpreted as a flat sequence) is a permutation of the nonnegative integers.

Examples

			Triangle begins:
     0   [0]
     1   [1]
     2   [2]
     3   [3]
     4   [4]
     5   [5]
     6   [6]
     7   [7, 8]
     8   [9]
     9   [10]
    10   [11]
    11   [12]
    12   [13]
    13   [14, 16]
    14   [15, 17]
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

T(n, 1) = A003796(n+1).
T(n, A117546(n)) = A003726(n+1).
Previous Showing 21-27 of 27 results.