OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..442
MAPLE
A156626 := proc(n)
if n<=1 then
n+1 ;
elif n = 2 then
6 ;
else
2*n*procname(n-1)-(n-1)^2*procname(n-2) ;
end if;
end proc:
seq(A156626(n), n=0..20) ; # R. J. Mathar, Sep 27 2011
MATHEMATICA
Join[{1}, RecurrenceTable[{a[n] == 2*n*a[n-1] - (n-1)^2*a[n-2], a[1] == 2, a[2] == 6}, a, {n, 1, 50}]] (* G. C. Greubel, Sep 01 2018 *)
PROG
(PARI) m=30; v=concat([2, 6], vector(m-2)); for(n=3, m, v[n] = 2*n*v[n-1]-(n-1)^2*v[n-2]); concat([1], v) \\ G. C. Greubel, Sep 01 2018
(Magma) I:=[2, 6]; [1] cat [n le 2 select I[n] else 2*n*Self(n-1) - (n-1)^2*Self(n-2): n in [1..30]]; // G. C. Greubel, Sep 01 2018
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Feb 12 2009
STATUS
approved