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 JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.SortedSet;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.TreeSet;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStream;

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

    static class TaskF {
        public void solve(int testNumber, Input in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            TreeSet<Integer> array = new TreeSet<>();

            int[] a = in.nextIntArray(n);
            for (int i = 0; i < n; i++) {
                if (a[i] > 2) {
                    array.add(i);
                }
            }
            int[] d = Numbers.getDivisorsCount(1000000);

            FenwickTree tree = new FenwickTree(n);
            for (int i = 0; i < n; i++) {
                tree.set(i, a[i]);
            }

            for (int j = 0; j < m; j++) {
                int type = in.nextInt();
                int l = in.nextInt();
                int r = in.nextInt();
                if (type == 1) {
                    SortedSet<Integer> subSet = array.subSet(l - 1, r);
                    ArrayList<Integer> iterate = new ArrayList<>(subSet);
                    for (Integer st : iterate) {
                        int next = d[a[st]];
                        tree.set(st, next);
                        a[st] = next;
                        if (next <= 2) {
                            array.remove(st);
                        }
                    }
                } else {
                    out.println(tree.get(l - 1, r - 1));
                }
            }
        }

    }

    static class Numbers {
        public static int[] getDivisorsCount(int N) {
            N++;
            int[] d = new int[N];
            Arrays.fill(d, 1);
            boolean[] isprime = new boolean[N];
            int[] num = new int[N];
            for (int i = 1; i < N; i++) {
                num[i] = i;
            }
            Arrays.fill(isprime, true);
            for (int i = 2; i < isprime.length; i++) {
                if (isprime[i]) {
                    for (int j = i; j < isprime.length; j += i) {
                        if (j > i) {
                            isprime[j] = false;
                        }
                        int pow = 0;
                        while (num[j] % i == 0) {
                            num[j] /= i;
                            pow++;
                        }
                        d[j] *= (pow + 1);
                    }
                }
            }
            for (int i = 2; i < N; i++) {
                if (num[i] > 1) {
                    d[i] *= 2;
                }
            }
            return d;
        }

    }

    static class Input {
        private StringTokenizer tokenizer = null;
        private BufferedReader reader;

        public Input(InputStream inputStream) {
            reader = new BufferedReader(new InputStreamReader(inputStream));
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException();
            }
        }

        public String nextToken() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(nextLine());
            }
            return tokenizer.nextToken();
        }

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

        public int[] nextIntArray(int n, int add) {
            int[] result = new int[n];
            for (int i = 0; i < n; i++) {
                result[i] = nextInt() + add;
            }
            return result;
        }

        public int[] nextIntArray(int n) {
            return nextIntArray(n, 0);
        }

    }

    static class FenwickTree {
        long[] data;

        public FenwickTree(int n) {
            data = new long[n];
        }

        public void set(int pos, long value) {
            long currentValue = getValue(pos);
            long delta = value - currentValue;
            for (; pos < data.length; pos |= pos + 1) {
                data[pos] += delta;
            }
        }

        public long get(int l, int r) {
            return get(r) - get(l - 1);
        }

        private long getValue(int pos) {
            return get(pos) - get(pos - 1);
        }

        private long get(int pos) {
            long result = 0;
            for (; pos >= 0; pos = (pos & (pos + 1)) - 1) {
                result += data[pos];
            }
            return result;
        }

    }
}