login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A213185
For the Collatz (3x+1) iteration starting at n, number of integers k such that T(n,k) = T(n-1,k) +1 where T(n,k) is the k-th number of the trajectory (n is not counted).
2
0, 0, 0, 0, 0, 1, 2, 0, 0, 1, 1, 0, 0, 2, 3, 0, 0, 3, 1, 0, 0, 1, 2, 0, 0, 1, 1, 0, 0, 3, 4, 0, 0, 2, 1, 2, 0, 1, 2, 0, 0, 1, 1, 1, 0, 2, 3, 0, 0, 2, 1, 0, 0, 1, 2, 0, 0, 2, 1, 1, 0, 4, 5, 0, 0, 3, 1, 1, 0, 1, 2, 0, 0, 1, 1, 1, 0, 2, 3, 0, 0, 5, 1, 0, 0, 1, 2
OFFSET
1,7
COMMENTS
T(n,k) is periodic, for example
T(6,3) = 10 and T(7,3) = 11;
T(10,3) = 16 and T(11,3) = 17,
…………..
T(6+4m, 3) = 10 + 6m and T(6+4m+1, 3) = 10 + 6m+1.
.................
LINKS
EXAMPLE
a(7) = 2 because the Collatz iterations starting at 7 and 6 are :
T(7,k) =[7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1]
T(6,k) =[6, 3, 10, 5, 16, 8, 4, 2, 1] ; the number 7 is not counted
=> T(7,3) = T(6,3) + 1 and T(7,5) = T(6,5) + 1, hence a(7) = 2.
MAPLE
nn:=200:T:=array(1..nn):U:=array(1..nn): aa:=1:
for i from 1 to nn do:
U[i]:=0:
od:
for n from 1 to nn do:
a:=0:k:=0:x:=n:
for i from 1 to 10^8 while (x>1) do:
if irem(x, 2)=0 then
x := x/2:a:=a+1:k:=k+1:T[k]:=x:
else
x := 3*x+1: a := a+1: k:=k+1:T[k]:=x:
fi:
od:
it:=0:
for j from 1 to min(a, aa) do:
if T[j]=U[j]+1 then
it:=it+1:
else
fi:
od:
for m from 1 to a do:
U[m]:=T[m]:
od:
aa:=a: printf(`%d, `, it): od:
CROSSREFS
Sequence in context: A025442 A260118 A128582 * A285716 A101606 A257469
KEYWORD
nonn
AUTHOR
Michel Lagneau, Feb 28 2013
STATUS
approved