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.

A356823 Tribternary numbers.

This page as a plain text file.
%I A356823 #9 Aug 30 2022 13:42:41
%S A356823 0,1,3,4,9,10,12,27,28,30,31,36,37,81,82,84,85,90,91,93,108,109,111,
%T A356823 112,243,244,246,247,252,253,255,270,271,273,274,279,280,324,325,327,
%U A356823 328,333,334,336,729,730,732,733,738,739,741,756,757,759,760,765,766,810,811,813,814,819
%N A356823 Tribternary numbers.
%C A356823 These are numbers whose ternary representations consist only of zeros and ones and do not have three consecutive ones.
%C A356823 The sequence of Tribternary numbers can be constructed by writing out the Tribonacci representations of nonnegative integers and then evaluating the result in ternary.
%C A356823 These are Tribbinary numbers written in base 2 and evaluated in base 3.
%C A356823 These numbers are similar to Fibbinary numbers A003714, Fibternary numbers A003726, and Tribbinary numbers A060140.
%C A356823 Tribbinary numbers A060140 are a subsequence.
%C A356823 Subsequence of A005836.
%C A356823 The number of Tribternary numbers less than any power of three is a Tribonacci number.
%C A356823 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.
%C A356823 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.
%C A356823 Every nonnegative integer can be written as a sum of three Tribternary numbers.
%C A356823 Every number has a Tribternary multiple.
%t A356823 Select[Range[0, 1000], SequenceCount[IntegerDigits[#, 3], {1, 1, 1}] == 0 && SequenceCount[IntegerDigits[#, 3], {2}] == 0 &]
%o A356823 (Python)
%o A356823 import heapq
%o A356823 from itertools import islice
%o A356823 def agen(): # generator of terms, using recursion in Comments
%o A356823     x, h = None, [0]
%o A356823     while True:
%o A356823         x, oldx = heapq.heappop(h), x
%o A356823         if x != oldx:
%o A356823             yield x
%o A356823             for t in [3*x, 9*x+1, 27*x+4]: heapq.heappush(h, t)
%o A356823 print(list(islice(agen(), 62))) # _Michael S. Branicky_, Aug 30 2022
%Y A356823 Cf. A003714, A003726, A005836, A060140.
%K A356823 nonn,base
%O A356823 1,3
%A A356823 _Tanya Khovanova_ and PRIMES STEP Senior group, Aug 29 2022