#include <iostream>
#include <map>
#include <set>
#include <cstring>

using namespace std;

const int N = 10000;
int cnt[N] = { 0 }, ans[N / 2 + 1] = { 0 };

int main(){
	int n;
	while(cin >> n, n) {
		// memset(cnt, 0, sizeof(cnt));
		memset(ans, 0, sizeof(ans));
		set<int> k;
		for(int i = 1;i < n;++i){
			int a = i % n;
			int v = (a * a) % n;
			// cnt[v]++;
			k.insert(v);
		}
		for(auto f = k.begin();f != k.end();++f){
			for(auto b = next(f, 1);b != k.end();++b){
				int diff = (*b - *f);
				// cout << "diff : " << diff << endl;
				if(diff > (n - 1) / 2) {
					diff = n - diff;
				}
				ans[diff] += 2;
			}
		}
		for(int i = 1;i <= (n - 1) / 2;++i){
			cout << ans[i] << endl;
		}
	}
	return 0;
}

