## ag.algebraic geometry – How do I take the n-th root of a linear operator?

Suppose I have a vector space $$V/overline{mathbb Q}$$ over some algebraically closed field and a semi-simple operator $$T$$ on it with eigenvalues $$alpha_1,dots,alpha_r$$ such that $$|alpha_i| = 1$$ under every complex embedding.

Is there a nice (functorial?) way to define a vector space $$V^{1/n}$$ of dimension $$n$$ with an operator $$T^{1/n}$$ with eigenvalues $$alpha_1^{1/n},dots,alpha_r^{1/n}$$ (where we take all possible roots)?

(Motivation: I came across Abelian varieties over finite fields where the corresponding Frobenius operators have the above relation.)

## Fetching nth document based on integer array in MongoDB

so let’s say I have a random array of n integers (23, 2, 78, 99, … ) where 0 < n < collection.count(), and each element is within this range as well.

In my collection, it is currently indexed by _id, and say it contains the following data:

``````{
"_id" : "1293jnqke",
"name" : "name_string",
"other_data" : ({
"data" : ...
})
}
``````

How should I go about grabbing the data, in chunks of 50, which correspond to each element in the array? So with the example integer array I have, I will slice it down to the first 50 elements, and then I wish to run a find() on the collection, extracting the names of the 23rd, 2nd, 78th, 99th, etc elements, based on the natural ordering of the collection (no need for any sorting beforehand). So the output should look like this:

``````{
( {"name" : "23rd name"},
{"name" : "2nd name"},
{"name" : "78th name"},
{"name" : "99th name"},
{"name" : "53rd name"},
{"name" : "11th name"},
...)
}
``````

One way of course is by looping through the array with findOne() and skip() but I don’t think that is very efficient, is it possible to execute this in a single query? Or are there any better methods?

Appreciate any help, thank you!

## Formula for the n-th term of the sequence

Can you find a formula or rule for the nth term of the sequence related to the prime numbers or prime factorizations so that the initial terms of the sequence have these values?
The sequence is:
1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, . . .

## algorithms – Find nth number which does not contain the digit c

This problem was given to 9-graders. We write down numbers except for the ones which contain the digit c. Find the nth such number. I looked at the indications, but the algorithm used there stumped me. I will describe in here: if $$c ne 0$$, then we transform the number n – 1 (since 0 is part of the series) in the 9th base. Then each digit in the representation of the 9th base which is bigger of equal than c and smaller than 9 will be incremented with 1. The number we obtain is the number we are looking for, BUT IN BASE 10. How? Could anyone explain it to me? Also, please, be patient since I have just started Competitive Programming and I am not really that good.

## set theory – Follow up question: is there a forcing extension where the \$n\$th strongly compact cardinal is the least with \$o(kappa) = n\$, for \$n le omega\$?

If the answer of this is yes, and the answer of the previous question is yes, then maybe we could mold the two proofs together to answer the greater open question?

Here are a couple theorems that Arthur Apter believes to be true and we have a proof outline of:

Theorem (REVERSE PAIR): There is a Universe where $$kappa_1$$, $$kappa_2$$ are the first and second strongly compact cardinals, respectively, and where $$o(kappa_2) = 1$$ and $$o(kappa_1) = 2$$, where the next cardinal of degree 2 is above $$kappa_2$$.

Theorem (REVERSE STRAIGHT FLUSH): For any $$k < omega$$, there is a Universe where $$kappa_i$$, for $$i < k$$, is the $$i$$th least strongly compact cardinal with
$$o(kappa_0) = k+1, o(kappa_1) = k, o(kappa_2) = k-1, dots, o(kappa_k) = 1.$$
$$(o(k_i) = k – i + 1)$$.

These theorems actually seem to go against the positive evidence for the greater open question: is there a universe where the first $$omega$$ many measurable cardinals are the first $$omega$$ many strongly compact cardinals.

Or maybe the proofs of these questions are just very difficult?

## calculus and analysis – Find n-th derivative of the function, display it and then evaluate it at a point of choice

What would be the correct syntax to find the order derivative “$$n$$” in MMA, and to be able to evaluate it in a certain point.

We ask for an example ;

Find the order derivative 2 and evaluate it at point $$x=1.5$$

$$f(x_):=(1-x^2)Cos(x^2) +2xSin(x^3)$$

MMA should show this
$$f'(x)=-2 x Cos(x^2) + 6 x^3 Cos(x^3) – 2 x (1 – x^2) Sin(x^2) + 2 Sin(x^3)$$

$$f´(1,5)=-15.3612$$

Find the order derivative n and evaluate it at point Sx=1.5\$
How is this implemented?

## ordinary differential equations – How many solution families can an n-th order ODE have?

I observe that $$dy/dx = y^2 + x^2$$ can be interpreted as an $$mathbb{R^3}$$ paraboloid, $$z = y^2 + x^2$$. By projecting this paraboloid onto the $$x,y$$ plane we get isoclines which are necessarily non-intersecting. Non-intersecting isoclines create an unambiguous, well-behaved slope field such that the solutions passing through this slope field are non-intersecting as well. Given that solutions are non-intersecting, they belong to a single solution family. Given that the slope field determines the shape of the solution, and granted that it is unambiguous, no other solution family exists.

My conjecture is that an $$n$$-th order ODE has a maximum number of $$n$$ solution families.

## calculus and analysis – Finding the nth digit in a number with k number of digits

Let’s say I have the a number $$p$$ and that is a number that exists of $$k$$ digits, how can I find a specific digit in that number?

For example, I want to find the 10th digit in the number $$54678534679956489$$, so that must give me: $$7$$.

How can I write a program that gives me the nth digit in a number p with k digits?

## How can I find a functional closed expression for this sequence for the nth term?

I’d like to find a closed form for the nth term of this sequence, much like there is the closed form for the Fibonacci numbers. There are two sequences in question, f(n) and g(n). They look like this:

f(n): 1, 3, 7, 17, 41, 90, …

g(n): 1, 2, 5, 12, 29, 70, …

They behave the same way, in that their rule is that for each series s(n), s(n) = 2*s(n-1) + s(n-2). The only difference between the two series is that f(n) begins with 1 and 3, and g(n) begins with 1 and 2.

There is one bit of knowledge I have. Don’t know if it helps. But for each n, g(n) / f(n) approaches 0.70710678118654. Not sure whether this constant has any significance.

Thank you for the help.

## programming challenge – HackerRank – Binary tree to compute the Nth power of natural numbers that sum up to X

What you’re essentially doing with your binary tree is checking all possible combinations of numbers from the list `(i^n | i <- (1..x))`. That’s quite a lot of combinations! (Exercise: how many?)

Not all of those combinations are sensible, however. For example, if x = 100 and n = 2, and you’ve already chosen, say, 4 and 5 (giving 62+72=85), then adding 82=64 is not going to help, nor is adding 92=81. In your current solution, however, you’re still checking those.

So how does one encode this knowledge in the search for solutions? The key thing is that we can build the solution recursively: we can use an already computed answer for a smaller case to help answer a larger case. If we’re given x = 10 and n = 2, then we can only add 12, 22 or 32. If we try adding 32, we have only 1 left to fill, which we can only do by adding 12. If, instead, we start by trying 22, we have to make 6, which is impossible. Starting with 12 lets us choose 3sup>2 to fill up the remaining 9. Since only the set of numbers counts, not their order, this means there is only one solution for x=10,n=2: namely, {12,32} (as stated in the problem).

Checking whether two solutions are the same modulo ordering is annoying, however. Can we do better? Yes we can, by adding another parameter to the problem.

Think about how we could do this before reading on.

A way to change the problem to prevent us from generating multiple solutions that are really the same set of numbers, is to add as a parameter the maximum value we’re allowed to choose. So a problem is now not only specified by (x=10,n=2), but also by an integer M; for example, if M=9, then we may add 12≤9, 22≤9 and 32≤9, so (x=10,n=2,M=9) has one solution: {12,32}. However, (x=10,n=2,M=2) has no solutions, because by only using 12 and 22 you can never make 10.

How is this useful? Well, consider how we could, as a lazy office worker, go about computing how many solutions there are to (x=10,n=2,M=10). (For the original problem, we just set M=x, since choosing numbers higher than x is certainly useless.) This lazy office worker realises that either x=0, in which case we have precisely 1 solution (choosing no numbers at all), or x≠0, in which case we need to choose at least one number. If we choose, say, i2, then the remainder still to fill is 10 – i2. Since our lazy office worker is also clever, they realise that if we force any solutions for 10 – i2 to only choose numbers smaller than i2 (i.e. set M = i2 – 1), then we won’t ever get any duplicates: there may certainly be solutions for our (x,n,M) that choose i2 and also some larger j2, but then we’ll find that one by starting with j2 and then going downward.

So our lazy office worker writes down a series of smaller problems: `((x-in,n,in-1) | i <- (1..M))`, to solve for the next office worker in line. (These are recursive calls.) The total number of solutions is just the sum of the number of solutions for each of these subproblems.

An alternative, more direct way to explain the same way of solving, is to note that while all solutions are sets of distinct integers, we can represent those sets by sorted lists. If the empty solution is not possible (i.e. x≠0), then each of the possible solutions for our current problem has one largest value, so we can find all solutions for the problem going over each largest value in from 1 to M, computing the solutions for (x – i2, n, in – 1), and prepending that largest value i2 to its corresponding sub-solutions. If, instead of building the actual solution lists we just compute the number of them, we arrive at the same solution as above.

Now the above is not very formalised yet, and that is on purpose. Because for me, the next step to formalisation would be writing out the recursive function, which is 95% of the work in implementing the program. And that’s your task. 🙂

If any of the above is unclear (probably), or you get stuck, feel free to ask further questions.

EDIT: When I coded out my first solution for the problem, I also cached recursive calls in a table, making it a dynamic programming solution. However, for the given input range that apparently doesn’t help, so a standard recursive program works fine.