#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>
#include <complex>


typedef long long ll;
const double Eps = 1e-6;

using namespace std;

int main()
{
	int n;
	while (scanf("%d", &n), n)
	{
		int times[10000/2];
		memset(times, 0, sizeof(times));
		vector<int> v;
		for (int i = 1; i < n; ++i)
			v.push_back(i*i%n);
		sort(v.begin(), v.end());
		int m = unique(v.begin(), v.end()) - v.begin();
		for (int i = 0; i < m; ++i)
		{
			for (int j = i+1; j < m; ++j)
			{
				int t = v[j] - v[i];
				if (t > n/2)
					t = n - t;

				++times[t];
			}
		}

		for (int i = 1; i <= n/2; ++i)
			printf("%d\n", 2*times[i]);
	}

	return 0;
}