#include <iostream>
#include <algorithm>
#include <vector>
#include <unordered_set>
#include <iterator>
using namespace std;

int main() {
  while(true) {
    int N; cin >> N;
    if(N == 0) break;
    unordered_set<int> sqmod;
    for(int i = 1; i < N; ++i)
      sqmod.insert((i*i)%N);
    // sort(begin(sqmod), end(sqmod));
    // sqmod.erase(unique(begin(sqmod), end(sqmod)), end(sqmod));
    vector<int> cnt((N - 1) / 2 + 1, 0);
    for(int i : sqmod) {
      for(int j : sqmod) {
        if(i == j) continue;
        int diff = i - j;
        if(diff < 0) diff += N;
        if(diff > (N - 1)/2) diff = N - diff;
        cnt[diff]++;
      }
    }
    for(int i = 1; i < (int)cnt.size(); ++i) {
      cout << cnt[i] << endl;
    }
  }
}