#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define MOD 1000000007
#define EPS 1e-10
#define MAX_N 100100
#define MAX_M 100100

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;
typedef pair<int, string> PSI;

int n;

set<int> si;
set<int>::iterator it, it2;

int main(){
	while (cin >> n&&n){
		int cnt[10000] = {};
		FOR(i, 1, n){
			si.insert((i*i) % n);
		}
		for (it = si.begin(); it != si.end(); it++){
			for (it2 = si.begin(); it2 != si.end(); it2++){
				if (it == it2)continue;
				int num = *it - *it2;
				if (num < 0)num += n;
				if (num > (n - 1) / 2)num = n - num;
				cnt[num]++;
			}
		}
		FOR(i, 1, (n - 1) / 2 + 1){
			cout << cnt[i] << endl;
		}
		si.clear();
	}
}