%I #7 Jan 01 2023 18:08:34
%S 1,2,7,12,13,16,44,45,46,80,84,85,98,99,100,101,102,107,129,153,156,
%T 157,158,169,272,276,277,280,282,300,301,302,350,351,512,576,592,596,
%U 597,608,616,618,625,642,643,644,645,646,648,649,650,651,652,653,654,655,662,663
%N Starting numbers n such that the number of halving and tripling steps to reach 1 under the Collatz 3x+1 map is a perfect square.
%C Numbers n such that A006577(n) is a perfect square.
%H <a href="/index/3#3x1">Index to sequences related to the 3x+1 problem</a>
%F {n: A006577(n) in A000290}.
%e 44, 45 and 46 are in the sequence because the number of steps as counted in A006577 for each of them is 16 = 4^2, a perfect square.
%p with(numtheory):for x from 1 to 200 do traj:=0: n1:=x: x1:=x: for p from 1 to 20 while(irem(x1,2)=0)do p1:=2^p: xx1:=x1: x1:=floor(n1/p1): traj:=traj+1:od:
%p n:=x1: for q from 1 to 100 while(n<>1)do n1:=3*n+1: traj:=traj+1: x0:=irem(n1,2): for p from 1 to 20 while(x0=0)do p1:=2^p: xx1:=x1: x1:=floor(n1/p1): x0:=n1-p1*x1: traj:=traj+1: od: traj:=traj-1: n:=xx1:od:
%p if(sqrt(traj))=floor(sqrt(traj)) then print(x):else fi:od:
%t htsQ[n_]:=With[{len=Length[NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#!=1&]]-1},IntegerQ[Sqrt[len]]]; Select[Range[700],htsQ] (* _Harvey P. Dale_, Jan 01 2023 *)
%Y Cf. A006577, A008908, A064433, A006666, A006667, A033491
%K nonn
%O 1,2
%A _Michel Lagneau_, Mar 21 2010
%E Unspecific references removed - _R. J. Mathar_, Mar 31 2010
%E Corrected and extended by _Harvey P. Dale_, Jan 01 2023