#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <set>
using namespace std;

#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()

int main() {
  int n;
  while(cin >> n, n) {
    set<int> se;
    
    REP(i,n-1){
      se.insert((i+1)*(i+1)%n);
    }
    vector<int> v((n-1)/2);
    FOR(it1,se) {
      FOR(it2,se) {
        if (*it1==*it2) continue;
        int temp = abs(*it1-*it2);
        if (temp > (n-1)/2) temp = n-temp;
        v[temp-1]++;
      }
    }
    
    FOR(it,v) {
      cout << *it << endl;
    }
  }
}