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.
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
Keywords
Links
- Ivan Neretin, Table of n, a(n) for n = 0..10000
- Clark Kimberling, A Self-Generating Set and the Golden Mean, J. Integer Sequences, 3 (2000), Article 00.2.8.
- Clark Kimberling, Fusion, Fission, and Factors, Fib. Q., 52 (2014), 195-202.
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
Comments