Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #6 Dec 02 2013 09:24:50
%S 1,2,4,3,5,7,11,13,8,10,6,14,16,20,22,12,32,34,38,40,9,23,25,29,31,17,
%T 19,15,41,43,47,49,21,59,61,65,67,35,37,33,95,97,101,103,39,113,115,
%U 119,121,26,28,24,68,70,74,76,30,86,88,92,94,18,50,52,56
%N Sequence (or tree) generated by these rules: 1 is in S, and if x is in S, then x + 1, 3*x - 1 and 3*x + 1 are in S, and duplicates are deleted as they occur.
%C Let S be the sequence (or tree) of numbers defined by these rules: 1 is in S, and if x is in S, then x + 1, 3*x - 1, and 3*x + 1 are in S. Then S is a permutation of the positive integers. Deleting duplicates as they occur, the generations of S are given by g(1) = (1), g(2) = (2,4), g(3) = (3,5,7,11,13), etc. Concatenating these gives A232798. The position of n in S gives the inverse permutation of S, as in A232799.
%H Clark Kimberling, <a href="/A232798/b232798.txt">Table of n, a(n) for n = 1..4000</a>
%e Each x begets x + 1, 3*x - 1 and 3*x + 1, but if any of these has already occurred it is deleted. Thus, 1 begets (2,4); then 2 begets (3,5,7) and 4 begets (11,13), making g(3) = (3,5,7,11,13), etc.
%t x = {1}; Do[x = DeleteDuplicates[Flatten[Transpose[{x, x + 1, 3 x - 1, 3 x + 1}]]], {8}]; x (* A232798 *)
%t y = Flatten[Table[Position[x, n], {n, 1, 100}]] (* A232799 *)
%Y Cf. A232559, A232799.
%K nonn,easy
%O 1,2
%A _Clark Kimberling_, Nov 30 2013