#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

inline int calcDiff(int limit, int n, int a, int b){
	int result = a - b;
	if(result < 0){ result += n; }
	if(result > limit){ result = n - result; }
	return result;
}

int main(){
	while(true){
		int n;
		scanf("%d", &n);
		if(n == 0){ break; }
		vector<int> numbers;
		for(int i = n - 1; i > 0; --i){ numbers.push_back(i * i % n); }
		sort(numbers.begin(), numbers.end());
		numbers.erase(unique(numbers.begin(), numbers.end()), numbers.end());
		int limit = (n - 1) / 2;
		vector<int> answers(limit + 1, 0);
		for(int i = numbers.size() - 1; i >= 0; --i){
			for(int j = i - 1; j >= 0; --j){
				answers[calcDiff(limit, n, numbers[i], numbers[j])] += 2;
			}
		}
		for(int i = 1; i <= limit; ++i){
			printf("%d\n", answers[i]);
		}
	}
	return 0;
}