A266238 a(n+1) = 2^(2*n - 1) + (-1)^n * a(n), a(1) = 1.
1, 1, 9, 23, 151, 361, 2409, 5783, 38551, 92521, 616809, 1480343, 9868951, 23685481, 157903209, 378967703, 2526451351, 6063483241, 40423221609, 97015731863, 646771545751, 1552251709801, 10348344732009, 24836027356823, 165573515712151, 397376437709161
Offset: 1
Examples
a(4) = 2^(2*3 - 1) + (-1)^3 * 9 = 23.
Links
- Iain Fox, Table of n, a(n) for n = 1..1662
- Iain Fox, Proof for generating function and recurrence relation
- Index entries for linear recurrences with constant coefficients, signature (0,15,0,16)
Programs
-
Maple
f:= gfun:-rectoproc({a(n) = 15*a(n-2) + 16*a(n-4),a(1)=1,a(2)=1,a(3)=9,a(4)=23},a(n),remember): map(f, [$1..50]); # Robert Israel, Dec 25 2017
-
Mathematica
RecurrenceTable[{a[1]==1,a[n+1]==2^(2n-1)+(-1)^n a[n]},a,{n,30}] (* Harvey P. Dale, Dec 20 2017 *) f[n_]:= ((7 +7I)(-I)^n + (7 -7I)*I^n +(-1)^(1 +n) 2^(2n) +2^(2 +2n))/34; Array[f, 26] (* or *) CoefficientList[ Series[ -(8x^3 -6x^2 +x +1)/(16x^4 +15x^2 -1), {x, 0, 25}], x] (* or *) LinearRecurrence[{0, 15, 0, 16}, {1, 1, 9, 23}, 26] (* Robert G. Wilson v, Dec 24 2017 *)
-
PARI
a=vector(10^3); a[1]=1; for(n=2, #a, a[n] = 2^(2*n-3)-(-1)^n*a[n-1]); a \\ Altug Alkan, Dec 20 2017
-
PARI
first(n) = Vec(x*(1 + x - 6*x^2 + 8*x^3)/((1 - 4*x)*(1 + 4*x)*(1 + x^2)) + O(x^(n+1))) \\ Iain Fox, Dec 21 2017
Formula
From Colin Barker, Dec 21 2017: (Start)
G.f.: x*(1 + x - 6*x^2 + 8*x^3) / ((1 - 4*x)*(1 + 4*x)*(1 + x^2)). [Proved by Iain Fox, Dec 21 2017]
a(n) = ((7+7*i)*(-i)^n + (7-7*i)*i^n + (-1)^(1+n)*4^n + 4^(1+n)) / 34 where i=sqrt(-1).
a(n) = 15*a(n-2) + 16*a(n-4) for n > 4. [Proved by Iain Fox, Dec 21 2017] (End)
Extensions
Corrected by Harvey P. Dale, Dec 20 2017