Problem: 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

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T biton(T n, T pos) {
  return n | ((T)1 << pos);
}
template <class T>
inline T bitoff(T n, T pos) {
  return n & ~((T)1 << pos);
}
template <class T>
inline T ison(T n, T pos) {
  return (bool)(n & ((T)1 << pos));
}
template <class T>
inline T gcd(T a, T b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
inline int nxt() {
  int aaa;
  scanf("%d", &aaa);
  return aaa;
}
inline long long lxt() {
  long long aaa;
  scanf("%lld", &aaa);
  return aaa;
}
inline double dxt() {
  double aaa;
  scanf("%lf", &aaa);
  return aaa;
}
template <class T>
inline void vinput(T n, vector<T>& v) {
  for (T in, i = 0; i < n; i++) {
    cin >> in;
    v.push_back(in);
  }
}
template <class T>
inline void vout(vector<T> v) {
  for (auto it : v) cout << it << " ";
  cout << endl;
}
const long long M = 1e9 + 7;
int cs = 0;
vector<int> v;
vector<int> primes;
void sieve(int n) {
  vector<bool> check(n + 1, false);
  primes.push_back(2);
  for (int i = 3; i * i <= n; i += 2) {
    for (int j = i * i; j <= n; j += i * 2) {
      check[j] = true;
    }
  }
  for (int i = 3; i <= n; i += 2) {
    if (!check[i]) primes.push_back(i);
  }
}
int NOD(int n) {
  int sqrtn = sqrt(n);
  int res = 1;
  for (int i = 0; i < primes.size() && primes[i] <= sqrtn; i++) {
    if (n % primes[i] == 0) {
      int cnt = 0;
      while (n % primes[i] == 0) {
        n /= primes[i];
        cnt++;
      }
      sqrtn = sqrt(n);
      cnt++;
      res *= cnt;
    }
  }
  if (n != 1) {
    res *= 2;
  }
  return res;
}
vector<int> nod(1e6 + 5, 0);
void genDiv() {
  for (int i = 1; i <= 1e6; i++) {
    nod[i] = NOD(i);
  }
}
struct data {
  long long val;
  int mx;
  data(long long _val, int _mx) {
    val = _val;
    mx = _mx;
  }
  data() { val = 0, mx = 0; }
};
data tree[4 * 300010];
void buildTree(int node, int s, int e) {
  if (s == e) {
    tree[node].val = v[s - 1];
    tree[node].mx = v[s - 1];
    return;
  }
  long long mid = (s + e) / 2;
  long long left = 2 * node;
  long long right = left + 1;
  buildTree(left, s, mid);
  buildTree(right, mid + 1, e);
  tree[node].val = tree[left].val + tree[right].val;
  tree[node].mx = max(tree[left].mx, tree[right].mx);
}
void update(int node, int s, int e, int l, int r) {
  if (s > e) return;
  if (s > r || e < l) return;
  if (tree[node].mx <= 2) return;
  if (s == e) {
    tree[node].mx = nod[tree[node].val];
    tree[node].val = nod[tree[node].val];
    return;
  }
  int mid = (s + e) / 2;
  int left = 2 * node;
  int right = left + 1;
  update(left, s, mid, l, r);
  update(right, mid + 1, e, l, r);
  tree[node].val = tree[left].val + tree[right].val;
  tree[node].mx = max(tree[left].mx, tree[right].mx);
}
long long query(int node, int s, int e, int i, int j) {
  if (j < s || i > e) {
    return 0;
  }
  if (i <= s && j >= e) {
    return tree[node].val;
  }
  int mid = (s + e) / 2;
  int left = 2 * node;
  int right = left + 1;
  long long x = query(left, s, mid, i, j);
  long long y = query(right, mid + 1, e, i, j);
  return x + y;
}
void solve() {
  int n, q;
  cin >> n >> q;
  vinput(n, v);
  buildTree(1, 1, n);
  while (q--) {
    int choice, l, r;
    cin >> choice >> l >> r;
    if (choice == 1) {
      update(1, 1, n, l, r);
    } else {
      cout << query(1, 1, n, l, r) << endl;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout.setf(ios::fixed);
  cout.precision(2);
  int tc = 1;
  sieve(1000005);
  genDiv();
  while (tc--) solve();
  return 0;
}