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.

A060140 Ordered set S defined by these rules: 0 and 1 are in S and if x is a nonzero number in S, then 3x and 9x+1 are in S.

Original entry on oeis.org

0, 1, 3, 9, 10, 27, 28, 30, 81, 82, 84, 90, 91, 243, 244, 246, 252, 253, 270, 271, 273, 729, 730, 732, 738, 739, 756, 757, 759, 810, 811, 813, 819, 820, 2187, 2188, 2190, 2196, 2197, 2214, 2215, 2217, 2268, 2269, 2271, 2277, 2278, 2430, 2431, 2433, 2439
Offset: 0

Views

Author

Clark Kimberling, Mar 05 2001

Keywords

Comments

The numbers of the form 9x+1 occupy the same positions in S that 1 occupies in the infinite Fibonacci word (A003849).
These are Fibternary numbers: numbers whose ternary representations consist only of zeros and ones and do not have two consecutive ones. The sequence of Fibternary numbers can be constructed by writing out the Zeckendorf representations of nonnegative integers and then evaluating the result in ternary. These numbers are similar to Fibbinary numbers A003714, Tribbinary numbers A060140, and Tribternary numbers A356823. The number of Fibternary numbers less than any power of three is a Fibonacci number. We can generate Fibternary numbers recursively: Start by adding 0 and 1 to the sequence. Then, if x is a number in the sequence add 3x and 9x+1 to the sequence. Every nonnegative integer can be written as the sum of four Fibternary numbers. Every number has a Fibternary multiple. - Tanya Khovanova and PRIMES STEP Senior group, Aug 30 2022

Crossrefs

Programs

  • Mathematica
    FromDigits[IntegerDigits[#, 2], 3] & /@ Select[Range[0, 165], BitAnd[#, 2*#] == 0 &] (* Amiram Eldar, Oct 28 2023 *)
  • Python
    import heapq
    from itertools import islice
    def agen(): # generator of terms, using recursion in Comments
        yield 0; x, h = None, [1]
        while True:
            x = heapq.heappop(h)
            yield x
            for t in [3*x, 9*x+1]:  heapq.heappush(h, t)
    print(list(islice(agen(), 51))) # Michael S. Branicky, Aug 30 2022
    
  • Python
    def A060140(n):
        tlist, s = [1,2], 0
        while tlist[-1]+tlist[-2] <= n:
            tlist.append(tlist[-1]+tlist[-2])
        for d in tlist[::-1]:
            s <<= 1
            if d <= n:
                s += 1
                n -= d
        return int(bin(s)[2:],3) # Chai Wah Wu, May 22 2025

Formula

a(n) = A005836(A003714(n)+1). - Amiram Eldar, Oct 28 2023