#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

bool exists(vector<int> v, int n) {
    for (int i = 0; i < v.size(); i++) {
        if (v[i] == n) return true;
    }
    return false;
}

int main() {
    while (true) {
        int n;
        cin >> n;
        if (!n) return 0;
        int count[(n - 1) / 2 + 1];
        vector<int> mod;
        for (int i = 0; i < (n - 1) / 2 + 1; i++) {
            count[i] = 0;
        }
        for (int i = 1; i < n; i++) {
            int res = (i * i) % n;
            if (!exists(mod, res)) {
                mod.push_back(res);
            }
        }
        for (int i = 0; i < mod.size(); i++) {
            for (int j = 0; j < mod.size(); j++) {
                if (i == j) continue;
                int res = mod[i] - mod[j];
                if (res < 0) res += n;
                if (res > (n - 1) / 2) res = n - res;
                count[res]++;
            }
        }
        for (int i = 1; i < (n - 1) / 2 + 1; i++) {
            cout << count[i] << endl;
        }
    }
}