#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF (1<<29)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define CLR(a) memset(a,0,sizeof(a))
const int dx[] = {-1,0,0,1},dy[] = {0,1,-1,0};

typedef long long int ll;

using namespace std;

int main(){
    while(true){
	int n;
	vector<int> v;
	cin >> n;
	if(n==0) break;
	FOR(i,1,n){
	    v.PB((i*i)%n);
	}
	sort(ALL(v));
	v.erase(unique(ALL(v)),v.end());
	vector<int> ans((n/2));
	REP(i,v.size())FOR(j,i+1,v.size()){
	    int m = v[i] - v[j];
	    if(m < 0) m += n;
	    if(m > (n-1)/2) m = n - m;
	    ans[m-1]++;
	}
	REP(i,ans.size()) cout << 2*ans[i] << endl;
    }
    return 0;
}