#include <bits/stdc++.h>
using namespace std;
long long n, x[5001], fa[5001], ans[5001], num[5001];
long long find(long long x) {
  if (fa[x] == x) return x;
  return fa[x] = find(fa[x]);
}
void merge(long long x, long long y) { fa[find(x)] = find(y); }
signed main() {
  scanf("%lld", &n);
  for (long long i = 1; i <= n; i++) scanf("%lld", &x[i]), fa[i] = i;
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j < i; j++)
      if (x[i] * x[j] > 0) {
        long long tmp = (long long)sqrt(x[i] * x[j]);
        if (tmp * tmp == x[i] * x[j]) merge(i, j);
      }
  for (long long i = 1; i <= n; i++) {
    long long tot = 0;
    memset(num, 0, sizeof(num));
    for (long long j = i; j <= n; j++)
      if (x[j] == 0)
        ans[max(1ll, tot)]++;
      else {
        if (!num[find(j)]) num[find(j)] = 1, tot++;
        ans[tot]++;
      }
  }
  for (long long i = 1; i <= n; i++) printf("%lld ", ans[i]);
}
