#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <cstring>
#include <deque>
#include <cstdio>
#include <cmath>

using namespace std;

#define reep(i,f,t) for(int i=f ; i<int(t) ; ++i)
#define rep(i,n) reep(i, 0, n) 

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int main()
{
	int n;
	while(scanf("%d", &n), n){
		vi nums;
		nums.reserve(10000);
		reep(i, 1, n)
			nums.push_back((i*i)%n);
		int half = (n-1) / 2;

		sort(nums.begin(), nums.end());
		int size = distance(nums.begin(), unique(nums.begin(), nums.end()));

		vi ans(half+1, 0);
		rep(i, size){
			rep(j, i+1){
				int p = abs(nums[i]-nums[j]);
				if(p>half) p = n - p;
				++ans[p];
			}
		}
		reep(i, 1, half+1)
			printf("%d\n", ans[i]*2);
	}

	return 0;
}