John Pardon, Will Sawin, Daniel Kane, Daniel Kriz, Maria Monks, and Margaret Bilu are examples of legacies. Their parent(s) are also math professors.

Zoia Ceaușescu was the ultimate startup or anti-legacies. Her parents were peasant communist dictators who opposed her pursuit of math PhD, even dismantled the math institute she worked in. Zoia had published very well by the standard of her time, getting ~ 300 google scholar citations despite the ages of the papers. Zoia Ceaușescu's Erdős number is 2.

Having math or physics professor parents is such an enormous advantage in the US. You would know abstract algebra coming in as an undergrad at HYPSMC and not struggle in any math classes. You'd be able to choose any advisor for a senior thesis since they wouldn't assume you're stupid and immediately rule you out.