#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
#ifdef _DEBUG_
#define dump(val) cerr << __LINE__ << ":\t" << #val << " = " << (val) << endl
#else
#define dump(val)
#endif

using namespace std;

typedef long long int ll;

template<typename T>
vector<T> make_v(size_t a, T b) {
    return vector<T>(a, b);
}
template<typename... Ts>
auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v(ts...))>(a, make_v(ts...));
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n;
    while (cin >> n, n) {
        vector<int> v(n - 1, 0);
        REP(i, 0, n - 1) {
            v[i] = ((i + 1) * (i + 1)) % n;
        }
        sort(v.begin(), v.end());
        v.erase(unique(v.begin(), v.end()), v.end());
        vector<int> m(n, 0);
        REP(i, 0, v.size()) {
            REP(j, 0, v.size()) {
                if (i == j) continue;
                int diff = v[i] - v[j];
                if (diff < 0) {
                    diff += n;
                }
                if ((n - 1) / 2 < diff) {
                    diff = n - diff;
                }
                m[diff] += 1;
            }
        }
        REP(i, 1, (n - 1) / 2 + 1) {
            cout << m[i] << endl;
        }
    }
    return 0;
}

