OFFSET
1,3
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.
MATHEMATICA
Select[Range[0, 1000], SequenceCount[IntegerDigits[#, 3], {1, 1, 1}] == 0 && SequenceCount[IntegerDigits[#, 3], {2}] == 0 &]
PROG
(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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Tanya Khovanova and PRIMES STEP Senior group, Aug 29 2022
STATUS
approved