#include <cstdio>
#include <iostream>
#include <string>
#include <set>
#include <algorithm>
#define rep(i, n) for (int i=0; i<n; i++)
#define REP(n) rep(i, n)
//#define int long long
using namespace std;

int n, idx, x, arr[10000], c[10000];
set<int> si; 

signed main()
{
    while (cin >> n, n)
    {   
        idx = 0;
        si.clear();

        for (int i=1; i<=(n-1)/2; i++) c[i] = 0;

        for (int i=1; i<n; i++)
        {   
            x = (i * i) % n;
            if (si.find(x) == si.end())
            {   
                si.insert(x);
                arr[idx++] = x;
            }   
        }   

        rep(i, idx)
        {   
            rep(j, idx)
            {   
                if (i == j) continue;
                int sub = arr[i] - arr[j];
                if (sub < 0) sub += n;
                if (sub > (n - 1) / 2) sub = n - sub;
                c[sub]++;
            }   
        }   

        for (int i=1; i<=(n-1)/2; i++) cout << c[i] << endl;
    }   

    return 0;
}