#include <bits/stdc++.h>

using namespace std;

int main()
{
  int n;
  while(cin >> n, n){
    int m = (n-1) / 2;
    bool sq[10001] = {false};
    int a[5001] = {0};
    for(int i = 1; i < n; i++) sq[(i*i)%n] = true;
    for(int i = 1; i < n; i++){
      if(!sq[i]) continue;
      for(int j = 1; j < n; j++){
	if(i == j) continue;
	if(!sq[j]) continue;
	int d = i - j;
	if(d < 0){
	  if(d + n > m) a[n-(d+n)]++;
	  else a[d+n]++;
	} else {
	  if(d > m) a[n-d]++;
	  else a[d]++;
	}
      }
    }
    for(int i = 1; i <= m; i++) cout << a[i] << endl;
  }
  return 0;
}