login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Interleave 2^n + 2 and 2^n + 1.
2

%I #30 Sep 08 2022 08:46:13

%S 4,3,6,5,10,9,18,17,34,33,66,65,130,129,258,257,514,513,1026,1025,

%T 2050,2049,4098,4097,8194,8193,16386,16385,32770,32769,65538,65537,

%U 131074,131073,262146,262145,524290,524289,1048578,1048577,2097154,2097153,4194306,4194305,8388610,8388609

%N Interleave 2^n + 2 and 2^n + 1.

%C There is only one fundamental difference between the x + 1 problem and the 3x + 1 problem, that being one of definition: if x is odd, then the next value is x + 1 rather than 3x + 1. But there are also important differences between the two problems, such as that with the x + 1 problem it is easy to prove that every positive integer x reaches 1 after a finite number of iterations.

%C As with the 3x + 1 problem, the minimum necessary number of iterations is obvious: given an arbitrary positive n, it will take at least floor(log_2(n)) iterations to reach 1, especially if n is a power of 2 to begin with.

%C But with the x + 1 problem, it is almost as easy to determine the maximum number of iterations needed to reach 1: 2*ceiling(log_2(n)). This is the case when n is one of the odd numbers in this sequence, in which case there are no consecutive halving steps prior to reaching 4.

%C If an initial 1 and 2 are added to this sequence, the complete x + 1 trajectory of any number in this sequence can be obtained by reading backwards from that number.

%C A061313(n) = number of steps to reach 1 when starting with n. - _Reinhard Zumkeller_, Sep 05 2015

%H Colin Barker, <a href="/A261723/b261723.txt">Table of n, a(n) for n = 1..1000</a>

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,3,0,-2).

%F a(2n - 1) = 2^n + 2, a(2n) = 2^n + 1.

%F a(1) = 4, a(2n) = 2a(n - 1), a(2n + 1) = a(n - 1) - 1.

%F a(1) = 4, a(n) = a(n - 1) - 1 if a(n - 1) is even, a(n) = 2a(n - 1) if a(n - 1) is odd.

%F a(n) = 3*a(n-2) - 2*a(n-4) for n > 4. - _Colin Barker_, Aug 31 2015

%F G.f.: -x*(4*x^3+6*x^2-3*x-4) / ((x-1)*(x+1)*(2*x^2-1)). - _Colin Barker_, Aug 31 2015

%F a(n) = (2^((n+1)/2)+2)*(1-(-1)^n)/2+(2^(n/2)+1)*(1+(-1)^n)/2. - _Wesley Ivan Hurt_, Sep 06 2015

%F E.g.f.: sqrt(2)*sinh(sqrt(2)*x) + cosh(sqrt(2)*x) + 2*sinh(x) + cosh(x) - 2. - _Robert Israel_, Sep 06 2015

%p A261723:=n->(2^((n+1)/2)+2)*(1-(-1)^n)/2+(2^(n/2)+1)*(1+(-1)^n)/2: seq(A261723(n), n=1..60); # _Wesley Ivan Hurt_, Sep 06 2015

%t Flatten[Table[{2^n + 2, 2^n + 1}, {n, 25}]]

%o (Magma) &cat[[2^n+2, 2^n+1]: n in [1..30]]; // _Vincenzo Librandi_, Aug 31 2015

%o (PARI) Vec(-x*(4*x^3+6*x^2-3*x-4)/((x-1)*(x+1)*(2*x^2-1)) + O(x^100)) \\ _Colin Barker_, Aug 31 2015

%o (Haskell)

%o a261723 n = a261723_list !! (n-1)

%o a261723_list = concat $ transpose [tail a052548_list, tail a000051_list]

%o -- _Reinhard Zumkeller_, Sep 05 2015

%Y Cf. A000051, A052548, A061313.

%K easy,nonn

%O 1,1

%A _Alonso del Arte_, Aug 29 2015

%E Two incorrect terms corrected by _Colin Barker_, Aug 31 2015