#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>

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

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;

ll n;
V v1,v2;

int main(){
	while (cin >> n&&n){
		FOR(i, 1, n){
			ll k = i*i % n;
			if (find(ALL(v1), k) == v1.end()){
				v1.push_back(k);
			}
		}
		REP(i, v1.size()){
			REP(j, v1.size()){
				if (i != j){
					ll k = v1[i] - v1[j];
					if (k < 0)k += n;
					if (k > (n - 1) / 2)k = n - k;
					v2.push_back(k);
				}
			}
		}
		sort(ALL(v2));
		FOR(i, 1, (n - 1) / 2 + 1){
			cout << upper_bound(ALL(v2), i) - lower_bound(ALL(v2), i) << endl;
		}
		v1.clear();
		v2.clear();
	}
}