login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A213186 For the Collatz (3x+1) iteration starting at n, number of integers k such that T(n,k) = T(n-1,k) where T(n,k) is the k-th number of the trajectory. 2

%I

%S 0,0,0,0,0,0,0,0,0,0,0,0,7,0,9,0,0,0,16,0,5,0,9,0,0,0,0,0,16,9,0,0,0,

%T 0,9,0,19,16,0,0,0,0,0,0,14,9,0,0,0,16,20,0,9,0,106,0,0,0,0,0,17,0,95,

%U 0,0,16,23,0,12,9,0,0,0,0,0,0,20,0,27,0,0,0

%N For the Collatz (3x+1) iteration starting at n, number of integers k such that T(n,k) = T(n-1,k) where T(n,k) is the k-th number of the trajectory.

%H Michel Lagneau, <a href="/A213186/b213186.txt">Table of n, a(n) for n = 1..10000</a>

%e a(13) = 7 because the Collatz iterations starting at 13 and 12 are :

%e T(13,k) =[13, 40, 20, 10, 5, 16, 8, 4, 2, 1]

%e T(12,k) =[12, 6, 3, 10, 5, 16, 8, 4, 2, 1] and the 7 common values with the same indices are :

%e T(13,4) = T(12,4) = 10 ;

%e T(13,5) = T(12,5) = 5 ;

%e T(13,6) = T(12,6) = 16 ;

%e T(13,7) = T(12,7) = 8 ;

%e T(13,8) = T(12,8) = 4 ;

%e T(13,9) = T(12,9) = 2 ;

%e T(13,10) = T(12,10) = 1.

%p nn:=200:T:=array(1..nn):U:=array(1..nn): aa:=1:

%p for i from 1 to nn do:

%p U[i]:=0:

%p od:

%p for n from 1 to nn do:

%p a:=0:k:=0:x:=n:

%p for i from 1 to 10^8 while (x>1) do:

%p if irem(x,2)=0 then

%p x := x/2:a:=a+1:k:=k+1:T[k]:=x:

%p else

%p x := 3*x+1: a := a+1: k:=k+1:T[k]:=x:

%p fi:

%p od:

%p it:=0:

%p for j from 1 to min(a,aa) do:

%p if T[j]=U[j] then

%p it:=it+1:

%p else

%p fi:

%p od:

%p for m from 1 to a do:

%p U[m]:=T[m]:

%p od:

%p aa:=a: printf(`%d, `,it):

%p od:

%Y Cf. A006577, A213185.

%K nonn

%O 1,13

%A _Michel Lagneau_, Feb 28 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 15 20:03 EDT 2021. Contains 348034 sequences. (Running on oeis4.)