#include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)

int n,a[5000],b[5000];

int main(){
	while(cin>>n&&n){
		fill(b,b+(n+1)/2,0);
		set<int> s;
		rep(i,n-1)s.insert((i+1)*(i+1)%n);
		int cur=0;
		set<int>::iterator ite=s.begin();
		while(ite!=s.end()){
			a[cur++]=*ite;
			ite++;
		}
		//rep(i,cur)cout<<a[i]<<endl;cout<<cur<<endl;
		rep(i,cur)rep(j,cur){
			if(i==j)continue;
			int r=a[j]-a[i];
			if(r<0)r+=n;
			if(r>(n-1)/2)r=n-r;
			b[r]++;
		}
		rep(i,(n-1)/2)cout<<b[i+1]<<endl;
	}
}