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 = Factorization.getDivisorsCount(1000000);

            SegmentTree tree = new SegmentTree(n) {

                protected long defaultValue() {
                    return 0;
                }


                protected long merge(long a, long b) {
                    return a + b;
                }
            };
            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 abstract class SegmentTree {
        private long[] func;
        private int size;

        protected abstract long defaultValue();

        protected abstract long merge(long a, long b);

        public SegmentTree(int n) {
            size = n;
            func = new long[4 * n + 10];
        }

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

        public void set(int pos, int value) {
            set(0, size - 1, pos, 1, value);
        }

        private void set(int l, int r, int pos, int u, int value) {
            if (l == r) {
                func[u] = value;
            } else {
                int m = (l + r) >> 1;
                if (pos <= m) {
                    set(l, m, pos, u << 1, value);
                } else {
                    set(m + 1, r, pos, (u << 1) + 1, value);
                }
                recalc(u);
            }
        }

        private long get(int l, int r, int lf, int rg, int u) {
            if (r < lf || rg < l)
                return defaultValue();
            if (lf <= l && r <= rg)
                return func[u];
            int m = (l + r) >> 1;
            long f1 = get(l, m, lf, rg, u << 1);
            long f2 = get(m + 1, r, lf, rg, (u << 1) + 1);
            return merge(f1, f2);
        }

        private void recalc(int u) {
            func[u] = merge(func[u << 1], func[(u << 1) + 1]);
        }

    }

    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 Factorization {
        public boolean[] isprime;
        public final ArrayList<Integer> primes;

        public Factorization(int maxValue) {
            isprime = new boolean[maxValue + 1];
            primes = new ArrayList<>();
            Arrays.fill(isprime, true);
            isprime[0] = isprime[1] = false;
            for (int i = 2; i <= maxValue; i++) {
                if (isprime[i]) {
                    primes.add(i);
                    for (int j = i + i; j <= maxValue; j += i)
                        isprime[j] = false;
                }
            }
        }

        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) {
                        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;
        }

    }
}