Let D(x) be the number of positive divisors of a positive integer x. For example, D(2) = 2 (2 is divisible by 1 and 2), D(6) = 4 (6 is divisible by 1, 2, 3 and 6).

You are given an array a of n integers. You have to process two types of queries:

  1. REPLACE l r — for every <image> replace ai with D(ai); 
  2. SUM l r — calculate <image>. 



Print the answer for each SUM query.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 3·105) — the number of elements in the array and the number of queries to process, respectively.

The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 106) — the elements of the array.

Then m lines follow, each containing 3 integers ti, li, ri denoting i-th query. If ti = 1, then i-th query is REPLACE li ri, otherwise it's SUM li ri (1 ≤ ti ≤ 2, 1 ≤ li ≤ ri ≤ n).

There is at least one SUM query.

Output

For each SUM query print the answer to it.

Example

Input

7 6
6 4 1 10 3 2 4
2 1 7
2 4 5
1 3 5
2 4 4
1 5 7
2 1 7


Output

30
13
4
22
#include <bits/stdc++.h>
using namespace std;
const long long M = 1e6 + 1;
const long long N = 3e5 + 1;
const long long P = 1e5 + 1;
long long bit[N];
long long arr[N];
long long one[N];
long long lp[M];
long long p[P];
long long cur;
long long n, q;
pair<long long, long long> d[M];
struct Dsu {
  long long par[N];
  long long cnt[N];
  long long nxt[N];
} dsu;
void update(long long i, long long key) {
  for (; i < N; i += (i & -i)) bit[i] += key;
}
long long query(long long i) {
  long long res = 0;
  for (; i; i -= (i & -i)) res += bit[i];
  return res;
}
void sieve() {
  for (long long i = 2; i < M; ++i) {
    if (!lp[i]) {
      lp[i] = p[cur++] = i;
      d[i] = {1, 2};
    }
    for (long long j = 0; j < cur && p[j] <= lp[i] && i * p[j] < M; ++j) {
      lp[i * p[j]] = p[j];
      if (lp[i] == p[j]) {
        d[i * p[j]] = {d[i].first, d[i].second + 1};
      } else {
        d[i * p[j]] = {d[i].first * d[i].second, 2};
      }
    }
  }
}
long long findset(long long u) {
  return (dsu.par[u] == u ? u : dsu.par[u] = findset(dsu.par[u]));
}
void unite(long long u, long long v) {
  u = findset(u);
  v = findset(v);
  if (u == v) return;
  if (dsu.cnt[u] < dsu.cnt[v]) {
    swap(u, v);
  }
  dsu.nxt[u] = max(dsu.nxt[u], dsu.nxt[v]);
  dsu.cnt[u] += dsu.cnt[v];
  dsu.par[v] = u;
}
void make_set(long long u) {
  dsu.par[u] = u;
  dsu.nxt[u] = u;
  dsu.cnt[u] = 1;
}
long long query(long long l, long long r) {
  return query(r) - query(l - 1) - (one[r] - one[l - 1]);
}
void replace(long long l, long long r) {
  for (long long i = dsu.nxt[findset(l)]; i <= r; i = dsu.nxt[findset(i)] + 1) {
    update(i, d[arr[i]].first * d[arr[i]].second - arr[i]);
    arr[i] = d[arr[i]].first * d[arr[i]].second;
    if (arr[i] == 2) {
      if (arr[i - 1] == 2) {
        unite(i, i - 1);
      }
      if (arr[i + 1] == 2) {
        unite(i, i + 1);
      }
    }
  }
}
void input() {
  cin >> n >> q;
  for (long long i = 1; i <= n; ++i) {
    make_set(i);
    cin >> arr[i];
    one[i] = one[i - 1];
    if (arr[i] == 1) {
      arr[i] = 2;
      one[i]++;
    }
    update(i, arr[i]);
  }
  make_set(n + 1);
}
void solve() {
  for (long long i = 0; i < q; ++i) {
    long long t;
    cin >> t;
    long long l;
    cin >> l;
    long long r;
    cin >> r;
    if (t == 1) {
      replace(l, r);
    } else {
      cout << query(l, r) << "\n";
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  sieve();
  input();
  solve();
}
