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 long long N = 6e5 + 9, M = 3000, V = 1e6;
long long L[M], R[M], tag[N], a[N], n, k, flag, l, r, sum[M], m;
bool lazy[M];
long long d[V + 9], pr[N], cnt, res, now, qwq;
bool vis[V + 9];
inline long long read() {
  long long sum = 0, nega = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') nega = -1;
    ch = getchar();
  }
  while (ch <= '9' && ch >= '0') sum = sum * 10 + ch - '0', ch = getchar();
  return sum * nega;
}
inline void write(long long X) {
  if (X < 0) {
    putchar('-');
    X = -X;
  }
  if (X > 9) write(X / 10);
  putchar(X % 10 + '0');
}
inline void update() {
  long long k;
  if (tag[l] == tag[r]) {
    if (lazy[tag[l]]) return;
    for (long long i = l; i <= r; i++) {
      k = d[a[i]];
      sum[tag[l]] -= (a[i] - k);
      a[i] = k;
    }
    return;
  }
  if (!lazy[tag[l]]) {
    for (long long i = l; i <= R[tag[l]]; i++) {
      k = d[a[i]];
      sum[tag[l]] -= (a[i] - k);
      a[i] = k;
    }
  }
  if (!lazy[tag[r]]) {
    for (long long i = L[tag[r]]; i <= r; i++) {
      k = d[a[i]];
      sum[tag[r]] -= (a[i] - k);
      a[i] = k;
    }
  }
  for (long long i = tag[l] + 1; i < tag[r]; i++) {
    if (lazy[i]) continue;
    long long tmp = 0;
    sum[i] = 0;
    for (long long j = L[i]; j <= R[i]; j++) {
      k = d[a[j]];
      if (k > 2) tmp++;
      a[j] = k, sum[i] += a[j];
    }
    if (tmp == 0) lazy[i] = 1;
  }
  return;
}
inline long long query() {
  long long ans = 0;
  if (tag[l] == tag[r]) {
    for (long long i = l; i <= r; i++) ans += a[i];
    return ans;
  }
  for (long long i = l; i <= R[tag[l]]; i++) ans += a[i];
  for (long long i = L[tag[r]]; i <= r; i++) ans += a[i];
  for (long long i = tag[l] + 1; i < tag[r]; i++) ans += sum[i];
  return ans;
}
inline void init() {
  d[1] = 1;
  for (long long i = 2; i <= V; i++) {
    if (!vis[i]) {
      d[i] = 2;
      pr[++cnt] = i;
      for (long long j = i; j <= V / i; j++) vis[i * j] = 1;
    } else {
      res = 1;
      qwq = i;
      for (long long j = 1; j <= cnt && pr[j] * pr[j] <= qwq; j++) {
        now = 0;
        while (qwq % pr[j] == 0) qwq = qwq / pr[j], now++;
        res = res * (now + 1);
      }
      if (qwq != 1) res = res * 2;
      d[i] = res;
    }
  }
  return;
}
signed main() {
  n = read(), k = sqrt(n), m = read();
  for (long long i = 1; i <= n; i++) a[i] = read();
  for (long long i = 1; i <= n; i++)
    tag[i] = (i - 1) / k + 1, sum[tag[i]] += a[i];
  for (long long i = 1; i <= tag[n]; i++)
    L[i] = R[i - 1] + 1, R[i] = L[i] + k - 1;
  init();
  for (long long i = 1; i <= m; i++) {
    flag = read(), l = read(), r = read();
    if (flag == 1) {
      update();
    } else {
      write(query());
      puts("");
    }
  }
  return 0;
}
