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

int main() {
    while (true) {
        int n;
        cin >> n;
        if (n == 0) {
            break;
        }
        set<int> remains;
        for (int i = 1; i < n; i++) {
            int remain = (i * i) % n;
            remains.insert(remain);
        }
        int max = (n - 1) / 2;
        int* differences = new int [max + 1];
        fill_n(differences, max + 1, 0);
        for (set<int>::iterator it1 = remains.begin(); it1 != remains.end(); it1++) {
            for (set<int>::iterator it2 = it1; it2 != remains.end(); it2++) {
                if (it1 == it2) {
                    continue;
                }
                int diff = *it1 - *it2;
                if (diff < 0) {
                    diff += n;
                }
                if (diff > max) {
                    diff = n - diff;
                }
                differences[diff] += 2;
            }
        }
        for (int i = 1; i <= max; i++) {
            cout << differences[i] << endl;
        }
        delete[] differences;
    }
}