#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <climits>
#include <sstream>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;

set<int> app;

int main(){
	int n;
	while(scanf("%d",&n)){
		if(n==0)break;
		
		app.clear();
		
		for(int i=1;i<n;i++){
			app.insert(i*i%n);
		}
		vector<int> vapp((n-1)/2);
		for(set<int>::iterator sp=app.begin();sp!=app.end();sp++){
			for(set<int>::iterator tsp=sp;tsp!=app.end();tsp++){
				if(sp==tsp)continue;
				int diff=*tsp-*sp;
				if(diff<0)diff+=n;
				if(diff>(n-1)/2)diff=n-diff;
				vapp[diff-1]+=2;
			}
		}
		for(int i=0;i<vapp.size();i++){
			cout<<vapp[i]<<endl;
		}
	}
}