login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A232640 Sequence (or tree) generated by these rules: 1 is in S, and if x is in S, then x + 1 and 2*x + 1 are in S, and duplicates are deleted as they occur. 2

%I #13 Mar 09 2023 10:25:02

%S 1,2,3,5,4,7,6,11,9,8,15,13,12,23,10,19,17,16,31,14,27,25,24,47,21,20,

%T 39,18,35,33,32,63,29,28,55,26,51,49,48,95,22,43,41,40,79,37,36,71,34,

%U 67,65,64,127,30,59,57,56,111,53,52,103,50,99,97,96,191

%N Sequence (or tree) generated by these rules: 1 is in S, and if x is in S, then x + 1 and 2*x + 1 are in S, and duplicates are deleted as they occur.

%C Let S be the set of numbers defined by these rules: 1 is in S, and if x is in S, then x + 1 and 2*x + 1 are in S. Then S is the set of positive integers, which arise in generations. Deleting duplicates as they occur, the generations are given by g(1) = (1), g(2) = (2,3), g(3) = (5,4,7), etc. Concatenating these gives A232640, a permutation of the positive integers. The number of numbers in g(n) is F(n), where F = A000045, the Fibonacci numbers. It is helpful to show the results as a tree with the terms of S as nodes, an edge from x to x + 1 if x + 1 has not already occurred, and an edge from x to 2*x + 1 if 2*x + 1 has not already occurred.

%H Clark Kimberling, <a href="/A232640/b232640.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = A135533(A003754(n+1)) for n > 0. - _Mikhail Kurkov_, Feb 26 2023

%e Each x begets x + 1 and 2*x + 1, but if either has already occurred it is deleted. Thus, 1 begets 2 and 3; then 2 begets only 5, and 3 begets (4,7), so that g(3) = (5,4,7).

%t z = 14; g[1] = {1}; g[2] = {2}; g[n_] := Riffle[g[n - 1] + 1, 2 g[n - 1] + 1]; j[2] = Join[g[1], g[2]]; j[n_] := Join[j[n - 1], g[n]]; g1[n_] := DeleteDuplicates[DeleteCases[g[n], Alternatives @@ j[n - 1]]]; g1[1] = g[1]; g1[2] = g[2]; t = Flatten[Table[g1[n], {n, 1, z}]] (* A232640 *)

%t Table[Length[g1[n]], {n, 1, z}] (* A000045 *)

%t Flatten[Table[Position[t, n], {n, 1, 200}]] (* A232641 *)

%o (PARI) b(n)=if(n<4, return(n)); (1+n%2)*b(n\2) + 1 \\ from A135533

%o is(n)=n=bitor(n, n>>1)+1; n>>=valuation(n, 2); n==1 \\ from A003754

%o my(z=1); for(k=1,299, while(!(is(z)), z++); print1(b(z), ", "); z++;); \\ _Mikhail Kurkov_, Feb 26 2023

%Y Cf. A000045, A003754, A135533, A232559, A232639, A232641.

%K nonn,easy

%O 1,2

%A _Clark Kimberling_, Nov 28 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 06:24 EDT 2024. Contains 371769 sequences. (Running on oeis4.)