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

const int MAX = 5001;
const int INF = (1<<20);

int data[MAX],n;


void solve(){
  vector<int> V;
  fill(data,data+MAX,0);
  for(int i = 1; i < n; i++){
    V.push_back((i*i)%n);
  }
  V.push_back(-1);
  V.push_back(INF);
  sort(V.begin(),V.end());
  vector<int> VV;
  int now = -1;
  while(1){
    now = *upper_bound(V.begin(),V.end(),now);
    if(now == INF) break;
    VV.push_back(now);
  }
  for(int i = 0; i < VV.size(); i++)
    for(int j = 0; j < VV.size(); j++){
      int num = VV[i]-VV[j];
      if(num < 0) num += n;
      if(num > (n-1)/2) num = n-num;
      data[num]++;
    }
}

void print(){
  for(int i = 1; i <= (n-1)/2; i++)
    printf("%d\n",data[i]);
}


int main(){
  while(scanf("%d",&n) && n){
    solve();
    print();
  }
  return 0;
}