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;
long long int seg[4 * 300005];
long long int a[300005];
void build(long long int node, long long int start, long long int end) {
  if (start == end) {
    seg[node] = a[start];
    return;
  }
  long long int mid = (start + end) / 2;
  build(2 * node, start, mid);
  build(2 * node + 1, mid + 1, end);
  seg[node] = seg[2 * node] + seg[2 * node + 1];
}
void update(long long int node, long long int start, long long int end,
            long long int l, long long int val) {
  if (start > l or end < l or start > end) {
    return;
  }
  if (start == end) {
    seg[node] += val;
    return;
  }
  long long int mid = (start + end) / 2;
  update(2 * node, start, mid, l, val);
  update(2 * node + 1, mid + 1, end, l, val);
  seg[node] = seg[2 * node] + seg[2 * node + 1];
}
long long int query(long long int node, long long int start, long long int end,
                    long long int l, long long int r) {
  if (start > r or end < l or start > end) {
    return 0;
  }
  if (start >= l && end <= r) {
    return seg[node];
  }
  long long int mid = (start + end) / 2;
  long long int q1 = query(2 * node, start, mid, l, r);
  long long int q2 = query(2 * node + 1, mid + 1, end, l, r);
  return (q1 + q2);
}
long long int divv[1000005];
long long int spf[1000005];
long long int cnt[300005];
void sieve() {
  for (long long int i = 1; i < 1000005; i++) {
    spf[i] = i;
  }
  for (long long int i = 2; i < 1000005; i++) {
    if (spf[i] == i) {
      for (long long int j = 2 * i; j < 1000005; j += i) {
        if (spf[j] == j) {
          spf[j] = i;
        }
      }
    }
  }
}
long long int getdivis(long long int x) {
  map<long long int, long long int> m2;
  while (spf[x] != x) {
    m2[spf[x]]++;
    x = x / spf[x];
  }
  if (x > 1) {
    m2[x]++;
  }
  long long int ans = 1;
  for (auto i : m2) {
    ans = ans * (i.second + 1);
  }
  return ans;
}
void solve() {
  long long int n, m;
  cin >> n >> m;
  for (long long int i = 1; i < n + 1; i++) {
    cin >> a[i];
  }
  set<long long int> s;
  for (long long int i = 1; i < n + 1; i++) {
    s.insert(i);
  }
  sieve();
  build(1, 1, n);
  for (long long int i = 1; i < 1000005; i++) {
    divv[i] = getdivis(i);
  }
  for (long long int i = 1; i < n + 1; i++) {
    cnt[i] = 0;
  }
  while (m--) {
    long long int t, l, r;
    cin >> t >> l >> r;
    if (t == 1) {
      for (auto it = s.lower_bound(l); it != s.upper_bound(r);) {
        update(1, 1, n, *it, divv[a[*it]] - a[*it]);
        a[*it] = divv[a[*it]];
        cnt[*it]++;
        if (cnt[*it] >= 6) {
          auto jt = s.upper_bound(*it);
          s.erase(it);
          it = jt;
        } else {
          it++;
        }
      }
    } else {
      cout << query(1, 1, n, l, r) << '\n';
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tests = 1;
  while (tests--) {
    solve();
  }
}
