#include <bits/stdc++.h>
using namespace std;
const int N = 5002;
int par[N], ans[N], a[N], last[N];
vector<int> v[N];
int get(int u) { return par[u] == u ? u : par[u] = get(par[u]); }
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", a + i), par[i] = i;
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      int x = a[i], y = a[j];
      if (x * 1LL * y <= 0) continue;
      int t = sqrt(x * 1LL * y);
      if (t * 1LL * t == x * 1LL * y || (t + 1LL) * (t + 1LL) == x * 1LL * y)
        par[get(i)] = get(j);
    }
  for (int i = 1; i <= n; i++) {
    memset(last, -1, sizeof last);
    int sum = 0;
    for (int j = i; j <= n; j++) {
      if (a[j] && last[get(j)] == -1) sum++;
      last[get(j)] = 1;
      ans[max(1, sum)]++;
    }
  }
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
}
