OFFSET
1,2
COMMENTS
The 3x-1 map is x -> 3x-1 if x odd, and x -> x/2 if x even (A001281).
There are no more terms < 10^9.
EXAMPLE
13 is a term because its trajectory 13 -> 38 -> 19 -> 56 -> 28 -> 14 -> ... reaches 13 + 1 = 14.
PROG
(Python)
def isok(n):
temp, loops = n, 0
while(temp != n + 1 and loops<2):
temp = temp // 2 if temp % 2 == 0 else 3 * temp - 1
if(temp == 1 or temp == 5 or temp == 17):
loops += 1
return temp == n + 1
print([n for n in range(1, 2000) if isok(n)])
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Kevin Ge, Nov 11 2024
STATUS
approved