#include <iostream>
#include <vector>
#include <algorithm>
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

int main()
{
	vector <int> n2;
	for (int i = 1; i <= 10000; i++ ){
		n2.push_back (i*i );
	} // end for
	int n;

	while (cin >> n && n ){
		vector <int> m (n-1, 0 );
		rep (i, n-1 ){
			m[i] = n2[i] % n;
		} // end rep
		sort (ALL (m ) );
		m.erase (unique (ALL(m) ), m.end() );
		int size = m.size();
		vector<int> cnt ((n-1)/2+1, 0 );
		int maxd = 0;
		rep (i, size ){
			rep (j, size ){
				if (i == j )
					continue;
				int d = m[i] - m[j];
				if (d < 0 ){
					d += n;
				}// end if
				if (d > (n-1)/2 ){
					d = n - d;
				} // end if
				cnt[d]++;
				maxd = max (d, maxd );
			} // end for
		} // end for
		for (int i = 1; i <= maxd; i++ ){
			cout << cnt[i] << endl;
		} // end for
	} // end loop
		
	return 0;
}