#include<iostream>
#include<algorithm>
#include<vector>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
using namespace std;

int main()
{
  int ans[100000000],n; 
  while(cin >> n,n)
    {
      vector<int> vec;
      rep(i,(int)((n-1)/2)+1)ans[i] = 0;
      REP(i,1,n)vec.push_back((i*i)%n);
      sort(vec.begin(),vec.end()); 
      vec.erase(unique(vec.begin(),vec.end()),vec.end());
      rep(i,vec.size())
	{
	  rep(j,vec.size())
	    {
	      int diff = vec[i] - vec[j];
	      if(diff < 0)diff += n;
	      if(diff > (n-1)/2)diff = n - diff;
	      if(1 <= diff && diff <= (n-1)/2)ans[diff]++;
	    }
	}
      REP(i,1,(int)((n-1)/2)+1)cout << ans[i] << endl;
    }
  return 0;
}