cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A306150 Row sums of A306015.

This page as a plain text file.
%I A306150 #17 Sep 08 2022 08:46:21
%S A306150 0,2,4,14,56,282,1692,11846,94768,852914,8529140,93820542,1125846504,
%T A306150 14636004554,204904063756,3073560956342,49176975301472,
%U A306150 836008580125026,15048154442250468,285914934402758894,5718298688055177880,120084272449158735482,2641853993881492180604
%N A306150 Row sums of A306015.
%C A306150 a(n) is the number of nonderangements of size n in which each fixed point is colored red or blue. For example, with n = 3, the derangements are 231 and 312 and they don't count, the permutations 132, 321, 213 each have 1 fixed point and hence 2 colorings, and the identity 123 with 3 fixed points has 8 colorings, yielding a(3) = 3*2 + 8 = 14 colorings altogether. - _David Callan_, Dec 19 2021
%H A306150 G. C. Greubel, <a href="/A306150/b306150.txt">Table of n, a(n) for n = 0..448</a>
%F A306150 a(n) = e * Gamma(n + 1, 1) - !(n).
%F A306150 a(n) = Gamma(n + 1, 1) * e - Gamma(n + 1, -1) / e.
%F A306150 a(n) = n*a(n-1) + a(n-2) - (n-2)*a(n-3) for n >= 3.
%F A306150 a(n) = n! [x^n] 2*sinh(x)/(1-x).
%F A306150 a(n) = 2*A186763(n) = (-1)^(n+1)*2*A009628(n) = A000522(n) - A000166(n).
%p A306150 egf := 2*sinh(x)/(1-x): ser := series(egf,x,24):
%p A306150 seq(n!*coeff(ser,x,n), n=0..22);
%t A306150 Table[Exp[1] Gamma[n+1, 1] - Subfactorial[n], {n, 0, 22}]
%t A306150 With[{nmax = 50}, CoefficientList[Series[2*Sinh[x]/(1 - x), {x, 0, nmax}], x]*Range[0, nmax]!] (* _G. C. Greubel_, Jul 18 2018 *)
%o A306150 (Sage)
%o A306150 @cached_function
%o A306150 def a(n):
%o A306150     if n<3: return 2*n
%o A306150     return n*a(n-1)+a(n-2)-(n-2)*a(n-3)
%o A306150 [a(n) for n in (0..22)]
%o A306150 (PARI) x='x+O('x^30); concat([0], Vec(serlaplace(2*sinh(x)/(1 - x)))) \\ _G. C. Greubel_, Jul 18 2018
%o A306150 (Magma) m:=30; R<x>:=PowerSeriesRing(Rationals(), m); b:= [0] cat Coefficients(R!(2*Sinh(x)/(1-x))); [Factorial(n-1)*b[n]: n in [1..m]]; // _G. C. Greubel_, Jul 18 2018
%Y A306150 Cf. A000166, A000522, A009628, A186763.
%Y A306150 Cf. A306015.
%K A306150 nonn
%O A306150 0,2
%A A306150 _Peter Luschny_, Jun 23 2018