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 int N = 3e5 + 10;
const int A = 1e6 + 10;
const int INF = 1e9;
int nxt[N];
int nt[A];
int prime[A];
bool isprime[A];
int a[N];
void seive() {
  for (int i = 2; i < A; i++) {
    prime[i] = INF;
    isprime[i] = 1;
  }
  for (int i = 2; i * i < A; i++) {
    if (isprime[i]) {
      prime[i] = i;
      for (int j = i * i; j < A; j += i) {
        isprime[j] = 0;
        prime[j] = min(prime[j], prime[i]);
      }
    }
  }
  for (int i = 2; i < A; i++) {
    if (prime[i] == INF) {
      prime[i] = i;
    }
  }
  for (int i = 2; i < A; i++) {
    if (prime[i] == i) {
      nt[i] = 2;
    } else {
      multiset<int> t;
      int x = i;
      while (x > 1) {
        t.insert(prime[x]);
        x /= prime[x];
      }
      int res = 1;
      while (!t.empty()) {
        int p = *t.begin();
        res *= (t.count(p) + 1);
        t.erase(p);
      }
      nt[i] = res;
    }
  }
  nt[1] = 1;
}
long long Bit[N];
void inc(int pos, int val) {
  for (int i = pos; i < N; i += i & -i) {
    Bit[i] += val;
  }
}
long long sum(int pos) {
  long long res = 0;
  for (int i = pos; i > 0; i -= i & -i) {
    res += Bit[i];
  }
  return res;
}
int get_root(int t) {
  if (nxt[t] != t) {
    nxt[t] = get_root(nxt[t]);
  }
  return nxt[t];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  seive();
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    nxt[i] = i;
    inc(i, a[i]);
  }
  nxt[n + 1] = n + 1;
  while (m--) {
    int type, l, r;
    cin >> type >> l >> r;
    if (type == 1) {
      for (int i = l; i <= r; i++) {
        i = get_root(i);
        if (i > r) {
          break;
        }
        inc(i, -a[i]);
        a[i] = nt[a[i]];
        inc(i, a[i]);
        if (a[i] < 3) {
          nxt[i] = nxt[i + 1];
        }
      }
    } else {
      cout << sum(r) - sum(l - 1) << "\n";
    }
  }
  return 0;
}
