%I #15 Nov 15 2020 19:29:44
%S 1,6,24,98,392,1570,6280,25122,100488,401954,1607816,6431266,25725064,
%T 102900258,411601032,1646404130,6585616520,26342466082,105369864328,
%U 421479457314,1685917829256,6743671317026,26974685268104
%N a(0)=1, a(n)=4a(n-1)+2 for n odd, a(n)=4a(n-1) for n even.
%D L. Rosenfeld, Nuclear Forces, section II, Interscience, New York, 1948, p 202.
%H Harvey P. Dale, <a href="/A117614/b117614.txt">Table of n, a(n) for n = 0..1000</a>
%H <a href="/index/Rec">Index entries for linear recurrences with constant coefficients</a>, signature (4,1,-4).
%F a(n) = (-5-3*(-1)^n+23*4^n)/15. a(n) = 4*a(n-1)+a(n-2)-4*a(n-3). G.f.: -(x^2-2*x-1) / ((x-1)*(x+1)*(4*x-1)). [_Colin Barker_, Feb 17 2013]
%p a:=proc(n) if n=0 then 1 elif n mod 2 = 1 then 4*a(n-1)+2 else 4*a(n-1) fi end: seq(a(n),n=0..25);
%t b[0] := 1 b[1] := 6 b[n_?EvenQ] := b[n] = 4*b[n - 1] b[n_?OddQ] := b[n] = 4*b[n - 1] + 2 a = Table[b[n], {n, 0, 25}]
%t nxt[{n_,a_}]:={n+1,If[EvenQ[n],4a+2,4a]}; NestList[nxt,{0,1},30][[All,2]] (* or *) LinearRecurrence[{4,1,-4},{1,6,24},30] (* _Harvey P. Dale_, Nov 15 2020 *)
%K nonn,easy
%O 0,2
%A _Roger L. Bagula_, Apr 07 2006
%E Edited by _N. J. A. Sloane_, Apr 16 2006