//Nature of Prime Numbers
#include <stdio.h>
#include <string.h>
#include <set>

int main(){
  int n;
  while(1){
    scanf("%d", &n);
    if(n == 0){
      break;
    }
    std::set<int> S;
    int A[n / 2 + 1];
    memset(A, 0, sizeof(A));
    for(int i = 1; i < n; ++i){
      S.insert(i * i % n);
    }
	for(std::set<int>::iterator a = S.begin();a != S.end(); ++a){
      for(std::set<int>::iterator b = S.begin();b != S.end(); ++b){
        if(a == b){
          continue;
        }
        int c = *a - *b;
        if(c < 0){
          c = c + n;
        }
        if(c > (n - 1) / 2){
          c = n - c;
        }
        A[c]++;
      }
    }
    for(int i = 1; i <= (n - 1) / 2; ++i){
      printf("%d\n", A[i]);
    }
  }    
  return 0;
}