  The sequence of derangements is given by the formula $D_0 = 1, D_n = nD_{n-1}
+ (-1)^n, n>0$. It is a classical object appearing in combinatorics and number
theory. In this paper we consider two classes of sequences: first class is
given by the formulae $a_0 = h_1(0), a_n = f(n)a_{n-1} + h_1(n)h_2(n)^n, n>0$,
where $f,h_1,h_2 \in\mathbb{Z}[X]$, and the second one is defined by $a_n =
\sum_{j=0}^n \frac{n!}{j!} h(n)^j, n\in\mathbb{N}$, where $h\in\mathbb{Z}[X]$.
Both classes are a generalization of the sequence of derangements. We study
such arithmetic properties of these sequences as: periodicity modulo $d$, where
$d\in\mathbb{N}_+$, $p$-adic valuations, asymptotics, boundedness, periodicity,
recurrence relations and prime divisors. Particularly we focus on the
properties of the sequence of derangements and use them to establish arithmetic
properties of the sequences of even and odd derangements.
