graphs – Detecting odd cycle using mod operator and breadth first search algorithm

If we want to detect and odd cycle if an undirected graph $G=<V,E>$. Suppose we run BFS algorithm from CLRS book as follows,

enter image description here

Q: Now my question is suppose we have the following graphs:

enter image description here

The figure to the left above:

  • $d[v] bmod{2} == d[u] bmod{2}$ equal and gives odd cycle.
  • $d[v] bmod{2} == d[a] bmod{2}$ not equal remainder, so won’t give odd cycle.

The figure to the right above:

  • $d[x] bmod{2} == d[u] bmod{2}$ not equal remainder, so won’t give odd cycle.
  • $d[x] bmod{2} == d[v] bmod{2}$ not equal remainder, so won’t give odd cycle.

Problem: so the only case to discover odd cycle is when we have the left right graph and when exactly we compare vertex $v$ distance with $u$ distance. What do you think please? If the mod operator works, can you give your interpretation as why this should work in general please if possible?

list – Odd Issue SP 2019 ‘go to comments’ emailed link from mentions

We are having an odd issue with mentions/comments for a list we have in Sharepoint.

When a user does a mention and creates a comment it sends the email you would expect to the user with the ‘go to comment’ link, but recently it takes you to a classic view of the comment, which is not allowing any sort of editing or interaction.

It is doing this for all users though including owners of the list. This is happening now instead of opening up the modern view of the item they commented on. We have tried to adjust settings for users but that is not having an effect.

We also tested making a new list based on the established settings of this list and do not have this problem. Ideally we would like to keep the original list if possible without transferring data over. We are thinking it may be a user/group configuration issue. Has any one encountered this issue before? If so, were you able to resolve and how so? Thank you!

Prove: Lie algebras generated by two $ntimes n$ shift matrices are $mathfrak{so}(n)$ ($n$ odd) or $mathfrak{sp}(n/2)$ ($n$ even)

I wish to have a proof for the following result:

Let $U_n$ be an $ntimes n$ upper shift matrix, and $L_n = U_n^T$ be a lower shift matrix. For example,
$$
U_5 = begin{pmatrix}
0 & 1 & 0 & 0 & 0 \
0 & 0 & 1 & 0 & 0 \
0 & 0 & 0 & 1 & 0 \
0 & 0 & 0 & 0 & 1 \
0 & 0 & 0 & 0 & 0
end{pmatrix},
quad
L_5 = begin{pmatrix}
0 & 0 & 0 & 0 & 0 \
1 & 0 & 0 & 0 & 0 \
0 & 1 & 0 & 0 & 0 \
0 & 0 & 1 & 0 & 0 \
0 & 0 & 0 & 1 & 0
end{pmatrix}.
$$

Then the Lie algebra generated by $U_n$ and $L_n$ over $mathbb{C}$ is $mathfrak{so}(n, mathbb{C})$ when $n$ is odd, and is $mathfrak{sp}(n, mathbb{C})$ when $n$ is even.

I tested this numerically with GAP over the field $mathbb{Q}$: the Lie algebra generated by $U_{2n+1}$ and $L_{2n+1}$ over $mathbb{Q}$ is of type $B_n$, while the Lie algebra generated by $U_{2n}$ and $L_{2n}$ over $mathbb{Q}$ is of type $C_n$.

differential equations – Very odd results from DSolve for nonlinear ODE

I am solving

$$dfrac{dy}{dx}=dfrac{y^6-2x^2}{xy^2left(2y^3+xright)}$$

In Mathematica 12.2.0.0 on Windows 10, x86, 64-bit

  DSolve({y'(x) == (-2*x^2 + y(x)^6)/(x*y(x)^2*(x + 2*y(x)^3))}, y(x), x)

It returns a bunch of root functions like

$$left.y(x)to sqrt(3){text{Root}left(7290 text{$#$1}^2 e^{5 c_1} x^8-10125 text{$#$1}^3 e^{5 c_1} x^7+945 text{$#$1}^4 e^{5 c_1} x^6+2079 text{$#$1}^5 e^{5 c_1} x^5-735 text{$#$1}^6 e^{5 c_1} x^4-55 text{$#$1}^7 e^{5 c_1} x^3+75 text{$#$1}^8 e^{5 c_1} x^2-15 text{$#$1}^9 e^{5 c_1} x+text{$#$1}^{10} e^{5 c_1}+14580 text{$#$1} e^{5 c_1} x^9+x^{15}-17496 e^{5 c_1} x^{10}&,1right)}right}$$

I was not expecting this, but using step-by-step, we get something like what I was expecting

enter image description here

First, what are you supposed to do with all those root function outputs?

Is there some way to get the step-by-step output?

nt.number theory – The congruence $mathrm{per}[|j-k|]_{1le j,kle p}equiv-1/2pmod p$ with $p$ an odd prime

For a matrix $(a_{j,k})_{1le j,kle n}$, its permanent is given by
$$mathrm{per}(a_{j,k})_{1le j,kle n}=sum_{tauin S_n}prod_{j=1}^na_{j,tau(j)}.$$

Let $p$ be an odd prime. I have proved the congruences
begin{align}mathrm{per}(j+k)_{1le j,kle p-1}equiv&-2-4(p-1)!pmod{p^2},tag{1}
\mathrm{per}(j+k)_{1le j,kle p}equiv& ppmod{p^2},tag{2}
\mathrm{per}(j+k)_{0le j,kle p-1}equiv&-ppmod{p^2}.tag{3}
end{align}

Motivated by this, I make the following conjecture.

Conjecture. For any odd prime $p$, we have
$$mathrm{per}(|j-k|)_{1le j,kle p}equiv-frac12pmod p.tag{4}$$

Remark. I have verified $(4)$ for $p=3,5,7,11,13,17,19,23$. My method to prove $(1)$$(3)$ does not work for the congruence $(4)$.

QUESTION. How to prove the congruence $(4)$ for each odd prime $p$ ?

I only ask how to prove $(4)$. Please ignore $(1)$$(3)$ since I have already proved them completely.

java – Print largest odd integer & minimum from user input

Assignment I have asks for user input of integers until ‘0’ is entered. Then these user inputs are used for 4 questions, I’ve correctly answered 2 and the other 2 I’m not getting it correct.
Q1 asks to print the minimum integer the user inputted. My code works for 3/4 test cases, the test case that doesn’t work is when only ‘0’ is entered.
Q2 asks to find the largest odd integer, my code only works for 1 of the test cases and I’m kind of lost by this one.

Test case input 1: 0
Test case input 2: -1 7 5 -9 0
Test case input 3: 6 8 10 20 0 -1 13

Scanner scan = new Scanner(System.in);
        
        // initializing 
        int negNum = 0;
        int sum = 0;
        int minNum = Integer.MAX_VALUE;
        int maxNum = Integer.MIN_VALUE;
        int num = 10000;
        
        // while loop asking for user input not equal to 0
        while (num != 0) {
            num = scan.nextInt();
            
            // finding minimum integer
            if (num == 0)
                break;
            if (minNum > num) {
                minNum = num;
              }
            
            // finding largest odd integer
            if (num %2 != 0) {
            if (num > maxNum) {
                maxNum = num;
            }
            else maxNum = 0;
          }
            
            // counting negative integers
            if (num < 0) {
                negNum++;
            }
            
            // finding sum of even integers
            if (num % 2 == 0) {
                sum = sum + num;
            }
        } 
// printing out calculations
        System.out.println("The minimum integer is " + minNum );
        System.out.println("The largest odd integer in the sequence is " + maxNum );
        System.out.println("The count of negative integers in the sequence is " + negNum);
        System.out.println("The sum of even integers is " + sum );

Odd pages duplex printing incorrect on Debian with Cinnamon

When duplex printing odd number of pages, I get first paper sheet with blank/empty back and then double-side printed rest of the pages. The correct/expected would be that the last page is blank on its second/back side, while 1-2,2-3,etc are printed on one sheet of paper.

I’ve noticed that in my system print dialog “[x] Collate” is checked. I can not uncheck this to try because it’s disabled/graied-out:

screen-shot of print dialog

Checked cups settings, greped $HOME and /etc for “collate”, but could not find anything.

I’m using Debian Buster, Cinnamon and Brother MFC-J4420DW printer with cups&lpr drivers from the manufacturer support website.

Any idea?

hit points – In OD&D, how do you calculate XP, HP and Max HP when switching class?

In Original D&D, specifically the rules described in Men & Magic, it says:

Elves can begin as either Fighting-Men or Magic-Users and freely switch class whenever they choose, from adventure to adventure, but not during the course of a single game.

Non-elf characters may also change class if they meet the minimum prime requisites.

Note that this isn’t like multi-classing in more modern editions of the game; you only play as one class at a time.

  1. Do you earn XP separately for each class? i.e if you earned 2500 XP as a Fighting-Man, does this mean you can play as a second level Magic-User when you make the change, or do you start the new class with 0 XP?

First level Magic-Users have 1 hit dice (i.e. 1d6), whereas first level Fighting-Men have 1+1 hit dice (i.e. 1d6+1).

  1. At first level, would player elves roll independently for each class, or just roll once and add 1 hp when playing as a Fighting-Man?
  2. When levelling up, would characters have separate maximum hit points for each class?
  3. (If the answer to 3 is yes) When switching class between adventures what would happen to
    your actual hp/ damage taken?

I note that in The Underground & Wilderness Adventures, it says that characters would only heal wounds at the rate of 1 hp per two days, so theoretically you could start a new adventure without being fully healed. So to elaborate on q4, if you switched class, would you transfer the hp; the damage; or just use a separate hp tracker for each class? (If hp, is this limited to the hp maximum of the class you are changing to? If damage, could this process kill you?!)

  1. (If the answer to 3 is no) How is your combined max hp for all the classes calculated?

elementary number theory – Prove that $2^n + 5^n + 56$ is divisible by 9, where n is an odd integer

Prove that $9 mid2^n + 5^n + 56$ where n is odd

I have proved this by using division into cases based on the value of $nbmod3$ but it seems a little bit clumsy to me and I wonder if there are other ways to prove it, probably by using modular arithmetic or induction? Below is my proof:
$text{Case 1, }nbmod3=0,text{then $n=3k$ for some odd integer k:}$ $$begin{align}
2^n+5^n+56 & =2^{3k}+5^{3k}+56
\ & = 8^k+125^k+56
\ & equiv (-1)^k+(-1)^k+2quad&left(bmod9right)
\ & equiv 0quad&left(bmod9right)
end{align}$$

$text{Case 2, }nbmod3=1,text{then $n=3k+1$ for some even integer k:}$ $$begin{align}
2^n+5^n+56 & =2^{3k+1}+5^{3k+1}+56
\ & = 2cdot8^k+5cdot125^k+56
\ & equiv 2cdot(-1)^k+5cdot(-1)^k+2quad&left(bmod9right)
\ & equiv 9equiv0quad&left(bmod9right)
end{align}$$

$text{Case 3, }nbmod3=2,text{then $n=3k+2$ for some odd integer k:}$ $$begin{align}
2^n+5^n+56 & =2^{3k+2}+5^{3k+2}+56
\ & = 4cdot8^k+25cdot125^k+56
\ & equiv 4cdot(-1)^k+25cdot(-1)^k+2quad&left(bmod9right)
\ & equiv -27equiv0quad&left(bmod9right)
end{align}$$