OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..450
David Harry Richman and Andrew O'Desky, Derangements and the p-adic incomplete gamma function, arXiv:2012.04615 [math.NT], 2020.
FORMULA
MAPLE
a:= proc(n) option remember; `if`(n=0, 1, add(`if`(issqr(j), 0,
a(n-j)*binomial(n-1, j-1)*(j-1)!), j=1..n))
end:
seq(a(n), n=0..25);
MATHEMATICA
a[n_] := a[n] = If[n == 0, 1, Sum[If[IntegerQ@Sqrt[j], 0,
a[n-j] Binomial[n-1, j-1] (j-1)!], {j, 1, n}]];
Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Oct 31 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Nov 24 2019
STATUS
approved