#include <iostream>
#include <cstring>
using namespace std;

bool flg[10002];
int cnt[10002];

int main(){
  int n;

  while(cin >> n, n){
    memset(flg, 0, sizeof(flg));
    memset(cnt, 0, sizeof(cnt));

    for(int i = 1; i < n; i++){
      flg[(i * i) % n] = true;
    }

    for(int i = 0; i < n; i++){
      if(!flg[i]) continue;

      for(int j = i + 1; j < n; j++){
	if(!flg[j]) continue;

	int cal = j - i;
	if(cal > (n - 1) / 2) cal = n - cal;
	cnt[cal]++;

	cal = i - j + n;
	if(cal > (n - 1) / 2) cal = n - cal;
	cnt[cal]++;
      }
    }

    for(int i = 1; i <= (n - 1) / 2; i++){
      cout << cnt[i] << endl;
    }
  }
}