OFFSET
1,2
COMMENTS
Numbers k for which the number of iterations starting with -k to reach the last number of the cycle equals the number of iterations starting with k to reach 1 in Collatz (3x+1) trajectory of +/-k.
EXAMPLE
The trajectory of - 26 is :
-26 -> - 13 -> -38 -> -19 -> -56 -> -28 -> -14 -> -7 -> -20 -> -10 -> -5 with 11 iterations (the first value is counted);
The trajectory of 26 is :
26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 with 11 iterations (the first value is counted).
MAPLE
z:={1}:
for m from -1 by -1 to -1500 do:
lst:={m}:a:=0: x:=m: lst:=lst union {x}:
for i from 1 to 100 do:
lst:=lst union {x}:
if irem(abs(x), 2)=1
then
x:=3*x+1: lst:=lst union {x}:
else
x:=x/2: lst:=lst union {x}:
fi:
od:
n0:=nops(lst):
if lst intersect z = {1}
then
n1:=n0-2:
else
n1:=n0-1:
fi:
a:=0:y:=-m:
for it from 1 to 100 while (y>1) do:
if irem(y, 2)=0
then
y := y/2:a:=a+1:
else
y := 3*y+1: a := a+1:
fi:
od:
if n1=a
then
printf(`%d, `, -m):
else
fi:
od:
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Apr 05 2013
STATUS
approved