#include<iostream>
#include<vector>
#include<set>
using namespace std;

int main()
{
	int n;
	vector<int> num(10002);
	set<int> a;
	set<int>::iterator it, itr, ite;
	int i, t;

	while (cin>>n, n) {
		a.clear();
		for (i = 0; i < n; i++) num[i] = 0;
 		for (i = 1; i < n; i++) a.insert((i*i)%n);
		ite = a.end();
		ite--;
		for (it = a.begin(); it != ite; it++) {
			itr = it;
			for (itr++; itr != a.end(); itr++) {
				t = *it - *itr;
				if (t < 0) t += n;
				if ((n-1)/2 < t) t = n-t;
				num[t] += 2;
			}
		}
		for (i = 1; i <= (n-1)/2; i++)
			cout<<num[i]<<endl;
	}
	return 0;
}