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

#define MAX_N 10000

using namespace std;

int prime[MAX_N];
bool is_prime[MAX_N + 1];
bool is_p[MAX_N + 1];
vector<int> prime2;
int data[MAX_N];
set<int> used;

int sieve(int n){
  int p = 0;
  for(int i=0;i<=n;i++) is_prime[i] = true;
  is_prime[0] = is_prime[1] = false;
  for(int i=2;i<=n;i++){
    if(is_prime[i]){
      prime[p++] = i;
      for(int j=2*i;j<=n;j+=i) is_prime[j] = false;
    }
  }
  return p;
}

void solve(int n){
  int size = (n-1)/2;
  /*if(is_p[n]){
    for(int i=0;i<size;i++){
      cout << size-1 << endl;
    }
    return;
    }*/
  fill(data, data+size, 0);
  used.clear();
  for(int i=1;i<=size;i++){
    int tmp = (i*i)%n;
    used.insert(tmp);
  }
  set<int>::iterator ite = used.begin();
  for(;ite!=used.end();ite++){
    for(set<int>::iterator ite2 = used.begin();ite2!=used.end();ite2++){
      if(ite == ite2) continue;
      int a = *ite;
      int b = *ite2;
      int c = a-b;
      if(c < 0) c += n;
      if(c > size) c = n - c;
      ++data[c-1];
    }
    }
  for(int i=0;i<size;i++){
    cout << data[i] << endl;
  }
}

main(){
  int size = sieve(MAX_N);
  for(int i=0;i<size;i++){
    if(prime[i] % 4 == 3){
      prime2.push_back(prime[i]);
      is_p[prime[i]] = true;
    }
  }
  int n;
  while(cin >> n && n){
    /*if(n == 1){
      cout << 0 << endl;
      continue;
      }*/
    solve(n);
  }
  return 0;
}