A281938 a(n) is the least k such that gcd(A006666(k), A006667(k)) = n.
2, 4, 8, 16, 32, 64, 128, 256, 512, 82, 129, 4096, 327, 16384, 32768, 1249, 35655, 159, 4926, 283, 377, 502, 603, 799, 1063, 1417, 1889, 2518, 3356, 4472, 5960, 7944, 10594, 14124, 18833, 25110, 33481, 44641, 59521, 79361, 105814, 141084, 188113, 250817, 334422
Offset: 1
Keywords
Examples
a(10) = 82 because gcd(A006666(82), A006667(82)) = gcd(70, 40) = 10, and there is no k < 82 such that gcd(A006666(k), A006667(k)) = 10.
Programs
-
Maple
for n from 1 to 45 do: ii:=0: for k from 2 to 10^7 while(ii=0) do: m:=k:s1:=0:s2:=0: for i from 1 to nn while(m<>1) do: if irem(m,2)=0 then s2:=s2+1:m:=m/2: else s1:=s1+1:m:=3*m+1: fi: od: if gcd(s1,s2)=n then ii:=1:printf(`%d %d \n`,n,k): else fi: od: od:
-
Mathematica
Function[w, First /@ Lookup[w, Function[k, If[k == {}, #, Take[#, First@ k]]]@ Complement[Range@ Max@ #, #]] &@ Keys@ w]@ KeySort@ PositionIndex@ Table[GCD[Count[NestWhileList[If[OddQ[#], 3 # + 1, #/2] &, n, # > 1 &], ?(EvenQ[#] &)], Count[Differences[NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]], ?Positive]], {n, 2^16}] (* Michael De Vlieger, Feb 02 2017, Version 10, after Harvey P. Dale at A006666 and A006667 *)
Comments