login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A308712 a(0) = 0 and a(1) = 1; 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) + remainder of a(n-1)/2.  (A variant of the Collatz sequence). 0

%I

%S 0,1,4,2,6,3,10,5,16,8,24,12,36,18,9,28,14,7,22,11,34,17,52,26,13,40,

%T 20,60,30,15,46,23,70,35,106,53,160,80,240,120,360,180,90,45,136,68,

%U 204,102,51,154,77,232,116,58,29,88,44,132,66,33,100,50,25,76,38,19,58

%N a(0) = 0 and a(1) = 1; 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) + remainder of a(n-1)/2. (A variant of the Collatz sequence).

%C Similar to A128333 and related to the 3x+1 (Collatz) sequence. Hits all positive integers?

%e a(1)=1 => a(2)=3*1+1=4 because a(1) is odd => a(3)=4/2=2 because a(2) is even => a(4)=3*2+0=6 because a(3) is even but a(3)/2 is already in the sequence.

%t a[0] = 0; a[1] = 1; a[n_] := a[n] = With[{b = a[n-1]}, If[EvenQ[b] && FreeQ[Array[a, n, 0], b/2], b/2, 3 b + Mod[b, 2]]];

%t Table[a[n], {n, 0, 100}] (* _Jean-Fran├žois Alcover_, Jun 20 2019 *)

%Y Cf. A126038, A005132, A128333.

%K easy,nonn

%O 0,3

%A _Alexis Monnerot-Dumaine_, Jun 19 2019

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 22 00:42 EDT 2020. Contains 337276 sequences. (Running on oeis4.)