#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>

using namespace std;

typedef pair<long long int, long long int> P;

long long int INF = 1e18;
long long int MOD = 1e9 + 7;

int main(){
    while(true){
        int n;
        cin >> n;
        if(n == 0){
            break;
        }
        map<int, bool> m;
        for(int i = 1; i < n; i++){
            m[(i * i) % n] = true;
        }
        vector<int> v;
        for(pair<int, bool> p : m){
            v.push_back(p.first);
        }
        int cnt[11000] = {};
        for(int i = 0; i < v.size(); i++){
            for(int j = 0; j < v.size(); j++){
                if(i == j){
                    continue;
                }
                int num = v[i] - v[j];
                if(num < 0){
                    num += n;
                }
                if(num > (n - 1) / 2){
                    num = n - num;
                }
                cnt[num] += 1;
            }
        }
        for(int i = 1; i <= (n - 1) / 2; i++){
            cout << cnt[i] << endl;
        }
    }
    return 0;
}
