#include <iostream>
#include <set>
#include <vector>
#include <algorithm>
#include <string.h>

using namespace std;
int number[5000];

void solve()
{
	int n;
	while(cin >> n, n)
	{
		memset(number, 0, sizeof(number));
		set<int> Set;
		for(int i = 1; i < n; ++i)
		{
			Set.insert((i * i) % n);
		}
		vector<int> num;
		int size = (n - 1) / 2;
		set<int>::iterator it = Set.begin();
		while(it != Set.end())
		{
			set<int>::iterator it2 = Set.begin();
			while(it2 != Set.end())
			{
				int temp = *it2 - *it;
				if(temp < 0)
				{
					temp += n;
				}
				if(temp > size)
				{
					temp = n - temp;
				}
				++number[temp];
				++it2;
			}
			++it;
		}
		for(int i = 1; i <= size; ++i)
		{
			cout << number[i] << endl;
		}
	}
}

int main()
{
	solve();
	return(0);
}