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.

A363270 The result, starting from n, of Collatz steps x -> (3x+1)/2 while odd, followed by x -> x/2 while even.

This page as a plain text file.
%I A363270 #35 Jul 02 2023 00:02:19
%S A363270 1,1,1,1,1,3,13,1,7,5,13,3,5,7,5,1,13,9,11,5,1,11,5,3,19,13,31,7,11,
%T A363270 15,121,1,25,17,5,9,7,19,67,5,31,21,49,11,17,23,121,3,37,25,29,13,5,
%U A363270 27,47,7,43,29,67,15,23,31,91,1,49,33,19,17,13,35,121,9,55
%N A363270 The result, starting from n, of Collatz steps x -> (3x+1)/2 while odd, followed by x -> x/2 while even.
%C A363270 Each x -> (3x+1)/2 step decreases the number of trailing 1-bits by 1 so A007814(n+1) of them, and the result of those steps is 2*A085062(n).
%H A363270 Dustin Theriault, <a href="/A363270/b363270.txt">Table of n, a(n) for n = 1..10000</a>
%F A363270 a(n) = OddPart((3/2)^A007814(n+1)*(n+1) - 1), where OddPart(t) = A000265(t).
%F A363270 a(n) = OddPart(A085062(n)).
%t A363270 OddPart[x_] := x / 2^IntegerExponent[x, 2]
%t A363270 Table[OddPart[(3/2)^IntegerExponent[i + 1, 2] * (i + 1) - 1], {i, 100}]
%o A363270 (C) int a(int n) {
%o A363270   while (n & 1) n += (n >> 1) + 1;
%o A363270   while (!(n & 1)) n >>= 1;
%o A363270   return n;
%o A363270 }
%o A363270 (PARI) oddpart(n) = n >> valuation(n, 2); \\ A000265
%o A363270 a(n) = oddpart((3/2)^valuation(n+1, 2)*(n+1) - 1); \\ _Michel Marcus_, May 24 2023
%Y A363270 Cf. A000265, A085062.
%Y A363270 Cf. A160541 (number of iterations).
%Y A363270 Cf. A075677.
%K A363270 nonn,easy
%O A363270 1,6
%A A363270 _Dustin Theriault_, May 23 2023