OFFSET
1,1
COMMENTS
The initial term is not counted as an element of the trajectory.
For even n obviously a(n) <= 2n, because the halving step would reach n. - R. J. Mathar, Nov 27 2015
LINKS
Michel Lagneau, Table of n, a(n) for n = 1..5000
EXAMPLE
a(1)=2 because the number 1 is in the trajectory 2 -> 1;
a(2)=3 because the number 2 is in the trajectory 3 -> 10 -> 5 -> ... -> 2 -> 1;
a(3)=6 because the number 3 is in the trajectory 6 -> 3 -> 10 -> ... -> 1;
a(4)=3 because the number 4 is in the trajectory 3 -> 10 -> 5 -> ... -> 4 -> 2 -> 1.
MAPLE
Collatz := proc(n)
if type(n, 'even') then
n/2;
else
3*n+1 ;
end if;
end proc:
CollatzTrj := proc(x, membSrch)
local t;
t := x ;
while t <> 1 do
t := Collatz(t) ;
if t = membSrch then
return true ;
end if;
end do:
return false;
end proc:
A261814 := proc(n)
for x from 2 do
if CollatzTrj(x, n) then
return x;
end if;
end do;
end proc: # R. J. Mathar, Nov 27 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Nov 22 2015
STATUS
approved