#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <cstring>

using namespace std;

int main(){

	int n;
	while(cin>>n&&n!=0){
		bool isAppeared[10001];
		int data[10001];
		fill(isAppeared,isAppeared+10001,false);
		fill(data,data+10001,0);
		//memset(isAppeared,0,sizeof(isAppeared));
		//memset(data,0,sizeof(data));
		for(int i = 1; i < n; i++){
			int r=(i*i)%n;
			isAppeared[r]=true;
		}
		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				if(isAppeared[i]&&isAppeared[j]){
					int ret=i-j;
					if(ret<0)
						ret+=n;
					if(((n-1)/2)<ret){
						ret=n-ret;
					}
					data[ret]++;
				}
			}
		}
		for(int i = 1; i <= ((n-1)/2); i++){
			if(data[i]!=0)
				cout<<data[i]<<endl;
		}
	}

	return 0;
}