#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <climits>
#include <sstream>
using namespace std;
 
#define reep(i,a,b) for(long long i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second
#define mkp make_pair
 
static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
static const int INF=1<<24;
 
template <class T>
void initvv(vector<vector<T> > &v,int a,int b, const T  &t = T()){
    v.assign(a,vector<T>(b,t));
}
 
//v.erase(unique(v.begin(),v.end()),v.end());


int main(){
	ll n;
	while(cin>>n,n){
		vector<ll> v(n);
		vector<ll> x((n-1)/2);
		for(ll i=1;i<n;i++){
			v[i]=(i*i)%n;
			// cout<<i<<" "<<v[i]<<endl;
		}
		sort(ALL(v));
		v.erase(unique(ALL(v)),v.end());
		reep(i,1,v.size()){
			// cout<<v[i]<<endl;
			reep(j,1,v.size()){
				if(i==j) continue;
				ll a=v[i]-v[j];
				if(a<0) a+=n;
				if(a>(n-1)/2) a=n-a;
				x[a-1]++;
			}
		}
		rep(i,x.size()){
			cout<<x[i]<<endl;
		}
		// cout<<endl;
	}
}