OFFSET
1,3
LINKS
Iain Fox, Table of n, a(n) for n = 1..1662
Index entries for linear recurrences with constant coefficients, signature (0,15,0,16)
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)
EXAMPLE
a(4) = 2^(2*3 - 1) + (-1)^3 * 9 = 23.
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ben Paul Thurston, Dec 25 2015
EXTENSIONS
Corrected by Harvey P. Dale, Dec 20 2017
STATUS
approved