login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 20:33 EDT 2024. Contains 371916 sequences. (Running on oeis4.)