1 Introduction

The classification of low-dimensional Lie algebras is one of the fundamental issues in Lie algebras theory. The classification of Lie algebras can be found in many books and papers. In 1950 Morozov [11] proposed a classification of six-dimensional nilpotent Lie algebras over fields of characteristic zero. The classification of the six-dimensional Lie algebras on the arbitrary field was shown by Cicalo et al. [4]. Moreover, the seven-dimensional nilpotent Lie algebras over algebraically closed fields and real number field were classified in [9]. In 1985, Filippov [8] introduced the notion of n-Lie algebras. A nonsymmetrical linear vector space A is called an n-Lie algebra if it satisfies the following Jacoby identity:

$$\begin{aligned} \left[ \left[ {{x}_{1}},{{x}_{2}},\ldots ,{{x}_{n}} \right] ,{{y}_{2}},\ldots ,{{y}_{n}} \right] =\sum \limits _{i=1}^{n}{\left[ {{x}_{1}},\ldots ,{{x}_{i-1}},\left[ {{x}_{i}},{{y}_{2}},\ldots ,{{y}_{n}} \right] ,{{x}_{i+1}},\ldots ,{{x}_{n}} \right] } \end{aligned}$$

for all \({{x}_{i}},{{y}_{j}}\in A\,,\,1\le i\le n\), \(2\le j\le n\). He also classified n-Lie algebras of dimensions n and \(n+1\) on the algebraically closed field with characteristic zero.

In 2008, Bai et al. [2] classified n-Lie algebras of dimension \(n+1\) on fields of characteristic two. Then, Bai et al. [1] classified n-Lie algebras of dimension \(n+2\) on the algebraically closed fields with characteristic zero.

Assume that \(A_1,\ldots ,A_n\) are subalgebras of an n-Lie algebra A. Then, the subalgebra of A generated by all vectors \([ {{x}_{1}},\ldots ,{{x}_{n}} ]( {{x}_{i}}\in {{A}_{i}} )\) will be represented by the symbol \([ {{A}_{1}},\ldots ,{{A}_{n}} ]\). The subalgebra \({{A}^{2}}=[ A,\ldots ,A ]\) is called derived n-Lie algebra of A. The center of n-Lie algebra A is defined as follows:

$$\begin{aligned} Z\left( A \right) =\left\{ x\in A:\left[ x,A,\ldots ,A \right] =0 \right\} . \end{aligned}$$

Assume that \({{Z}_{0}}\left( A \right) =0\); then the ith center of A is defined inductively as

$$\begin{aligned} {{{Z}_{i}}\left( A \right) }/{{{Z}_{i-1}}\left( A \right) }\;=Z\left( {A}/{{{Z}_{i-1}}\left( A \right) }\; \right) \qquad \text { for all }\quad i\ge 1. \end{aligned}$$

The notion of nilpotent n-Lie algebra was defined by Kasymov [10] as follows. We say that an n-Lie algebra A is nilpotent if \({{A}^{s}}=0\), where s is a non-negative integer number. Note that \({{A}^{i}}\) is defined as induction by \({{A}^{1}}=A\,\,,\,{{A}^{i+1}}=[ {{A}^{i}},A,\ldots ,A ]\). The n-Lie algebra A is nilpotent of class c if \({{A}^{c+1}}=0\) and \({{A}^{i}}\ne 0\) for each \(i\le c\), ( for more information see [3, 12]).

An important category of n-Lie algebras of class 2, which plays an important role in nilpotent n-Lie algebras, is the Heisenberg n-Lie algebras. We call n-Lie algebra A, generalized Heisenberg of rank k, if \({{A}^{2}}=Z(A)\) and \(\dim {{A}^{2}}=k\). In [6], the authors studied the case when \(k=1\), which is called later special Heisenberg n-Lie algebras.

The rest of our paper is organized as follows. Section 2 includes the results that are used frequently in the next section. In Sect.  3, we classify \((n+5)\)-dimensional n-Lie algebras of class two.

2 Preliminaries

In this section, we introduce some known and necessary results.

Theorem 2.1

[6] Every special Heisenberg n-Lie algebra has dimension \(mn+1\) for some natural number m, and it is isomorphic to

$$\begin{aligned} H\left( n,m \right) =\langle x,{{x}_{1}},\ldots ,{{x}_{nm}}:[ {{x}_{n\left( i-1 \right) +1}},{{x}_{n\left( i-1 \right) +2}},\ldots ,{{x}_{ni}} ]=x,i=1,\ldots ,m \rangle . \end{aligned}$$

Theorem 2.2

[5] Let A be a d-dimensional nilpotent n-Lie algebra, and let \(\dim {{A}^{2}}=~1\). Then, for some \(m\ge 1\),

$$\begin{aligned} A\cong H\left( n,m \right) \oplus F\left( d-mn-1 \right) . \end{aligned}$$

in which \(F(d-n-1)\) is the abelian n-Lie algebra of dimension \(d-n-1\).

Theorem 2.3

[5] Let A be a nilpotent n-Lie algebra of dimension \(d=n+k\) for \(3\le k\le n+1\) such that \({{A}^{2}}=Z\left( A \right) \) and \(\dim {{A}^{2}}=2\). Then,

$$\begin{aligned} A\cong \langle {{e}_{1}},\ldots ,{{e}_{n+k}}:[ {{e}_{k-1}},\ldots ,{{e}_{n+k-2}} ]={{e}_{n+k}},[ {{e}_{1}},\ldots ,{{e}_{n}} ]={{e}_{n+k-1}} \rangle . \end{aligned}$$

Theorem 2.4

[5] Let A be a nonabelian nilpotent n-Lie algebra of dimension \(d\le n+2\). Then A is isomorphic to \(H\left( n,1 \right) ,\ H\left( n,1 \right) \oplus F\left( 1 \right) ,\) or \({{A}_{n,n+2,1}}\), where \(A_{n,n+2,1}=\langle e_1,\ldots ,e_{n+2}:[e_1,\ldots ,e_n]=e_{n+1},[e_2,\ldots ,e_{n+1}]=e_{n+2}\rangle \).

For unification of notation, in what follows the tth d-dimensional n-Lie algebra will be denoted by \(A_{n,d,t}\).

Theorem 2.5

[4]

  1. (1)

    Over a field F of characteristic different from 2, the following is the list of the isomorphisms types of six-dimensional nilpotent Lie algebras:

    • \(L_{5,k}\oplus F\) with \(k\in \{1,\ldots ,9\}\);

    • \(L_{6,k}\) with \(k\in \{10,\ldots ,18,20,23,25,\ldots ,28\}\);

    • \(L_{6,k}(\varepsilon _1)\) with \(k\in \{19,21\}\) and \(\varepsilon _1\in F^*/(\overset{*}{\mathop \sim })\);

    • \(L_{6,k}(\varepsilon _2)\) with \(k\in \{22,24\}\) and \(\varepsilon _2\in F/(\overset{*}{\mathop \sim })\).

  2. (2)

    Over a field F of characteristic 2, the isomorphism types of six-dimensional nilpotent Lie algebras are

    • \(L_{5,k}\oplus F\) with \(k\in \{1,\ldots ,9\},\)

    • \(L_{6,k}\) with \(k\in \{10,\ldots ,18,20,23,25,\ldots ,28\}\),

    • \(L_{6,k}(\varepsilon _1)\) with \(k\in \{19,21\}\) and \(\varepsilon _1\in F^*/(\overset{*}{\mathop \sim })\),

    • \(L_{6,k}(\varepsilon _2)\) with \(k\in \{22,24\}\) and \(\varepsilon _2\in F/(\overset{*+}{\mathop \sim })\),

    • \(L_{6,k}^{(2)}\) with \(k\in \{1,2,5,6\}\),

    • \(L_{6,k}^{(2)}(\varepsilon _3)\) with \(k\in \{3,4\}\) and \(\varepsilon _3\in F^*/(\overset{*+}{\mathop \sim })\),

    • \(L_{6,k}^{(2)}(\varepsilon _4)\) with \(k\in \{7,8\}\) and \(\varepsilon _4\in \{0,\omega \}\).

Eshrati et al. [7] classified \((n+3)\)-dimensional nilpotent n-Lie algebras for \(n>2\). Additionally, they proved the following theorem for \((n+4)\)-dimensional n-Lie algebras.

Theorem 2.6

[7] The only \((n+4)\)-dimensional nilpotent n-Lie algebras of class two are \( H(n,1)\oplus F(3),\ A_{n,n+4,1},\ A_{n,n+4,2},\ A_{n,n+4,3},\ H(2,2)\oplus F(1),\ H(3,2), L_{6,22}^{{}}\left( \varepsilon \right) ,\) and \(L_{6,7}^{2}(\eta ).\)

Theorem 2.7

[9] The seven-dimensional nilpotent Lie algebras of class two over algebraically closed fields and real number field are

$$\begin{aligned} H(2,1)\oplus F(4),\quad H(2,2)\oplus F(2),\quad H(2,3),\quad \text {and }\,\, L_{7,i},\quad 1 \le i \le 10. \end{aligned}$$

3 Main Results

In this section, we classify \((n+5)\)-dimensional nilpotent n-Lie algebras of class two. An n-Lie algebra A is nilpotent of class two, when A is nonabelian and \({{A}^{2}}\subseteq Z\left( A \right) \). The nilpotent n-Lie algebra of class two plays an essential role in some geometry problems such as the commutative Riemannian manifold. Additionally, the classification of nilpotent Lie algebras of class two is one of the most important issues in Lie algebras.

We first prove a lemma for three-Lie algebras.

Lemma 3.1

Let A be a three-Lie algebra of dimension eight such that \({{A}^{2}}=Z\left( A \right) \) and \(\dim {{A}^{2}}=2\). Then,

$$\begin{aligned} A=\left\langle e_1,\ldots ,e_8:[e_1,e_2,e_3]=e_7,[e_4,e_5,e_6]=e_8 \right\rangle . \end{aligned}$$

Proof

Let \(A=\left\langle {{e}_{1}},\ldots ,{{e}_{8}} \right\rangle \), and let \({{A}^{2}}=Z\left( A \right) =\left\langle {{e}_{7}},{{e}_{8}} \right\rangle \). We may assume that \(\left[ {{e}_{4}},{{e}_{5}},{{e}_{6}} \right] ={{e}_{8}}\). So, there are \(\alpha _0,\beta _0, \alpha _{i,j,k},\) and \(\beta _{i,j,k}\) of the field F such that

$$\begin{aligned} \left\{ \begin{array}{lr} \left[ {{e}_{1}},{{e}_{2}},{{e}_{3}} \right] ={{\alpha }_{0}}{{e}_{8}}+{{\beta }_{0}}{{e}_{7}}&{} \\ \left[ {{e}_{i}},{{e}_{j}},{{e}_{k}} \right] ={{\alpha }_{i,j,k}}{{e}_{8}}+{{\beta }_{i,j,k}}{{e}_{7}},&{}\text {}1\le i<j<k\le 6,\left( i,j,k \right) \ne \left( 1,2,3 \right) ,\left( 4,5,6 \right) . \\ \end{array} \right. \end{aligned}$$

Taking \(I=\left\langle {{e}_{7}} \right\rangle \), \(\dim {{\left( {A}/{I}\; \right) }^{2}}=1\). Therefore, by Theorem 2.2, \({A}/{I}\;\) is isomorphic to \(H\left( 3,1 \right) \oplus F\left( 3 \right) \) or \(H\left( 3,2 \right) \,\).

(i) Assume that \({A}/{I}\;\cong H\left( 3,1 \right) \oplus F\left( 3 \right) \). In this case, according to the structure of \({A}/{I}\;\), we have \({{\alpha }_{0}}={{\alpha }_{i,j,k}}=0\). Therefore, the brackets of A are as follows:

$$\begin{aligned} {\left\{ \begin{array}{ll} {}[e_4,e_5,e_6]=e_8, \quad \quad [e_1,e_2,e_3]=\beta _0e_7,&{}\\ {}[e_i,e_j,e_k]=\beta _{i,j,k}e_7, \quad \quad 1\le i<j<k\le 6,(i,j,k)\ne (1,2,3),(4,5,6). \end{array}\right. } \end{aligned}$$

Now, by choosing \(J=\left\langle {{e}_{8}} \right\rangle \), and by taking into account \(\dim {{\left( {A}/{J}\; \right) }^{2}}=1\), we have

$$\begin{aligned} A/J \cong \langle \overline{e}_1,\ldots ,\overline{e}_7\ :[\overline{e}_1,\overline{e}_2, \overline{e}_3]=\beta _0\overline{e}_7,\ [\overline{e}_i,\overline{e}_j,\overline{e}_k]=\beta _{i,j,k}\overline{e}_7 \rangle \end{aligned}$$

for \(1\le i<j<k\le 6, (i,j,k)\ne (1,2,3),(4,5,6)\).

According to the above brackets and special Heisenberg n-Lie algebra, A / J is isomorphic to \(H\left( 3,1 \right) \oplus F\left( 3 \right) \). So, only one of \({{\beta }_{0}}\) and \({{\beta }_{i,j,k}}\) is equal to one and the other coefficients are zero.

If one of the coefficients \({{\beta }_{i,j,k}}\) is equal to one, then the condition \({{A}^{2}}=Z\left( A \right) \) will be false. So, we conclude \(\beta _{i,j,k}=0\) for each \(1\le i<j<k\le 6,\text { }\left( i,j,k \right) \ne \left( 1,2,3 \right) ,\left( 4,5,6 \right) \). Thus,

$$\begin{aligned} A= \langle e_1,...,e_8:[e_1,e_2,e_3]=e_8,[e_4,e_5,e_6]=e_7 \rangle . \end{aligned}$$
(1)

(ii) Consider \({A}/{I}\;\cong H\left( 3,2 \right) \). According to the structure of \({A}/{I}\;\), we have \({{\alpha }_{0}}=1\) and \({{\alpha }_{i,j,k}}=0\). Therefore, the brackets of A

$$\begin{aligned} {\left\{ \begin{array}{ll} {}[e_4,e_5,e_6]=e_8, \quad \quad [e_1,e_2,e_3]=e_8+\beta _0e_7,&{}\\ {}[e_i,e_j,e_k]=\beta _{i,j,k}e_7, \quad \quad 1\le i<j<k\le 6,\ (i,j,k)\ne (1,2,3),(4,5,6). \end{array}\right. } \end{aligned}$$

Now, by choosing \(J=\left\langle {{e}_{8}} \right\rangle \), we have \(\dim {{\left( {A}/{J}\; \right) }^{2}}=1\). Hence, with respect to the structure of special Heisenberg n-Lie algebras, this algebra is isomorphic to \(H\left( 3,1 \right) \oplus F\left( 3 \right) \). Thus, only one of coefficients \( \beta _0\) and \(\beta _{i,j,k}\) is equal to one and the other coefficients are zero. Of course, if one of the coefficients \({{\beta }_{i,j,k}}\) is equal to one, we have a contradiction. So, we have \({{\beta }_{i,j,k}}=0\) for each \(1\le i<j<k\le 6,\left( i,j,k \right) \ne \left( 1,2,3 \right) ,\left( 4,5,6 \right) \). As a result, the brackets of A are as follows:

$$\begin{aligned} \left[ {{e}_{4}},{{e}_{5}},{{e}_{6}} \right] ={{e}_{8}},\qquad \left[ {{e}_{1}},{{e}_{2}},{{e}_{3}} \right] ={{e}_{8}}+{{e}_{7}}. \end{aligned}$$

By interchanging

$$\begin{aligned} e'_i=e_i,\quad 1\le i\le 8, i \ne 7, \quad \quad e'_7=e_8+e_7, \end{aligned}$$

this algebra is isomorphic to A in relation (1). Consequently, the proof is completed. \(\square \)

Now, we are going to classify \((n+5)\)-dimensional nilpotent n-Lie algebras of class two.

Assume that A is an \((n+5)\)-dimensional nilpotent n-Lie algebra of class two, where \(n\ge 3\) and \(A=\left\langle {{e}_{1}},\ldots ,{{e}_{n+5}} \right\rangle \) (see Theorem 2.7 for the case \(n=2\)). If \(\dim {{A}^{2}}=1\), then by Theorem 2.2, A is isomorphic to one of the following algebras:

$$\begin{aligned} H\left( n,1 \right) \oplus F\left( 4 \right) ,\quad H\left( 3,2 \right) \oplus F\left( 1 \right) ,\quad H\left( 4,2 \right) . \end{aligned}$$

Now, assume that \(\dim {{A}^{2}}\ge 2\) and that \(\left\langle {e_{n+4}},{e_{n+5}} \right\rangle \subseteq {{A}^{2}}\). Ergo, \({A}/{\left\langle {{e}_{n+5}} \right\rangle }\;\) is an \((n+4)\)-dimensional nilpotent n-Lie algebra of class 2. It follows from Theorem 2.6 that \({A}/{\left\langle {{e}_{n+5}} \right\rangle }\;\) is one of the following forms:

$$\begin{aligned} H\left( n,1 \right) \oplus F\left( 3 \right) ,\quad {A}_{n,n+4,1},\quad {A}_{n,n+4,2},\quad {{A}_{n,n+4,3}},\quad H\left( 3,2 \right) . \end{aligned}$$

Case 1\(A/\langle e_{n+5}\rangle \cong \langle \overline{e}_1,\ldots ,\overline{e}_{n+4}:[\overline{e}_1,\ldots ,\overline{e}_n]=\overline{e}_{n+4}\rangle \cong H(n,1) \oplus F(3)\).

The brackets of A are as follows:

$$\begin{aligned} \left\{ \begin{array}{ll} \ [e_1,\ldots ,e_n]=e_{n+4}+\alpha e_{n+5},&{} \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{e}_{n}},{{e}_{n+1}} \right] ={{\alpha }_{i}}{{e}_{n+5}},&{}1\le i\le n, \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{e}_{n}},{{e}_{n+2}} \right] ={{\beta }_{i}}{{e}_{n+5}},&{}1\le i\le n, \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{e}_{n}},{{e}_{n+3}} \right] ={{\gamma }_{i}}{{e}_{n+5}},&{}1\le i\le n, \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{{\hat{e}}}_{j}},\ldots ,{{e}_{n}},{{e}_{n+1}},{{e}_{n+2}} \right] ={{\theta }_{ij}}{{e}_{n+5}},&{}1\le i<j\le n, \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{{\hat{e}}}_{j}},\ldots ,{{e}_{n}},{{e}_{n+1}},{{e}_{n+3}} \right] ={{\mu }_{ij}}{{e}_{n+5}},&{}1\le i<j\le n, \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{{\hat{e}}}_{j}},\ldots ,{{e}_{n}},{{e}_{n+2}},{{e}_{n+3}} \right] ={{\lambda }_{ij}}{{e}_{n+5}},&{}1\le i<j\le n, \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{{\hat{e}}}_{j}},\ldots ,{{{\hat{e}}}_{k}},\ldots ,{{e}_{n}},{{e}_{n+1}},{{e}_{n+2}},{{e}_{n+3}} \right] ={{\zeta }_{ijk}}{{e}_{n+5}},&{}1\le i<j<k\le n. \\ \end{array}\right. \end{aligned}$$

By changing the base, we can have \(\alpha =0\). Since \(\dim {{A}^{2}}\ge 2\), we obtain \(\dim Z\left( A \right) \le 4\).

First, we assume that \(\dim Z\left( A \right) =4\). In this case, without loss of generality, we can assume that \(Z\left( A \right) =\left\langle {{e}_{n+2}},{{e}_{n+3}},{{e}_{n+4}},{{e}_{n+5}} \right\rangle \). Consequently, the nonzero brackets of A are as follows:

$$\begin{aligned} \left\{ \begin{array}{ll} \ [e_1,\ldots ,e_n]=e_{n+4},&{} \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{e}_{n}},{{e}_{n+1}} \right] ={{\alpha }_{i}}{{e}_{n+5}},&{}\text { }1\le i\le n. \\ \end{array}\right. \end{aligned}$$

At least one of the \({{\alpha }_{i}}\)s is nonzero. Without loss of generality, we can assume that \({{\alpha }_{1}}\ne 0\). We replace \(e_1\) with \(e_1+\sum _{i=2}^n(-1)^{i-1}\frac{\alpha _i}{\alpha _1}e_i\) and \(e_{n+5}\) with \(\alpha _1e_{n+5}\); we have

$$\begin{aligned} \,[{{e}_{1}},\ldots ,{{e}_{n}}]={{e}_{n+4}},\qquad [{{e}_{2}},\ldots ,{{e}_{n+1}} ]={{e}_{n+5}}. \end{aligned}$$

We denote this algebra by \({{A}_{n,n+5,1}}\). Now, suppose that \(\dim Z\left( A \right) =3\). Without loss of generality, we assume that \(Z\left( A \right) =\left\langle {{e}_{n+3}},{{e}_{n+4}},{{e}_{n+5}} \right\rangle \). Therefore, the brackets of A are as follows:

$$\begin{aligned} \left\{ \begin{array}{ll} \left[ {{e}_{1}},\ldots ,{{e}_{n}} \right] ={{e}_{n+4}},&{} \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{e}_{n}},{{e}_{n+1}} \right] ={{\alpha }_{i}}{{e}_{n+5}},&{}\text { }1\le i\le n, \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{e}_{n}},{{e}_{n+2}} \right] ={{\beta }_{i}}{{e}_{n+5}},&{}\text { }1\le i\le n, \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{{\hat{e}}}_{j}},\ldots ,{{e}_{n}},{{e}_{n+1}},{{e}_{n+2}} \right] ={{\theta }_{ij}}{{e}_{n+5}},&{}\text { }1\le i<j\le n. \\ \end{array}\right. \end{aligned}$$

Since \(\dim {{\left( {A}/{\left\langle {{e}_{n+4}} \right\rangle }\; \right) }^{2}}=1\), we have \({A}/{\left\langle {{e}_{n+4}} \right\rangle }\;\cong H\left( n,1 \right) \oplus F\left( 3 \right) \). According to the structure of n-Lie algebras, we conclude that one of the coefficients

$$\begin{aligned} {{\theta }_{ij}}\left( 1\le i<j\le n \right) ,\quad {{\beta }_{i}}\left( 1\le i\le n \right) ,\quad {{\alpha }_{i}}\left( 1\le i\le n \right) \end{aligned}$$

is equal to one, and the others are zero. According to \(Z\left( A \right) =\left\langle {{e}_{n+3}},{{e}_{n+4}},{{e}_{n+5}} \right\rangle \), the coefficients of \({{\beta }_{i}}\left( 1\le i\le n \right) ,\text { and }{{\alpha }_{i}}\left( 1\le i\le n \right) \) cannot be equal to one. Without loss of generality, assume that

$$\begin{aligned} \begin{array}{lcllcl} {{\theta }_{12}}&{}=&{}1,&{}\qquad {{\theta }_{ij}}&{}=&{}0\quad \left( 1\le i<j\le n,\left( i,j \right) \ne \left( 1,2 \right) \right) \\ {{\beta }_{i}}&{}=&{}0\quad \left( 1\le i\le n \right) &{}\qquad {{\alpha }_{i}}&{}=&{}0\quad \left( 1\le i\le n \right) .\end{array} \end{aligned}$$

So, the brackets of A are as follows:

$$\begin{aligned} \left[ {{e}_{1}},\ldots ,{{e}_{n}} \right] ={{e}_{n+4}},\qquad \left[ {{e}_{3}},\ldots ,{{e}_{n+2}} \right] ={{e}_{n+5}}. \end{aligned}$$

We denote this algebra by \({{A}_{n,n+5,2}}\).

Now, assume that \(\dim Z\left( A \right) =2\). Therefore, \(Z\left( A \right) =A^2\). In the case \(n\ge 4\), using Theorem 2.3, the brackets of A are as follows:

$$\begin{aligned} \left[ {{e}_{1}},\ldots ,{{e}_{n}} \right] ={{e}_{n+5}},\qquad \left[ {{e}_{4}},\ldots ,{{e}_{n+3}} \right] ={{e}_{n+4}}. \end{aligned}$$

We denote this algebra by \({{A}_{n,n+5,3}}\). In the case \(n=3\), according to Lemma 3.1, the desired algebra is

$$\begin{aligned} A=\left\langle {{e}_{1}},\ldots ,{{e}_{8}}:\left[ {{e}_{1}},{{e}_{2}},{{e}_{3}} \right] ={{e}_{8}},\left[ {{e}_{4}},{{e}_{5}},{{e}_{6}} \right] ={{e}_{7}} \right\rangle , \end{aligned}$$

This algebra is the same as \({{A}_{n,n+5,3}}\) for \(n=3\).

Case 2\(A/\langle e_{n+5}\rangle \cong \langle \overline{e}_1,\ldots ,\overline{e}_{n+4}:[\overline{e}_1,\ldots ,\overline{e}_n]=\overline{e}_{n+3},[\overline{e}_2,\ldots ,\overline{e}_{n+1}]=\overline{e}_{n+4}\rangle \).

In this case \(\dim {{A}^{2}}=3\); so \({{A}^{2}}=\left\langle {{e}_{n+3}},{{e}_{n+4}},{{e}_{n+5}} \right\rangle \). Thus \(3\le \dim Z\left( A \right) \le 4\). The brackets of A are as follows:

$$\begin{aligned} \left\{ \begin{array}{ll} \left[ {{e}_{1}},\ldots ,{{e}_{n}} \right] ={{e}_{n+3}}+\alpha {{e}_{n+5}},&{} \\ \left[ {{e}_{2}},\ldots ,{{e}_{n+1}} \right] ={{e}_{n+4}}+\beta {{e}_{n+5}},&{} \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{e}_{n}},{{e}_{n+1}} \right] ={{\alpha }_{i}}{{e}_{n+5}},&{}\qquad 2\le i\le n, \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{e}_{n}},{{e}_{n+2}} \right] ={{\beta }_{i}}{{e}_{n+5}},&{}\qquad 1\le i\le n, \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{{\hat{e}}}_{j}},\ldots ,{{e}_{n}},{{e}_{n+1}},{{e}_{n+2}} \right] ={{\theta }_{ij}}{{e}_{n+5}},&{}\qquad 1\le i<j\le n. \\ \end{array} \right. \end{aligned}$$

By changing the base, we can take \(\alpha =\beta =0\). First, we assume that \(\dim Z\left( A \right) =4\). It follows that \(Z\left( A \right) =\left\langle {{e}_{n+2}},{{e}_{n+3}},{{e}_{n+4}},{{e}_{n+5}} \right\rangle \). Therefore

$$\begin{aligned} \left\{ \begin{array}{ll} \left[ {{e}_{1}},\ldots ,{{e}_{n}} \right] ={{e}_{n+3}},&{} \\ \left[ {{e}_{2}},\ldots ,{{e}_{n+1}} \right] ={{e}_{n+4}},&{} \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{e}_{n}},{{e}_{n+1}} \right] ={{\alpha }_{i}}{{e}_{n+5}},&{}\text { }2\le i\le n. \\ \end{array} \right. \end{aligned}$$

Due to the derived dimension, we conclude that at least one of the \({{\alpha }_{i}}\text { }\!\!'\!\!\text { s }\left( 2\le i\le n \right) \) is nonzero. Without loss of generality, we assume that \({{\alpha }_{2}}\ne 0\). We replace \(e_2\) with \(e_2+\sum _{i=3}^n(-1)^{i}\frac{\alpha _i}{\alpha _2}e_i\) and \(e_{n+5}\) with \(\alpha _2e_{n+5}\). Accordingly, the nonzero brackets of this algebra are as follows:

$$\begin{aligned} \left[ {{e}_{1}},\ldots ,{{e}_{n}} \right] ={{e}_{n+3}},\quad \left[ {{e}_{2}},\ldots ,{{e}_{n+1}} \right] ={{e}_{n+4}},\quad \left[ {{e}_{1}},{{e}_{3}},\ldots ,{{e}_{n+1}} \right] ={{e}_{n+5}}. \end{aligned}$$

We denote this algebra by \({{A}_{n,n+5,4}}\).

Now, assume that \(\dim Z\left( A \right) =3\); thus \({{A}^{2}}=Z\left( A \right) =\left\langle {{e}_{n+3}},{{e}_{n+4}},{{e}_{n+5}} \right\rangle \). Hence,

$$\begin{aligned} \left\{ \begin{array}{ll} \left[ {{e}_{1}},\ldots ,{{e}_{n}} \right] ={{e}_{n+3}},&{} \\ \left[ {{e}_{2}},\ldots ,{{e}_{n+1}} \right] ={{e}_{n+4}},&{} \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{e}_{n}},{{e}_{n+1}} \right] ={{\alpha }_{i}}{{e}_{n+5}},&{}\qquad 2\le i\le n, \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{e}_{n}},{{e}_{n+2}} \right] ={{\beta }_{i}}{{e}_{n+5}},&{}\qquad 1\le i\le n, \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{{\hat{e}}}_{j}},\ldots ,{{e}_{n}},{{e}_{n+1}},{{e}_{n+2}} \right] ={{\theta }_{ij}}{{e}_{n+5}},&{}\qquad 1\le i<j\le n. \\ \end{array} \right. \end{aligned}$$

Since \(\dim {{( {A}/{\left\langle {{e}_{n+3}},{{e}_{n+4}} \right\rangle }\; )}^{2}}=1\), we have \({A}/{\left\langle {{e}_{n+3}},{{e}_{n+4}} \right\rangle }\;\cong H\left( n,1 \right) \oplus F\left( 2 \right) \). According to the structure of n-Lie algebras, we infer that only one of the coefficients \({{\theta }_{ij}}\left( 1\le i<j\le n \right) \), \({{\beta }_{i}}\left( 1\le i\le n \right) \), and \({{\alpha }_{i}}\left( 2\le i\le n \right) \) is equal to one and the others are zero. On account of \(Z\left( A \right) =\left\langle {{e}_{n+3}},{{e}_{n+4}},{{e}_{n+5}} \right\rangle \), the coefficients \({{\alpha }_{i}}\left( 2\le i\le n \right) \) cannot be equal to one. We have two cases.

(i) Only one of the coefficients \({{\beta }_{i}}\left( 1\le i\le n \right) \) is equal to one and the others are zero. Without loss of generality, we assume that \({{\beta }_{1}}=1\) and the others are zero. So the nonzero brackets of algebra are as follows:

$$\begin{aligned} \left[ {{e}_{1}},\ldots ,{{e}_{n}} \right] ={{e}_{n+3}},\qquad \left[ {{e}_{2}},\ldots ,{{e}_{n+1}} \right] ={{e}_{n+4}},\qquad \left[ {{e}_{2}},\ldots ,{{e}_{n}},{{e}_{n+2}} \right] ={{e}_{n+5}}. \end{aligned}$$

We denote this algebra by \({{A}_{n,n+5,5}}\).

(ii) Only one of the coefficients \({{\theta }_{ij}}\left( 1\le i<j\le n \right) \) is equal to one and the others are zero. Without loss of generality, we assume that \({{\theta }_{12}}=1\), and the others are zero. So, the nonzero brackets of the algebra are as follows:

$$\begin{aligned} \left[ {{e}_{1}},\ldots ,{{e}_{n}} \right] ={{e}_{n+3}},\qquad \left[ {{e}_{2}},\ldots ,{{e}_{n+1}} \right] ={{e}_{n+4}},\qquad \left[ {{e}_{3}},\ldots ,{{e}_{n+2}} \right] ={{e}_{n+5}}. \end{aligned}$$

We denote this algebra by \(A_{n,n+5,6}\).

Case 3\(A/\langle e_{n+5}\rangle \cong \langle \overline{e}_1,\ldots ,\overline{e}_{n+4}:[\overline{e}_1,\ldots ,\overline{e}_n]=\overline{e}_{n+3},[\overline{e}_3,\ldots ,\overline{e}_{n+2}]=\overline{e}_{n+4}\rangle \).

In this case, \(\dim {{A}^{2}}=3\), and so \({{A}^{2}}=Z\left( A \right) =\left\langle {{e}_{n+3}},{{e}_{n+4}},{{e}_{n+5}} \right\rangle \). The brackets of A are as follows:

$$\begin{aligned} \left\{ \begin{array}{ll} \left[ {{e}_{1}},\ldots ,{{e}_{n}} \right] ={{e}_{n+3}}+\alpha {{e}_{n+5}}, &{}\\ \left[ {{e}_{3}},\ldots ,{{e}_{n+2}} \right] ={{e}_{n+4}}+\beta {{e}_{n+5}},&{} \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{e}_{n}},{{e}_{n+1}} \right] ={{\alpha }_{i}}{{e}_{n+5}},&{}\text { }1\le i\le n, \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{e}_{n}},{{e}_{n+2}} \right] ={{\beta }_{i}}{{e}_{n+5}},&{}\text { }1\le i\le n, \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{{\hat{e}}}_{j}},\ldots ,{{e}_{n}},{{e}_{n+1}},{{e}_{n+2}} \right] ={{\theta }_{ij}}{{e}_{n+5}},&{}\text { }1\le i<j\le n\text { and }\left( i,j \right) \ne \left( 1,2 \right) . \\ \end{array} \right. \end{aligned}$$

By changing the base, we can take \(\alpha =\beta =0\). So,

$$\begin{aligned} \left\{ \begin{array}{ll} \left[ {{e}_{1}},\ldots ,{{e}_{n}} \right] ={{e}_{n+3}},&{} \\ \left[ {{e}_{3}},\ldots ,{{e}_{n+2}} \right] ={{e}_{n+4}},&{} \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{e}_{n}},{{e}_{n+1}} \right] ={{\alpha }_{i}}{{e}_{n+5}},&{}\text { }1\le i\le n, \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{e}_{n}},{{e}_{n+2}} \right] ={{\beta }_{i}}{{e}_{n+5}},&{}\text { }1\le i\le n,\\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{{\hat{e}}}_{j}},\ldots ,{{e}_{n}},{{e}_{n+1}},{{e}_{n+2}} \right] ={{\theta }_{ij}}{{e}_{n+5}},&{}1\le i<j\le n\text { and }\left( i,j \right) \ne \left( 1,2 \right) . \\ \end{array} \right. \end{aligned}$$

Since \(\dim {{\left( {A}/{\left\langle {{e}_{n+3}},{{e}_{n+4}} \right\rangle }\; \right) }^{2}}=1\), we find \({A}/{\left\langle {{e}_{n+3}},{{e}_{n+4}} \right\rangle }\;\cong H\left( n,1 \right) \oplus F\left( 2 \right) \). According to the structure of n-Lie algebras, we conclude that at least one of the coefficients \({{\theta }_{ij}}\left( 1\le i<j\le n,\left( i,j \right) \ne \left( 1,2 \right) \right) \), \({{\beta }_{i}}\left( 1\le i\le n \right) \), and \({{\alpha }_{i}}\left( 1\le i\le n \right) \) is equal to one and the others are zero. Since \(Z\left( A \right) =\left\langle {{e}_{n+3}},{{e}_{n+4}},{{e}_{n+5}} \right\rangle \), we have three cases.

(i) Only one of the coefficients \({{\alpha }_{i}}\left( 1\le i\le n \right) \) is equal to one and the others are zero. Without loss of generality, we assume that \({{\alpha }_{1}}=1\) and the others are zero. So, we have

$$\begin{aligned} \left[ {{e}_{1}},\ldots ,{{e}_{n}} \right] ={{e}_{n+3}},\qquad \left[ {{e}_{3}},\ldots ,{{e}_{n+2}} \right] ={{e}_{n+4}},\qquad \left[ {{e}_{2}},\ldots ,{{e}_{n}},{{e}_{n+1}} \right] ={{e}_{n+5}}. \end{aligned}$$

One can check that this algebra is isomorphic to \({{A}_{n,n+5,6}}\).

(ii) Only one of the coefficients \({{\beta }_{i}}\left( 1\le i\le n \right) \) is equal to one and the others are zero. Without loss of generality, we assume that \({{\beta }_{1}}=1\) and the others are zero. Hence, the nonzero brackets of the algebra are

$$\begin{aligned} \left[ {{e}_{1}},\ldots ,{{e}_{n}} \right] ={{e}_{n+3}},\qquad \left[ {{e}_{3}},\ldots ,{{e}_{n+2}} \right] ={{e}_{n+4}},\qquad \left[ {{e}_{2}},\ldots ,{{e}_{n}},{{e}_{n+2}} \right] ={{e}_{n+5}}. \end{aligned}$$

One can easily see that, this algebra is isomorphic to \({{A}_{n,n+5,6}}\).

(iii) Only one of the coefficients of \({{\theta }_{ij}}\left( 1\le i<j\le n,\left( i,j \right) \ne \left( 1,2 \right) \right) \) is equal to one and the others are zero. Without loss of generality, we assume that \({{\theta }_{13}}=1\) and the others are zero. Hence, the nonzero brackets of the algebra are

$$\begin{aligned} \left[ {{e}_{1}},\ldots ,{{e}_{n}} \right] ={{e}_{n+3}},\qquad \left[ {{e}_{2}},\ldots ,{{e}_{n+1}} \right] ={{e}_{n+4}},\qquad \left[ {{e}_{2}},{{e}_{4}},\ldots ,{{e}_{n+2}} \right] ={{e}_{n+5}}. \end{aligned}$$

Obviously, this algebra is isomorphic to \({{A}_{n,n+5,6}}\).

Case 4\(A/\langle e_{n+5}\rangle \cong \langle \overline{e}_1,\ldots ,\overline{e}_{n+4}:[\overline{e}_1,\ldots ,\overline{e}_n]=\overline{e}_{n+1},\ [\overline{e}_2,\ldots ,\overline{e}_n,\overline{e}_{n+2}]=\overline{e}_{n+3}\rangle \).

In this case, \(\dim {{A}^{2}}=4\); thus \({{A}^{2}}=Z\left( A \right) =\left\langle {{e}_{n+1}},{{e}_{n+3}},{{e}_{n+4}},{{e}_{n+5}} \right\rangle \). The brackets of this algebra are as follows:

$$\begin{aligned} \left\{ \begin{array}{ll} \left[ {{e}_{1}},\ldots ,{{e}_{n}} \right] ={{e}_{n+1}}+\alpha {{e}_{n+5}},&{} \\ \left[ {{e}_{2}},\ldots ,{{e}_{n}},{{e}_{n+2}} \right] ={{e}_{n+3}}+\beta {{e}_{n+5}},&{} \\ \left[ {{e}_{1}},{{e}_{3}},\ldots ,{{e}_{n}},{{e}_{n+2}} \right] ={{e}_{n+4}}+\gamma {{e}_{n+5}},&{} \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{e}_{n}},{{e}_{n+2}} \right] ={{\beta }_{i}}{{e}_{n+5}},&{}\qquad 3\le i\le n. \\ \end{array} \right. \end{aligned}$$

We change the basis to obtain \(\alpha =\beta =\gamma =0\). Thus, the brackets are

$$\begin{aligned} \left\{ \begin{array}{ll} \left[ {{e}_{1}},\ldots ,{{e}_{n}} \right] ={{e}_{n+1}},&{} \\ \left[ {{e}_{2}},\ldots ,{{e}_{n}},{{e}_{n+2}} \right] ={{e}_{n+3}},&{} \\ \left[ {{e}_{1}},{{e}_{3}},\ldots ,{{e}_{n}},{{e}_{n+2}} \right] ={{e}_{n+4}},&{} \\ \left[ {{e}_{1}},\ldots ,{{{\hat{e}}}_{i}},\ldots ,{{e}_{n}},{{e}_{n+2}} \right] ={{\beta }_{i}}{{e}_{n+5}},&{}\qquad 3\le i\le n. \\ \end{array} \right. \end{aligned}$$

Due to the derived dimension, we conclude that at least one of the \({{\beta }_{i}}\left( 3\le i\le n \right) \) is nonzero. Without loss of generality, we assume that \({{\beta }_{3}}\ne 0\). We replace \(e_3\) with \(e_3+\sum _{i=4}^n(-1)^{i-1}\frac{\beta _i}{\beta _3}e_i\) and \(e_{n+5}\) with \(\beta _3e_{n+5}\). the nonzero brackets of algebra are as follows:

$$\begin{aligned} \begin{array}{ll} \left[ {{e}_{1}},\ldots ,{{e}_{n}} \right] ={{e}_{n+1}},&{}\qquad \left[ {{e}_{2}},\ldots ,{{e}_{n}},{{e}_{n+2}} \right] ={{e}_{n+3}}, \\ \left[ {{e}_{1}},{{e}_{3}},\ldots ,{{e}_{n}},{{e}_{n+2}} \right] ={{e}_{n+4}},&{}\qquad \left[ {{e}_{1}},{{e}_{2}},{{e}_{4}},\ldots ,{{e}_{n}},{{e}_{n+2}} \right] ={{e}_{n+5}}.\\ \end{array} \end{aligned}$$

We denote this algebra by \({{A}_{n,n+5,7}}\).

Case 5\(A/\langle e_{n+5}\rangle \cong H(3,2) \cong \langle \overline{e}_1,\ldots ,\overline{e}_7:[\overline{e}_1,\overline{e}_2,\overline{e}_3]=[\overline{e}_4,\overline{e}_5,\overline{e}_6]=\overline{e}_7\rangle \).

In this case, according to the structure of this algebra, we get \({{A}^{2}}=Z\left( A \right) =\left\langle {{e}_{7}},{{e}_{8}} \right\rangle \). According to Lemma 3.1, we have \(A=\left\langle {{e}_{1}},\ldots ,{{e}_{8}}:[e_1,e_2,e_3]=e_7,[e_4,e_5,e_6]=e_8 \right\rangle \). For this algebra \(A/\langle e_8\rangle \ncong H(3,2)\). Therefore, this algebra does not satisfy our conditions.

Theorem 3.2

The \((n+5)\)-dimensional nilpotent n-Lie algebras of class two, for \(n>2\), over an arbitrary field are

$$\begin{aligned} H(n,1)\oplus F(4),\qquad H(3,2)\oplus F(1),\qquad H(4,2),\qquad A_{n,n+5,i}, \quad 1\le i \le 7. \end{aligned}$$

According to the above theorem and Theorem 2.7, the main theorem of this paper is as follows.

Corollary 3.3

The \((n+5)\)-dimensional nilpotent n-Lie algebras of class two are as following

$$\begin{aligned} \begin{aligned}&H(n,1)\oplus F(4),&H(2,2)\oplus F(2),&\qquad H(3,2)\oplus F(1),&H(2,3),\\&H(4,2),&A_{n,n+5,i}, \quad 1\le i \le 7,&L_{7,i}, \quad 1 \le i \le 10. \\ \end{aligned} \end{aligned}$$
Table 1 The list of algebras which are presented in this article

These algebras are valid for the case \(n=2\) on the integers field and algebraically closed field and for \(n>2\) on the arbitrary field.

In Table 1 we list the algebras which are presented in this article.