#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
const int inf=1e8;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
using namespace std;
int main(){
	int n;
	while(cin>>n,n){
		map<int,bool>tmp;
		loop(i,1,n){
			int t=i*i;
			t%=n;
			tmp[t]=true;
		}
		vi in;
		for(map<int,bool>::iterator it=tmp.begin();it!=tmp.end();it++)
			in.pb(it->first);
		//cout<<in.size()<<endl;
		vi out((n-1)/2+1,0);
		rep(i,in.size())rep(j,in.size())if(i!=j){
			int t=in[i]-in[j];
			t=abs(t);
			if(t>(n-1)/2)t=n-t;
			//if(t<0)t+=n;
			out[t]++;
		}
		loop(i,1,(n-1)/2+1)cout<<out[i]<<endl;
	}
}