A323097 Numbers m such that all elements of the Collatz trajectory occur in the divisors of m.
1, 2, 4, 8, 16, 32, 64, 80, 128, 160, 256, 320, 512, 640, 1024, 1280, 1344, 2048, 2560, 2688, 4096, 5120, 5376, 8192, 10240, 10752, 16384, 20480, 21504, 21760, 32768, 40960, 43008, 43520, 65536, 81920, 86016, 87040, 131072, 163840, 172032, 174080, 262144, 327680
Offset: 1
Keywords
Examples
1344 is in the sequence because the set of the divisors {1, 2, 3, 4, 6, 7, 8, 12, 14, 16, 21, 24, 28, 32, 42, 48, 56, 64, 84, 96, 112, 168, 192, 224, 336, 448, 672, 1344} contains the set of the elements of the Collatz trajectory 1344 -> 672 -> 336 -> 168 -> 84 -> 42 -> 21 -> 64 -> 32 -> 16 -> 8 -> 4 -> 2 -> 1
Programs
-
Maple
with(numtheory):nn:=250000: for n from 1 to nn do: m:=n:it:=0:lst:={n}: for i from 1 to nn while(m<>1) do: if irem(m, 2)=0 then m:=m/2: else m:=3*m+1: fi: it:=it+1:lst:=lst union {m}: od: x:=divisors(n):n0:=nops(x):lst1:={op(x), x[n0]}: lst2:=lst intersect lst1:n1:=nops(lst2): if lst2=lst then printf(`%d, `,n): else fi: od:
-
Mathematica
aQ[n_] := n == LCM @@ NestWhileList[If[OddQ[#], 3 # + 1, #/2] &, n, # > 1 &]; Select[Range[330000], aQ] (* Amiram Eldar, Aug 31 2019 *)
Comments