#include <iostream>
#include <set>
using namespace std;

int main()
{
	int n;

	while( cin >> n && n ){
		set< int > list;
		int size = ( n - 1 ) / 2;
		int* counts = new int[ size + 1 ]();
		for( int i = 1; i < n; ++i ){
			list.insert( i * i % n );
		}
		set< int >::iterator itr1 = list.begin();
		set< int >::iterator itr2 = list.begin();
		while( itr1 != list.end() ){
			while( itr2 != list.end() ){
				if( itr1 == itr2 ){
					++itr2;
					continue;
				}
				int a = *itr1;
				int b = *itr2;
				int diff = a - b;
				if( diff < 0 ){
					diff += n;
				}
				if( diff > size ){
					diff = n - diff;
				}
				++counts[ diff ];

				++itr2;
			}
			++itr1;
			itr2 = list.begin();
		}

		for( int i = 1; i <= size; ++i ){
			cout << counts[ i ] << endl;
		}

		delete[] counts;
	}

	return 0;
}