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

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()
#define foreach(p,r) for(p::iterator it=r.begin();it!=r.end();++it)

const int MAXN = 10000;
vector<int> nums(MAXN);
vector<int> ans(MAXN);
int main()
{
    int n;
    while(cin >> n && n)
    {
        int half = (n-1)/2;
        set<int> sq;
        fill(all(ans),0);

        REP(n - 1) sq.insert(((i + 1) * (i + 1)) % n);
        int l = 0;
        foreach(set<int>,sq){ nums[l] = *it ; l++;}

        //REP(l-1)for(int j = i+1;j<l;j++)
        REP(l)rep(j,l)
        {
            if(i==j) continue;
            int res = nums[j] - nums[i];
            if(res < 0) res += n;
            if(res > half) res = n - res;
            ans[res]++;
            //cout <<"add" <<  res <<endl;
        }
        REP(half) cout << ans[i + 1] << endl;
    }

    return 0;
}