The formula should be dynamic based on your input value.
Change your formula to
formula = (x * 0.5/n) ** 2 + (y * 1.0/n) ** 2 - 1
This works fine