#include <set>
#include <cstdio>
#include <cstring>
int i,n,v[9999];
main(){for(;scanf("%d",&n),n;){
	std::set<int>t;
	for(memset(v,0,sizeof(v)),i=1;i<n;i++)t.insert(i*i%n);
	std::set<int>::iterator s,S;
	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]);
}}