OFFSET
1,2
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..404
FORMULA
a(n) = Sum_{k = 0..floor((n-1)/2)} (-1)^k*2^(n-2*k-1)*(n-2*k-1)!*(binomial(n-k-1,k))^2. Cf. A058798. - Peter Bala, Aug 01 2013
a(n) = (Pi/2)*(Y[0, 1] * J[n, 1] - J[0, 1] * Y[n, 1]) where Y and J are Bessel functions. - Peter Luschny, Jan 30 2024
EXAMPLE
a(3)=7 because 2*2*a(2) - a(1) = 7.
MAPLE
a[1]:=1: a[2]:=2: for n from 2 to 21 do a[n+1]:=2*n*a[n]-a[n-1] od: seq(a[n], n=1..21); # Emeric Deutsch, Jul 31 2005
MATHEMATICA
nxt[{n_, a_, b_}]:={n+1, b, 2*n*b-a}; NestList[nxt, {2, 1, 2}, 20][[All, 2]] (* Harvey P. Dale, Jan 09 2021 *)
a[n_] := (Pi/2)*(BesselY[0, 1]*BesselJ[n, 1.] - BesselJ[0, 1]*BesselY[n, 1.]);
Table[Round[a[n]], {n, 1, 20}] (* Hugo Pfoertner, Feb 12 2024 *)
PROG
(Magma) I:=[1, 2]; [n le 2 select I[n] else 2*(n-1)*Self(n-1)-Self(n-2): n in [1..30]]; // Vincenzo Librandi, Aug 15 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Amarnath Murthy, May 22 2004
EXTENSIONS
Corrected and extended by Emeric Deutsch, Jul 31 2005
STATUS
approved