#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
static const int MAX = 10000;

int n, T[MAX+1];

void solve(){
  vector<int> S;
  for ( int i = 1; i <= (n-1)/2; i++ ) T[i] = 0;
  for ( int i = 1; i <= n-1; i++ ) S.push_back((i*i)%n);
  sort(S.begin(), S.end());
  S.erase(unique(S.begin(), S.end()), S.end());
  for ( int i = 0; i < S.size(); i++ ){
    for ( int j = 0; j < S.size(); j++ ){
      if ( i == j ) continue;
      int d = S[j] - S[i];
      if ( d < 0 ) d += n;
      if ( d > (n-1)/2 ) d = n-d;
      T[d]++;
    }
  }
  for ( int i = 1; i <= (n-1)/2; i++ ) cout << T[i] << endl;
}

main(){
  while(1){
    cin >> n;
    if ( n == 0 ) break;
    solve();
  }
}