%I #33 Sep 09 2017 16:18:29
%S 0,0,0,1,18,20,0,3,11,15,18,23,111,117,0,7,130,138,11,20,96,106,18,29,
%T 38,50,111,124,267,281,0,15,73,89,130,147,194,212,11,30,43,63,96,117,
%U 236,258,18,41,245,269,38,63,40563,40589,111,138,155,183,267,296
%N Sums of positive differences and negated sums of negative differences in the Collatz trajectory of n.
%C For each number n, we consider the Collatz trajectory represented by the ordered sequence {x(i)}, i = 1, 2, ..., r starting with x(1) = n and ending with x(r) = 1. Let d(i) be the difference x(i+1) - x(i). This sequence lists the pairs of positive integers (u, -v) such that u is the sum of all the positive differences and v is the sum of all the negative differences.
%C I present an interesting conjecture because of the linearity of the result.
%C Conjecture: a(2n) - a(2n-1) = n - 1.
%C Another definition:
%C Consider F(x) the 3x + 1 function iterates (x, T(x), T(T(x)), ..., 4, 2, 1) plotted on standard vertical and horizontal scale where each point (0, x), (1, T(x)), (2, T(T(x)), ..., (r, 1) is connected to the next by a straight line with r being the number of iterations needed to reach 1. Let F'(x) be the derivative of F(x). The sequence lists the pairs of integers (u, -v) such that u is the sum of the positive values of F'(x) and v is the sum of the negative values of F'(x) at x = 1, 2, ..., r.
%C Property: a(2^n - 1) = 0. In the general case, if m is an odd integer, a(m) = q => a(m*2^r + 2^r - 1) = q, r = 0,1,2,..
%C Example: for m = 5, a(5)=18 => a(11) = a(23) = a(47) = a(95) = ... = 18.
%H Michel Lagneau, <a href="/A265946/b265946.txt">Table of n, a(n) for n = 1..10000</a>
%e n=3 => (a(2n-1), a(2n)) = (a(5),a(6)) = (18,20) because the Collatz trajectory of 3 is 3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1. The sum of the positive differences is u = (10 - 3) + (16 - 5) = 18 and the sum of the negative differences is u = (5 - 10) + (8 - 16) + (4 - 8) + (2 - 4) + (1 - 2)= -20 with the property a(6) - a(5) = 3 - 1 = 2.
%p T:=array(1..1000):nn:=1000:
%p for n from 1 to 100 do:
%p kk:=1:m:=n:T[kk]:=n:it:=0:
%p for i from 1 to nn while(m<>1) do:
%p if irem(m,2)=0
%p then
%p m:=m/2:kk:=kk+1:T[kk]:=m:it:=it+1:
%p else
%p m:=3*m+1:kk:=kk+1:T[kk]:=m:it:=it+1:
%p fi:
%p od:
%p jj:=0:s1:=0:s2:=0:
%p for j from 1 to it do:
%p if T[j]<T[j+1] then s1:=s1+T[j+1]-T[j]:
%p else
%p s2:=s2+T[j]-T[j+1]:fi:
%p od:
%p printf(`%d, `,s1):printf(`%d, `,s2):
%p od:
%Y Cf. A006577.
%K nonn
%O 1,5
%A _Michel Lagneau_, Dec 23 2015