
#include<iostream>
#include<vector>
#include<set>
using namespace std;

int main()
{
  int n;
  vector<int> num(50000);
  set<int> a;
  set<int>::iterator it, itr;
  int i, t;

  while (cin>>n, n) {
    a.clear();
    for (i = 0; i < n; i++) num[i] = 0;
    for (i = 1; i < n; i++) a.insert((i*i)%n);
    for (it = a.begin(); it != a.end(); it++) {
      for (itr = it; itr != a.end(); itr++) {
	t = *it - *itr;
	if (t == 0) continue;
	if (t < 0) t += n;
	if ((n-1)/2 < t) t = n-t;
	num[t] += 2;
      }
    }
    for (i = 1; i <= (n-1)/2; i++)
      cout<<num[i]<<endl;
  }
  return 0;
}