#include <cstdio>           // printf(), scanf()
#include <set>

using namespace std;

const int MAX_N = 10000;
const int MAX_R = 5000;

void
solve(int n)
{
	int bins[MAX_N / 2];
	set<int> remains;
	int re[MAX_R];

	int ix = 0;
	for (int i = 1; i < n; ++i)
	{
		int r = (i * i) % n;

		if (remains.find(r) == remains.end())
		{
			remains.insert(r);
			re[ix++] = r;
		}
	}

	int m = (n - 1) / 2;
	for (int i = 1; i <= m; ++i)
		bins[i] = 0;

	for (int i = 0; i < ix; ++i)
	{
		for (int j = 0; j < ix; ++j)
		{
			if (i != j)
			{
				int d = re[i] - re[j];
				if (d < 0)
					d += n;

				if (d > m)
					d = n - d;

				bins[d]++;
			}
		}
	}

	for (int i = 1; i <= m; ++i)
		printf("%d\n", bins[i]);
}

int
main(int argc, char **argv)
{
	while (true)
	{
		int n;
		scanf("%d", &n);
		if (n == 0)
			break;

		solve(n);
	}

	return 0;
}