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>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
const int MX1 = 3e5 + 3;
const int MX2 = 1e6 + 3;
const long long int inf = 1e18;
const long long int mod = 1e9 + 7;
long long int power(long long int a, long long int b) {
  long long int res = 1;
  while (b) {
    if (b % 2) res = (res * a) % mod;
    a = (a * a) % mod;
    b /= 2;
  }
  return res;
}
long long int mmi(long long int a) { return power(a, mod - 2); }
long long int cntbit(long long int n) {
  long long int cnt = 0;
  while (n) {
    n &= (n - 1);
    cnt++;
  }
  return cnt;
}
int n, m;
int a[MX1];
long long int BIT[MX1];
int divi[MX2];
set<int> st;
void update(int x, int val) {
  for (; x <= n; x += x & -x) {
    BIT[x] += 1LL * val;
  }
}
long long int query(int x) {
  long long int sum = 0;
  for (; x > 0; x -= x & -x) {
    sum += BIT[x];
  }
  return sum;
}
void divisors() {
  for (int i = 1; i < MX2; i++) {
    for (int j = i; j < MX2; j += i) {
      divi[j]++;
    }
  }
}
void solve() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    update(i, a[i]);
    st.insert(i);
  }
  for (int i = 1; i <= m; i++) {
    int c;
    scanf("%d", &c);
    if (c == 1) {
      int l, r;
      scanf("%d %d", &l, &r);
      if (st.empty()) continue;
      for (auto it = st.lower_bound(l); it != st.upper_bound(r);) {
        if (a[*it] == divi[a[*it]]) {
          auto nx = it;
          if (nx != st.lower_bound(l)) {
            nx--;
            st.erase(it);
            if (st.empty()) break;
            it = nx;
            it++;
            continue;
          } else {
            nx++;
            st.erase(it);
            if (st.empty()) break;
            it = nx;
            continue;
          }
        }
        update(*it, -a[*it]);
        a[*it] = divi[a[*it]];
        update(*it, a[*it]);
        it++;
      }
    } else {
      int l, r;
      scanf("%d %d", &l, &r);
      long long int ans = query(r) - query(l - 1);
      printf("%lld\n", ans);
    }
  }
}
int main() {
  divisors();
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
