#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
static const double EPS = 1e-5;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)

int main(void){
  int n;
  while(cin>>n){
    if(n==0) break;
    set<int> c;
    FOR(i,1,n){
      int mod = (i*i)%n; 
      c.insert(mod);
    }
    int count[5001]={0};
    vector<int> d;
    set<int>::iterator it = c.begin();
    for(;it!=c.end(); it++){
      d.push_back((*it));
    }
    FOR(i,0,d.size()){
      FOR(j,i+1,d.size()){
        count[ min( abs(d[i]-d[j]), n - abs(d[i]-d[j])) ]++;
      }
    }
    FOR(i,1,(n-1)/2+1){
      cout<<2*count[i]<<endl;
    }
  }

  return 0;
}