7. Let the set $A=\{n(n+1) \mid n=1,2, \cdots\}, B=\{3 m-1 \mid m=1,2, \cdots\}$, if the elements of the set $A \cap B$ are arranged in ascending order to form a sequence $\left\{a_{k}\right\}$, then the general term formula of the sequence $\left\{a_{k}\right\}$ is $a_{k}=$ $\qquad$ .
$$
n(n+1) \equiv 2(\bmod 3) \Rightarrow n=3 k-2 \Rightarrow a_{k}=(3 k-2)(3 k-1)=9 k^{2}-9 k+2\left(k \in \mathbf{N}^{*}\right) \text {. }
$$

The translation is as follows:

$$
n(n+1) \equiv 2(\bmod 3) \Rightarrow n=3 k-2 \Rightarrow a_{k}=(3 k-2)(3 k-1)=9 k^{2}-9 k+2\left(k \in \mathbf{N}^{*}\right) \text {. }
$$