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
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        FSUMAndREPLACE solver = new FSUMAndREPLACE();
        solver.solve(1, in, out);
        out.close();
    }

    static class FSUMAndREPLACE {
        public void solve(int testNumber, Scanner sc, PrintWriter pw) {
            int n = sc.nextInt(), q = sc.nextInt();
            int N = 1;
            while (N < n)
                N <<= 1;
            long[] in = new long[N + 1];
            for (int i = 1; i <= n; i++)
                in[i] = sc.nextInt();
            SegmentTree st = new SegmentTree(in);
            while (q-- > 0) {
                int type = sc.nextInt(), l = sc.nextInt(), r = sc.nextInt();
                if (type == 1)
                    st.update_range(l, r);
                else
                    pw.println(st.query(l, r));
            }
        }

        public class SegmentTree {
            int N;
            long[] array;
            long[] sTree;
            long[] lazy;
            int[] noDiv;
            boolean[] visited;

            SegmentTree(long[] in) {
                array = in;
                N = in.length - 1;
                sTree = new long[N << 1];        //no. of nodes = 2*N - 1, we add one to cross out index zero
                lazy = new long[N << 1];
                build(1, 1, N);
                noDiv = new int[(int) 1e6 + 1];
                visited = new boolean[N << 1];
                for (int i = 1; i < noDiv.length; i++)
                    for (int j = i; j < noDiv.length; j += i)
                        noDiv[j]++;
            }

            void build(int node, int b, int e) {
                if (b == e)
                    sTree[node] = array[b];
                else {
                    int mid = b + e >> 1;
                    build(node << 1, b, mid);
                    build(node << 1 | 1, mid + 1, e);
                    sTree[node] = sTree[node << 1] + sTree[node << 1 | 1];
                }
            }

            void update_range(int i, int j) {
                update_range(1, 1, N, i, j);
            }

            void update_range(int node, int b, int e, int i, int j) {
                if (i > e || j < b)
                    return;
                if (b >= i && e <= j) {
                    update(node, b, e);
                } else {
                    int mid = b + e >> 1;
                    update_range(node << 1, b, mid, i, j);
                    update_range(node << 1 | 1, mid + 1, e, i, j);
                    sTree[node] = sTree[node << 1] + sTree[node << 1 | 1];
                }

            }

            private void update(int node, int b, int e) {
                if (visited[node])
                    return;
                if (b == e) {
                    sTree[node] = noDiv[(int) sTree[node]];
                    if (sTree[node] == 1 || sTree[node] == 2)
                        visited[node] = true;
                    return;
                }
                int mid = (b + e) / 2;
                update(node << 1, b, mid);
                update(node << 1 | 1, mid + 1, e);
                sTree[node] = sTree[node << 1] + sTree[node << 1 | 1];
                visited[node] = visited[node << 1] & visited[node << 1 | 1];
            }

            long query(int i, int j) {
                return query(1, 1, N, i, j);
            }

            long query(int node, int b, int e, int i, int j) {
                if (i > e || j < b)
                    return 0;
                if (b >= i && e <= j)
                    return sTree[node];
                int mid = b + e >> 1;
                long q1 = query(node << 1, b, mid, i, j);
                long q2 = query(node << 1 | 1, mid + 1, e, i, j);
                return q1 + q2;

            }

        }

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

