login
a(0) = 0; for n > 0, a(n) = a(n-1)/2 if that number is an integer and not already in the sequence, otherwise a(n) = 3*a(n-1) + 1.
4

%I #8 Feb 11 2024 11:44:42

%S 0,1,4,2,7,22,11,34,17,52,26,13,40,20,10,5,16,8,25,76,38,19,58,29,88,

%T 44,133,400,200,100,50,151,454,227,682,341,1024,512,256,128,64,32,97,

%U 292,146,73,220,110,55,166,83,250,125,376,188,94,47,142,71,214,107,322,161

%N a(0) = 0; for n > 0, a(n) = a(n-1)/2 if that number is an integer and not already in the sequence, otherwise a(n) = 3*a(n-1) + 1.

%C Other than a(0) = 0, the sequence misses all multiples of 3. Does it eventually hit all positive non-multiples of 3?

%H Nick Hobson, <a href="/A128333/b128333.txt">Table of n, a(n) for n = 0..10000</a>

%H Nick Hobson, <a href="/A128333/a128333.py.txt">Python program</a>

%H <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>

%e Consider n = 3. We have a(3) = 2 and try to divide by 2. The result, 1, is certainly an integer, but we cannot use it because 1 is already in the sequence. So we must multiply by 3 and add 1 instead, getting a(4) = 3*2 + 1 = 7.

%Y Cf. A126038, A005132.

%K easy,nonn

%O 0,3

%A _Nick Hobson_, Feb 27 2007