login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A142722
a(0)=a(1)=1 and a(n) = -(2*n-1)*a(n-1) + a(n-2) for n>=2.
0
1, 1, -2, 11, -79, 722, -8021, 104995, -1582946, 27015077, -514869409, 10839272666, -249818140727, 6256292790841, -169169723493434, 4912178274100427, -152446696220606671, 5035653153554120570, -176400307070614826621, 6531847014766302705547
OFFSET
0,3
MAPLE
a:= proc(n) if n<2 then 1 else a(n) := -(2*n-1)*a(n-1) + a(n-2) fi end:
seq (a(n), n=0..25); # Sergei N. Gladkovskii, Jul 04 2012
MATHEMATICA
k = 2; b[0] = 1; b[n_] := b[n] = b[n - 1] + k
M[0] := {{-b[n], -1}, {1, 0}};
M[1] := {{-b[n], 1}, {-1, 0}};
v[0] = {1, 1};
v[n_] := v[n] = M[Mod[n, 2]].v[n - 1];
Table[v[n][[1]], {n, 1, 30}]
RecurrenceTable[{a[0]==a[1]==1, a[n]==-(2n-1)a[n-1]+a[n-2]}, a, {n, 20}] (* Harvey P. Dale, May 08 2019 *)
PROG
(PARI)
a(n)= if ( n<=1, 1, -(2*n-1)*a(n-1) + a(n-2) );
/* note this is inefficient, optimize using memoization: */
v=vector(66); v[1]=1; v[2]=1; /* PARI's vectors are one-based */
for (n=3, #v, v[n] = -(2*n-3)*v[n-1] + v[n-2]);
v /* show terms */
/* Joerg Arndt, Jul 023 2012 */
CROSSREFS
Sequence in context: A154273 A253256 A163203 * A320095 A099661 A027110
KEYWORD
sign
AUTHOR
STATUS
approved