#include <iostream>
#include <set>
#include <algorithm>

using namespace std;


int main(void)
{
	int n;
	set<int> target;
	int data[10000];
	int change[10000];

	while( cin >> n && n != 0 ){
		target.clear();
		for( int i = 0;i < 10000;i++ ) change[i] = data[i] = 0;
		for( int i = 1;i < n;i++ ){
			target.insert( i * i % n );
		}

		copy( target.begin(), target.end(), change );
		

		int piyo = target.size();
		int hoge = ( n - 1 ) / 2;
		for( int i = 0;i < piyo;i++ ){
			for( int j = 0;j < piyo;j++ ){
				int answer = change[i] - change[j];
				if( answer == 0 ) continue;
				while( 1 ){
					if( answer < 0 ){ answer += n; continue; }
					else if( answer > hoge ){ answer = n - answer; continue; }
					data[answer]++;
					break;
				}
			}
		}

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

	return 0;
}