#include <bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define repb(i,a,b) for(int i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
//#define int long long
#define fi first
#define se second
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

signed main() {
	int n;
	while (cin >> n, n) {
		set<int> st;
		rep(i, 1, n) {
			int tmp = i * i % n;
			if (!st.count(tmp)) {
				st.insert(tmp);
			}
		}
		vi d(n / 2 + 1, 0);
		for (auto i = st.begin(); i != st.end(); i++) {
			for (auto j = st.begin(); j != st.end(); j++) {
				int tmp = abs(*i - *j);
				if (tmp > n / 2) {
					tmp = n - tmp;
				}
				d[tmp]++;
			}
		}
		rep(i, 1, n / 2 + 1) {
			cout << d[i] << endl;
		}
	}
}