%I #91 Feb 27 2024 01:33:17
%S 2,5,9,19,37,75,149,299,597,1195,2389,4779,9557,19115,38229,76459,
%T 152917,305835,611669,1223339,2446677,4893355,9786709,19573419,
%U 39146837,78293675,156587349,313174699,626349397,1252698795,2505397589
%N a(n) = 2*a(n-1) - (-1)^n for n > 0, a(0)=2.
%C Let A be the Hessenberg matrix of order n, defined by: A[1,j] = A[i,i] = 1, A[i,i-1] = -1, and A[i,j] = 0 otherwise. Then, for n>=1, a(n-1) = charpoly(A,3). - _Milan Janjic_, Jan 24 2010
%D T. Koshy, Fibonacci and Lucas numbers with applications, Wiley, 2001, p. 98.
%H Harry J. Smith, <a href="/A062092/b062092.txt">Table of n, a(n) for n = 0..200</a>
%H Petro Kosobutskyy, <a href="https://arxiv.org/abs/2306.14635">The Collatz problem as a reverse n->0 problem on a graph tree formed from theta*2^n Jacobsthal-type numbers</a>, arXiv:2306.14635 [math.GM], 2023.
%H Petro Kosobutskyy and Dariia Rebot, <a href="https://doi.org/10.23939/cds2023.01.137">Collatz conjecture 3n+/-1 as a Newton binomial problem</a>, Comp. Des. Sys. Theor. Prac., Lviv Nat'l Polytech. Univ. (Ukraine 2023) Vol. 5, No. 1, 137-145. See p. 140.
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (1,2).
%F a(n) = a(n-1) + 2*a(n-2).
%F a(n) = (7*2^n - (-1)^n)/3.
%F a(n) = 2^(n+1) + A001045(n).
%F A002487(a(n)) = A000032(n+1).
%F G.f.: (2+3*x)/(1-x-2*x^2).
%F E.g.f.: (7*exp(2*x) - exp(-x))/3.
%F a(n) = Sum_{j=0..2} A001045(n-j) (sum of 3 consecutive elements of the Jacobsthal sequence). - _Alexander Adamchuk_, May 16 2006
%F From _Paul Curtz_, Jun 03 2022: (Start)
%F a(n) = A001045(n+3) - A078008(n).
%F a(n) = A078008(n+3) - A001045(n).
%F a(n) = A005009(n-1) - a(n-1) for n >= 1.
%F a(n) = a(n-2) + A005009(n-2) for n >= 2.
%F a(n) = A154879(n-2) + 3*A201630(n-2) for n >= 2. (End)
%t LinearRecurrence[{1, 2}, {2, 5}, 40] (* _Jean-François Alcover_, Aug 02 2021 *)
%o (PARI) a(n) = (7*2^n - (-1)^n)/3; \\ _Harry J. Smith_, Aug 01 2009
%o (Magma) [(7*2^n-(-1)^n)/3: n in [0..40]]; // _G. C. Greubel_, Apr 04 2023
%o (SageMath) [(7*2^n-(-1)^n)/3 for n in range(41)] # _G. C. Greubel_, Apr 04 2023
%Y Cf. A000032, A001045, A002487, A005009, A078008, A154879, A201630.
%Y Cf. A171160 (first differences).
%K nonn,easy
%O 0,1
%A _Amarnath Murthy_, Jun 16 2001
%E More terms from _Jason Earls_, Jun 18 2001
%E Additional comments from _Michael Somos_, Jun 24 2002