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

#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 res = n;
		int count = 0;

		while(res != 0)
		{
			if(res%10 == 0)
			{
				count++;
			}
			res /= 10;
		}
		
		if(count == 1) break;


		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);
			}
		}
		
		map<int,int> m;
		rep(i,v.size())
		{
			rep(j,v.size())
			{
				if(i != j)
				{

					int ans = v[i] - v[j];
				
					if(ans < 0) ans += n;
					if(ans > n2) ans = n - ans;

					m[ans]++;
				}
			}
		}

		REP(i,1,n2+1)
		{
			cout << m[i] << endl;
		}
	}

	return 0;
}