Find the law of sequence: 5,5,14,38,87, (), what's the next one?

Find the law of sequence: 5,5,14,38,87, (), what's the next one?

5 5 14 38 87 ()
Answer 167
5 5 14 38 87 167
\/\/\/ \/\/
09 24 49 80
0 =1^2-1
9 =3^2
24=5^2-1
49=7^2
80=9^2-1