#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const double eps = 0.0000000001;
const int maxn = 5000 + 10;
const int mod = 1000000007;
using namespace std;
int a[maxn];
int vis[maxn];
int d[maxn];
int cnt[maxn][maxn];
int ans[maxn];
bool f(long long a) {
  if (a < 0) return false;
  long long s = (long long)sqrt(a);
  if (s * s == a)
    return true;
  else
    return false;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  d[0] = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0) {
      d[i] = d[i - 1];
      for (int j = 1; j <= n; j++) cnt[i][j] = cnt[i - 1][j];
      continue;
    }
    for (int j = 1; j < i; j++) {
      if (a[j] == 0) continue;
      long long cc = 1ll * a[i] * a[j];
      if (f(cc)) {
        vis[i] = vis[j];
        d[i] = d[i - 1];
        break;
      }
    }
    if (!vis[i]) {
      vis[i] = i;
      d[i] = d[i - 1] + 1;
    }
    cnt[i][vis[i]]++;
    for (int j = i + 1; j <= n; j++) cnt[j][vis[i]]++;
  }
  int pos = 0;
  for (int i = 1; i <= n; i++)
    if (vis[i]) {
      pos = i;
      break;
    }
  int cc = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0) {
      cc++;
      continue;
    }
    ans[1] += cc * (cc + 1) / 2;
    for (int j = i; j <= n; j++) {
      if (a[j] == 0) {
        ans[d[j - 1]] += cc + 1;
        continue;
      }
      if (cnt[j][vis[i - cc - 1]] && i != pos) cnt[j][vis[i - cc - 1]]--;
      if (cnt[j][vis[i - cc - 1]] == 0 && i != pos)
        for (int k = j; k == j || a[k] == 0; k++) d[k]--;
      ans[d[j]] += cc + 1;
    }
    cc = 0;
  }
  ans[1] += cc * (cc + 1) / 2;
  for (int i = 1; i <= n; i++) printf("%s%d", i == 1 ? "" : " ", ans[i]);
  printf("\n");
  return 0;
}
