#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"


int main() {
	while (1) {
		int N; cin >> N;
		if (!N)break;
		set<int>aset;
		for (int i = 1; i < N; ++i) {
			int k = (i*i) % N;
			aset.emplace(k);
		}
		vector<int>nums(N);
		for (auto it = aset.begin(); it != aset.end(); ++it) {
			for (auto jt =next( it); jt != aset.end(); ++jt) {
				int sa = *it - *jt;
				if (sa < 0)sa += N;
				if (sa > (N - 1) / 2)sa = N - sa;
				nums[sa]++;
			}
		}
		for (int i = 1; i <= (N - 1) / 2; ++i) {
			cout << nums[i]*2 << endl;
		}
	}
	return 0;
}