%I #34 Sep 08 2022 08:45:40
%S -1,-2,0,0,4,8,20,40,84,168,340,680,1364,2728,5460,10920,21844,43688,
%T 87380,174760,349524,699048,1398100,2796200,5592404,11184808,22369620,
%U 44739240,89478484,178956968,357913940,715827880
%N a(n) = (2^n + 2*(-1)^n - 6)/3.
%C The array of T(n,k) with T(0,k) = A141325(k) and successive differences T(n,k) = T(n-1,k+1) - T(n-1,k) in further rows is
%C 1, 1, 1, 1, 3, 5, 9, 13, 21, 33, 55,..
%C 0, 0, 0, 2, 2, 4, 4, 8, 12, 22,..
%C 0, 0, 2, 0, 2, 0, 4, 4, 10,...
%C 0, 2, -2, 2, -2, 4, 0, 6,..
%C 2, -4, 4, -4, 6, -4, 6,..
%C -6, 8, -8, 10, -10, 10,...
%C with T(n,n) = A078008(n), T(n,n+1) = -A167030(n), T(n,n+2) = A128209(n), T(n,n+3) = -a(n). All these sequences along the diagonals obey the recurrences a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3) and a(n) = 5*a(n-2) - 4*a(n-4).
%C Conjecture: For n >= 6, a(n) is the third largest natural number whose Collatz orbit has length n+2. - _Markus Sigg_, Sep 14 2020
%H Vincenzo Librandi, <a href="/A153772/b153772.txt">Table of n, a(n) for n = 0..1000</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (2,1,-2).
%F a(n) = A078008(n) - 2.
%F a(n) = +2*a(n-1) +a(n-2) -2*a(n-3).
%F a(n) = a(n-1) + 2*a(n-2) + 4.
%F G.f.: (1 - 5*x^2) / ( (1-x)*(2*x-1)*(1+x) ).
%F E.g.f.: (1/3)*(2*exp(-x) - 6*exp(x) + exp(2*x)). - _G. C. Greubel_, Aug 27 2016
%F a(n) = 4*A000975(n-3) for n >= 3. - _Markus Sigg_, Sep 14 2020
%t Table[(2^n + 2*(-1)^n - 6)/3, {n,0,25}] (* or *) LinearRecurrence[{2, 1, -2}, {-1, -2, 0}, 25] (* _G. C. Greubel_, Aug 27 2016 *)
%o (Magma) [2^n/3 +2*(-1)^n/3-2: n in [0..40]]; // _Vincenzo Librandi_, Aug 07 2011
%o (PARI) a(n)=(2^n+2*(-1)^n-6)/3 \\ _Charles R Greathouse IV_, Aug 28 2016
%Y Cf. A000975, A005186, A033491.
%K easy,sign
%O 0,2
%A _Paul Curtz_, Jan 01 2009