#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <numeric>
#include <cctype>

#define rep(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define ALL(v) (v).begin(), (v).end()
#define REV(s) (s).rbegin(), (s).rend()
#define MEMSET(v, s) memset(v, s, sizeof(v))
#define MP make_pair
#define X first
#define Y second

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

const int N = 10010;
int a[N];
int cnt[N];

int main(){
	int n;
	while(cin >> n, n){
		int m = (n-1)/2;
		MEMSET(a, 0);
		MEMSET(cnt, 0);
		FOR(i, 1, n) a[i*i%n] = 1;
		vector<int> v;
		v.reserve(n);
		rep(i, n) if(a[i]) v.push_back(i);
		rep(i, v.size()) rep(j, v.size()){
			if(i == j) continue;
			int x = v[i]-v[j];
			if(x < 0) x += n;
			if(x > m) x = n-x;
			++cnt[x];
		}
		
		FOR(i, 1, m+1) cout << cnt[i] << endl;
	}


	return 0;
}