#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
using namespace std;

typedef istringstream ISS;
typedef ostringstream OSS;
typedef vector<string> VS;
typedef int INT;
typedef vector<INT> VI;
typedef vector<VI> VVI;
typedef pair <INT, INT> II;
typedef vector <II> VII;

template<class T> ostream& operator << ( ostream& os, vector<T> v ) {
    for ( typename vector<T>::iterator it_i = v.begin(); it_i != v.end(); ++it_i ) {
        os << *it_i << ", ";
    }
    return os;
}


typedef set <int> SI;

int B[10001];

int main() {
    int n;
    while ( cin >> n && n ) {
        SI A;
        for ( int i = 1; i < n; ++ i ) {
            A.insert( ( i * i ) % n );
        }
        fill( B, B+10001, 0 );
        for ( SI::iterator it_i = A.begin(); it_i != A.end(); ++ it_i ) {
            for ( SI::iterator it_j = it_i; it_j != A.end(); ++ it_j ) {
                if ( *it_i == *it_j ) continue;
                int sub = *it_i - *it_j;
                if ( sub < 0 ) sub += n;
                if ( sub * 2 > ( n - 1 ) ) sub = n - sub;
                B[sub] ++;
            }
        }
        for ( int i = 1; 2 * i <= n - 1; ++ i ) {
            cout << B[i] * 2 << endl;
        }
    }
    return 0;
}