A Gladyshev theorem for trifractional Brownian motion and n-th order fractional Brownian motion