%I #21 Dec 27 2021 10:36:57
%S 1,3,7,15,27,27,127,255,511,1023,1819,4095,4255,16383,32767,65535,
%T 77671,262143,459759,1048575,2097151,4194303,7456539,16777215,
%U 33554431,67108863,125687199,125687199,125687199,1073741823,2147483647,4294967295,8589934591,17179869183
%N For the Collatz (3x+1) iterations starting with the odd numbers k, a(n) is the smallest k such that the trajectory contains at least n successive odd numbers == 3 (mod 4).
%C The count of odd numbers includes the starting number n if it is part of the longest chain of odd numbers in the sequence.
%C The sequence is infinite because the Collatz trajectory starting at k = 2^n - 1 contains at least n consecutive odd numbers == 3 (mod 4) such that 3*2^n - 1 -> 3^2*2^(n-1)-1 -> ... -> 2*3^(n-1)-1 and then -> 3^n-1 -> ... but the numbers of this sequence are not always of this form, for example 27, 1819, 4255, 77671, 459759, ...
%C Equivalently, a(n) is the smallest k such that the Collatz sequence for k suffers at least n consecutive (3x+1)/2 operations (i.e., no consecutive divisions by 2). - _Kevin P. Thompson_, Dec 15 2021
%H Kevin P. Thompson, <a href="/A213215/b213215.txt">Table of n, a(n) for n = 1..36</a>
%e a(4)=15 because the Collatz sequence for 15 (15, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1) is the first Collatz sequence to contain 4 consecutive odd numbers congruent to 3 (mod 4): 15, 23, 35, and 53.
%p nn:=200:T:=array(1..nn):
%p for n from 1 to 20 do:jj:=0:
%p for m from 3 by 2 to 10^8 while(jj=0) do:
%p for i from 1 to nn while(jj=0) do:
%p T[i]:=0:od:a:=1:T[1]:=m:x:=m:
%p for it from 1 to 100 while (x>1) do:
%p if irem(x,2)=0 then
%p x := x/2:a:=a+1:T[a]:=x:
%p else
%p x := 3*x+1: a := a+1: T[a]:=x:
%p fi:
%p od:
%p jj:=0:aa:=a:
%p for j from 1 to aa while(jj=0) do:
%p if irem(T[j],4)=3 then
%p T[j]:=1:
%p else
%p T[j]:=0:
%p fi:
%p od:
%p for p from 0 to aa-1 while (jj=0) do:
%p s:=sum(T[p+k],k=1..2*n):
%p if s=n then
%p jj:=1: printf ( "%d %d \n",n,m):
%p else
%p fi:
%p od:
%p od:
%p od:
%t Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; countThrees[t_] := Module[{mx = 0, cnt = 0, i = 0}, While[i < Length[t], i++; If[t[[i]] == 3, cnt++; i++, If[cnt > mx, mx = cnt]; cnt = 0]]; mx]; nn = 15; t = Table[0, {nn}]; n = 1; While[Min[t] == 0, n = n + 2; c = countThrees[Mod[Collatz[n], 4]]; If[c <= nn && t[[c]] == 0, t[[c]] = n; Do[If[t[[i]] == 0, t[[i]] = n], {i, c}]]]; t (* _T. D. Noe_, Mar 02 2013 *)
%Y Cf. A006370, A006577, A000225, A024023, A213214.
%Y Cf. A222598 (similar).
%K nonn
%O 1,2
%A _Michel Lagneau_, Mar 02 2013
%E Definition clarified, a(1) inserted, and a(21)-a(34) added by _Kevin P. Thompson_, Dec 15 2021
|