#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
#define UNIQUE(v) v.erase(unique(v.begin(),v.end()),v.end())
signed main() {
	for (int n; cin >> n&&n;) {
		vector<int> cnt((n - 1) / 2 + 1, 0);
		vector<int> v;
		rep(i, 1, n) {
			v.emplace_back((i*i) % n);
		}
		sort(all(v));
		UNIQUE(v);
		dumpc(v);
		rep(i, 0, v.size())rep(j, 0, v.size()) {
			if (v[i] == v[j])continue;
			int diff = v[i] - v[j];
			if (diff < 0)diff += n;
			if (diff > (n - 1) / 2.0)diff = n - diff;
			dump(diff);
			dump(cnt.size());
			cnt[diff]++;
		}
		dumpc(cnt);
		rep(i, 1, (n - 1) / 2 + 1)cout << cnt[i] << endl;
	}
	return 0;
}