#include <set>
#include <cstdio>
int i,n,v[9999];main(){for(;scanf("%d",&n),n;){std::set<int>t;std::set<int>::iterator s,S;for(i=1;i<n;i++)v[i]=0,t.insert(i*i%n);for(s=t.begin();s!=t.end();s++)for(S=s;++S!=t.end();v[i>n/2?n-i:i]+=2)i=*S-*s;for(i=1;i<=n/2;i++)printf("%d\n",v[i]);}}