#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()

using namespace std;

typedef unsigned int uint;
typedef long long ll;

#define MAX 10000

int data[MAX+1];
int s[MAX+1];
int ans[MAX+1];

int main(){
  int n;
  while(scanf("%d",&n),n){
    int cnt = 0;
    memset(ans , 0, sizeof(int) * n);
    memset(data, 0, sizeof(int) * n);
    for(int i=1; i<n; i++){
      int tmp = (i * i) % n;
      if(data[tmp] == 0){
        data[tmp] = 1;
        s[cnt++] = tmp;
      }
    }
    sort(s, s+cnt);
    for(int i=0; i<cnt; i++){
      for(int j=i+1; j<cnt; j++){
        int tmp = s[i] - s[j];
        int tmp2= s[j] - s[i];
        if(tmp  < 0) tmp  += n;
        if(tmp2 < 0) tmp2 += n;
        if(tmp  > (n-1)/2) tmp  = n - tmp;
        if(tmp2 > (n-1)/2) tmp2 = n - tmp2;
        ans[tmp]++; ans[tmp2]++;
      }
    }
    REP(i,(n-1)/2) printf("%d\n",ans[i+1]);
  }
  return 0;
}