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

int main() {
    int n;
    while (cin >> n, n) {
        int m = (n-1)/2;
        vector<int> v;
        for (int i=1; i<n; ++i) {
            v.push_back((i*i) % n);
        }
        sort(v.begin(), v.end());
        v.erase(unique(v.begin(), v.end()), v.end());
        vector<int> cnt(m+1, 0);
        for (int i=0; i<(int)v.size(); ++i) {
            for (int j=0; j<(int)v.size(); ++j) {
                int sub = v[i] - v[j];
                if (sub < 0) sub += n;
                if (m < sub) sub = n - sub;
                cnt[sub] ++;
            }
        }
        for (int i=1; i<=m; ++i) {
            cout << cnt[i] << endl;
        }
    }
    return 0;
}