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

int main(){
	int n;
	while(cin >> n,n){
		set<int> table;
		int t[5001] = {0};
		for(int i=1;i<n;i++){
			table.insert((i*i)%n);
		}
		for(set<int>::iterator it = table.begin();it != table.end();++it){
			for(set<int>::iterator it2 = table.begin();it2 != table.end();++it2){
				int delta = (*it) - (*it2);
				if(delta<0)delta+=n;
				if(delta>(n-1)/2)delta=n-delta;
				t[delta]++;
			}
		}
		for(int i=1;i<=(n-1)/2;i++){
			cout << t[i] << endl;
		}
	}
}