#include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

//#define int long long
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define dump(o) if(DEBUG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DEBUG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;
const bool DEBUG = false;

#define MAX 10010

signed main() {
	int cnt1[MAX] = {};
	int cnt2[MAX] = {};
	for (int n; cin >> n&&n;) {
		memset(cnt1, 0, sizeof(cnt1));
		memset(cnt2, 0, sizeof(cnt2));
		rep(i, 1, n) {
			cnt1[(i*i) % n]++;
		}
		rep(i, 1, n)cnt1[i] /= 2;
		dumpc(cnt1);
		rep(i, 1, n)rep(j, 1, n) {
			if (i == j)continue;
			if (cnt1[i] && cnt1[j]) {
				int diff = i - j;
				if (diff < 0)diff += n;
				if (diff > (n - 1) / 2)diff = n - diff;
				cnt2[diff]++;
			}
		}
		dumpc(cnt2);
		rep(i, 1, (n - 1) / 2 + 1)cout << cnt2[i] << endl;
	}
	return 0;
}