#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
typedef complex<double> P;
typedef long long int Int;

int main() {
  Int N;
  while(cin >>N && N){
    set<Int> S;
    FOR(i, 1, N) S.insert((i * i) % N);
    vector<Int> v(S.begin(), S.end()), cnt((N - 1) / 2 + 1, 0);
    REP(i, v.size()){
      REP(j, v.size()){
        if(i == j) continue;
        int n = v[i] - v[j];
        if(n < 0) n += N;
        if(n > (N - 1) / 2) n = N - n;
        cnt[n]++;
      }
    }
    FOR(i, 1, cnt.size()) cout <<cnt[i] <<endl;
  }
  return 0;
}