#include <iostream>
#include <string>
#include <vector>
#include <iterator>
#include <algorithm>
#include <cstring>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int main()
{
	int n;
	double n2;
		
	while(cin >> n && n)
	{
		int a[5000];
		memset(a,0,sizeof(a));
		
		n2 = (n-1)/2;

		vector<int> v;
		REP(i,1,n)
		{
			int temp = i*i;
			temp %= n;
			
			vector<int>::iterator ite = find(v.begin(),v.end(),temp);
			if(ite == v.end())
			{
				v.push_back(temp);
			}
		}

		rep(i,v.size())
		{
			REP(j,i+1,v.size())
			{
				int ans = v[i] - v[j];
				if(ans < 0) ans += n;
				if(ans > n2) ans = n - ans;
				a[ans]++;
			}
		}
		
		REP(i,1,n2+1)
		{
			cout << a[i]*2 << endl;
		}
	}

	return 0;
}