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!)
A344935 a(0)=1; for n > 0, a(n) = n*(a(n-1) + i^(n-1)) if n is odd, n*a(n-1) + i^n otherwise, where i = sqrt(-1). 1
1, 2, 3, 6, 25, 130, 779, 5446, 43569, 392130, 3921299, 43134278, 517611337, 6728947394, 94205263515, 1413078952710, 22609263243361, 384357475137154, 6918434552468771, 131450256496906630, 2629005129938132601, 55209107728700784642, 1214600370031417262123 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
FORMULA
E.g.f.: (1+x)*cos(x)/(1-x).
Lim_{n->infinity} a(n)/n! = 2*cos(1) = 2*A049470.
D-finite with recurrence a(n) -n*a(n-1) +2*a(n-2) +2*(-n+2)*a(n-3) +a(n-4) +(-n+4)*a(n-5)=0. - R. J. Mathar, Aug 19 2022
EXAMPLE
a(0) = 1;
a(1) = 1*(a(0) + i^(1-1)) = 2;
a(2) = 2*a(1) + i^2 = 3;
a(3) = 3*(a(2) + i^2) = 6;
a(4) = 4*a(3) + i^4 = 25.
MAPLE
A344935 := proc(n)
option remember ;
if n = 0 then
1;
elif type(n, 'odd') then
n*(procname(n-1)+I^(n-1)) ;
else
n*procname(n-1)+I^n ;
end if;
simplify(%) ;
end proc:
seq(A344935(n), n=0..40) ; # R. J. Mathar, Aug 19 2022
MATHEMATICA
a[0] = 1; a[n_] := a[n] = If[OddQ[n], n*(a[n - 1] + I^(n - 1)), n*a[n - 1] + I^n]; Array[a, 30, 0] (* Amiram Eldar, Jun 03 2021 *)
PROG
(PARI) a(n) = if (n==0, 1, if (n%2, n*(a(n-1) + I^(n-1)), n*a(n-1) + I^n)); \\ Michel Marcus, Jun 05 2021
CROSSREFS
Sequence in context: A063728 A333420 A296259 * A000341 A144857 A090445
KEYWORD
nonn
AUTHOR
Amrit Awasthi, Jun 03 2021
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 May 4 02:59 EDT 2024. Contains 372225 sequences. (Running on oeis4.)