#include <iostream>
#include <set>
#include <vector>
#include <algorithm>

int main()
{
	int n;
	while (true) {
		std::cin >> n;
		if (n==0) break;
		
		std::set<int> rem;
		for (int i=1; i<=n/2; i++) {
			rem.insert((i*i)%n);
		}
		std::vector<int> v(n/2);
		for (std::set<int>::iterator it1 = rem.begin(); it1 != rem.end(); ++it1) {
			int a = *it1;
			for (std::set<int>::iterator it2 = rem.begin(); it2 != rem.end(); ++it2) {
				if (it1 == it2) continue;
				int b = *it2;
				int d = a-b;
				if (d<0) d += n;
				if (d>n/2) d = n - d;
				v[d-1]++;
			}
		}
		for (int i=0; i<n/2; i++) std::cout << v[i] << std::endl;
	}
		
	return 0;
}

