#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

#define all(c) (c).begin(), (c).end()
#define loop(i,a,b) for(int i=a; i<int(b); i++)
#define rep(i,b) loop(i,0,b)
#define each(e,c) for(auto& e:c)
#define iter(it,c) for(auto it=c.begin(); it!=c.end(); ++it)

int main(){
    int n;
    while(cin>>n && n){
        vector<int> sq;
        for(int i=1;i<=n/2;i++){
            sq.push_back((i*i)%n);
        }
        sort(all(sq));
        sq.erase(unique(all(sq)),sq.end());
        int ans[5000]={};
        rep(i,sq.size()){
            rep(j,sq.size()){
                int t=sq[i],u=sq[j];
                int x=min(abs(t-u),n-abs(t-u));
                ans[x]++;
            }
        }
        for(int i=1;i<=n/2;i++){
            cout<<ans[i]<<endl;
        }
    }
}