OFFSET
1,1
COMMENTS
LINKS
EXAMPLE
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 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Feb 02 2017
STATUS
approved