Problem: Let $$H_n(x):=(-1)^n e ^{\frac{x^2}{2}} \frac{d^n}{dx^n}(e ^{-\frac{x^2}{2}})$$ be the $n^{th}$-Hermite polynomial and $$G_n(t,x):=t^{\frac n 2}H_n(\frac {x}{\sqrt{t}})$$ Moreover, let $(B_t)_{t \geq 0}$ be a Brownian motion. The problem is to show the following:
if $p(t, x)$ is a polynomial such that $(p(t, B_t))_{t \geq 0}$ is a martingale then $p$ is an Hermite polynomial, i.e. there exists $n \in \mathbb{N}$ with $p(t, x)= G_n(t,x)$.
Attempt: i know that in such a way the converse is true. I am referring to this question. I have tried to retrace the proof in reverse but noting has come.