AWK/Bash script

I would like to write a script to extend this command to a general case:

BEGIN {s_0=0;n_0=0}{n_0++;s_0+=($51-$1)^2}END {print sqrt(s_0/n_0)}

i.e. so that

BEGIN {s_0=0;n_0=0}{n_0++;s_0+=($51-$1)^2}END {print sqrt(s_0/n_0)}
BEGIN {s_1=0;n_1=0}{n_1++;s_1+=($51-$2)^2}END {print sqrt(s_1/n_1)}
BEGIN {s_2=0;n_2=0}{n_2++;s_2+=($51-$3)^2}END {print sqrt(s_2/n_2)}
...
BEGIN {s_50=0;n_50=0}{n_50++;s_50+=($51-$51)^2}END {print sqrt(s_50/n_50)}
 

I already have a script that could loop over the variable s and n,
any ideas?

It'd be better if you can tell us your requirement, provide sample input and an example of desired output.

a loop over field 1 to 51:

{ for (i=1;i<=51;i++) { n++; s+=($51-$i)^2; }
END { for (i=1;i<=51;i++) { print sqrt(s/n) }

i'd like to say n[] isn't unique and does not need to be an array. it also could probably be replaced with NR. print sqrt(s/NR)

What, exactly, is this single case supposed to do?