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>
#pragma GCC optimize("Ofast")
enum { WHITE, GREY, BLACK };
using namespace std;
long long int inf = 1e18;
template <class T>
T gcd(T a, T b) {
  return b == 0 ? a : gcd(b, a % b);
}
template <typename T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T>
T last_bit(T n) {
  return n & 1;
}
template <class T>
T big_mod(T n, T p, T m) {
  if (p == 0) return (T)1;
  T x = big_mod(n, p / 2, m);
  x = (x * x) % m;
  if (p & 1) x = (x * n) % m;
  return x;
}
template <class T>
T modInv(T a, T m) {
  T x, y;
  extgcd(a, m, x, y);
  x %= m;
  while (x < 0) {
    x += m;
  }
  return x;
}
template <class T>
T extgcd(T a, T b, T& x, T& y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  } else {
    int g = extgcd(b, a % b, y, x);
    y -= a / b * x;
    return g;
  }
}
template <class T>
T multiplication(T n, T p, T m) {
  if (p == 0) return (T)0;
  T x = multiplication(n, p / 2, m);
  x = (x + x) % m;
  if (p & 1) x = (x + n) % m;
  return x;
}
template <class T>
T my_pow(T n, T p) {
  if (p == 0) return 1;
  T x = my_pow(n, p / 2);
  x = (x * x);
  if (p & 1) x = (x * n);
  return x;
}
template <class T>
double getdist(T a, T b) {
  return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
template <class T>
T extract(string s, T ret) {
  stringstream ss(s);
  ss >> ret;
  return ret;
}
template <class T>
string tostring(T n) {
  stringstream ss;
  ss << n;
  return ss.str();
}
template <class T>
T Mod(T n, T m) {
  return (n % m + m) % m;
}
template <class T>
T MIN3(T a, T b, T c) {
  return min(a, min(b, c));
}
template <class T>
T MAX3(T a, T b, T c) {
  return max(a, max(b, c));
}
template <class T>
void print_vector(T& v) {
  int sz = v.size();
  if (sz) cout << v[0];
  for (int i = 1; i < sz; i++) cout << ' ' << v[i];
  cout << "\n";
}
bool isVowel(char ch) {
  ch = toupper(ch);
  if (ch == 'A' || ch == 'U' || ch == 'I' || ch == 'O' || ch == 'E')
    return true;
  return false;
}
bool isConsonant(char ch) {
  if (isalpha(ch) && !isVowel(ch)) return true;
  return false;
}
template <class R>
R Josephus(R n, R k) {
  R ans = 1;
  for (R i = 2; i <= n; i++) ans = (ans + k - 1) % i + 1;
  return ans;
}
template <class R>
R toitent_Phi2(R a) {
  R result = a;
  for (R i = 2; i * i <= a; i++) {
    if (a % i == 0) result = result - result / i;
    while (a % i == 0) a = a / i;
  }
  if (a > 1) result = result - result / a;
  return result;
}
template <typename T>
T Angle(T x1, T y1, T x2, T y2) {
  return atan(double(y1 - y2) / double(x1 - x2));
}
long long int a[300005];
long long int D[1000006];
long long int one[300005], two[300005];
long long int tree_1[4 * 300005], tree_2[4 * 300005];
void calc() {
  for (long long int i = 1; i <= 1e6; i++) {
    for (long long int j = i; j <= 1e6; j += i) {
      D[j]++;
    }
  }
}
void init1(long long int n, long long int l, long long int r) {
  if (l == r) {
    tree_1[n] = one[l];
    return;
  }
  long long int mid = (l + r) / 2;
  long long int L = n * 2;
  long long int R = (n * 2) + 1;
  init1(L, l, mid);
  init1(R, mid + 1, r);
  tree_1[n] = tree_1[L] + tree_1[R];
}
void init2(long long int n, long long int l, long long int r) {
  if (l == r) {
    tree_2[n] = two[l];
    return;
  }
  long long int mid = (l + r) / 2;
  long long int L = n * 2;
  long long int R = (n * 2) + 1;
  init2(L, l, mid);
  init2(R, mid + 1, r);
  tree_2[n] = tree_2[L] + tree_2[R];
}
long long int query2(long long int n, long long int l, long long int r,
                     long long int x, long long int y) {
  if (l > y || r < x) return 0;
  if (l >= x && r <= y) return tree_2[n];
  long long int mid = (l + r) / 2;
  long long int L = (n * 2);
  long long int R = (n * 2) + 1;
  long long int p1 = query2(L, l, mid, x, y);
  long long int p2 = query2(R, mid + 1, r, x, y);
  return p1 + p2;
}
long long int query1(long long int n, long long int l, long long int r,
                     long long int x, long long int y) {
  if (l > y || r < x) return 0;
  if (l >= x && r <= y) return tree_1[n];
  long long int mid = (l + r) / 2;
  long long int L = (n * 2);
  long long int R = (n * 2) + 1;
  long long int p1 = query1(L, l, mid, x, y);
  long long int p2 = query1(R, mid + 1, r, x, y);
  return p1 + p2;
}
void update(long long int n, long long int l, long long int r, long long int x,
            long long int y) {
  if (l > y || r < x) return;
  if ((r - l + 1) * 2 == tree_2[n]) {
    return;
  }
  if (l == r) {
    tree_2[n] = D[tree_2[n]];
    return;
  }
  long long int mid = (l + r) / 2;
  long long int L = (2 * n);
  long long int R = (2 * n) + 1;
  update(L, l, mid, x, y);
  update(R, mid + 1, r, x, y);
  tree_2[n] = tree_2[L] + tree_2[R];
}
int main() {
  cin.sync_with_stdio(false);
  cin.tie();
  ;
  long long int T, t;
  long long int i, j, k;
  long long int n, m, q;
  scanf("%lld", &n);
  scanf("%lld", &q);
  for (i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    if (a[i] == 1) {
      one[i] = 1;
      two[i] = 2;
    } else {
      two[i] = a[i];
    }
  }
  calc();
  for (i = 1; i <= 10; i++) init1(1, 1, n);
  init2(1, 1, n);
  for (k = 1; k <= q; k++) {
    long long int typ, u, v;
    scanf("%lld", &typ);
    scanf("%lld", &u);
    scanf("%lld", &v);
    if (typ == 1) {
      update(1, 1, n, u, v);
    } else {
      printf("%lld\n", query2(1, 1, n, u, v) - query1(1, 1, n, u, v));
    }
  }
  return 0;
}