### MikeMirzayanov's blog

By MikeMirzayanov, 10 months ago, translation, , Hello!

We supported the rendering of LaTeX-formulas with MathJax in new posts and comments. Now the formulas will be as beautiful as in problem statements. Drawback: they are displayed not immediately, but redrawn after the page is displayed. Old posts and comments are displayed in the old way (already a lot of old content, backward compatibility is very important). Note that if you edit old post, it will still be displayed in the old style.

Here are some example: $1 \le n \le 10^{12}$,  $c = \sqrt{a^2+b^2}$,  $i\hbar\frac{\partial}{\partial t}\left|\Psi(t)\right>=H\left|\Psi(t)\right>$.  Comments (110)
 » Can you write something here to see how it looks like?
•  » » How to use it in comment? It dosen't work. if i type. \frac{1}{2}
•  » » 10 months ago, # ^ | ← Rev. 2 →   $\sum_{i=1}^{n}i=\frac{n \cdot (n+1)}{2}$
•  » » » 10 months ago, # ^ | ← Rev. 2 →   I understand. It need like this. yor need use double dollar sign to include your code $\frac{a}{b}$
•  » » » Thanks a lot.
•  » » $\forall \varepsilon\!>\!0 \ \exists k(\varepsilon)\!\in\!N: \forall n>k \Rightarrow |x_{n}-a|<\varepsilon$You have to use $or $$like in LateX •  » » a^2 $a^2$$$a^2$\$ $a^2$
 » $G_{ij}=\sum_k F_{ik}F_{jk}$
•  » » Sound matrix multiplications am I right? :D
•  » » » Maybe Sound signal can use the function too? I use the Gamma Matrix to calculate the loss function with higher CNN-layer similarity in Picture Style Transfer.
•  » » » » Whoa, slow down senpai, I need a few more time to be familiar with ML models. :D
 » Ah niceThe old style: The new one: $\lfloor \sqrt{x} \rfloor - \lfloor \sqrt{y} \rfloor \le \frac{x-y}{\sqrt{x}+\sqrt{y}} + 1 \le \frac{1}{\sqrt{x-y}+1}(x-y) + 1$Looks so much better!
•  » » much more pretty right :D
 » 10 months ago, # | ← Rev. 2 →   Good job
 » $LOL$
 » 10 months ago, # | ← Rev. 2 →   $\text{C}_{\text{ode}}\text{F}_{\text{orces}}\text{ Round}_{547} \text{ Please}$
•  » » 10 months ago, # ^ | ← Rev. 3 →   It seems there is an error on displaying when I change the revision of comment to see. Check the revision 1 and move back to revision 2 of my comment then you will see the bug. MikeMirzayanov It's fixed
 » $\mathbb{CODEFORCES}$
•  » » $\mathfrak{CodeForces}$
•  » » » nice
 » $Cool$
 » $\displaystyle \sum_{i=1}^{\infty} i = -\frac{1}{12}$
 » What was the LaTeX renderer before? I always thought it was some kind of Russian bootleg MathJax.
 » $\begin{matrix} 1 & x & x^2 \\ 1 & y & y^2 \\ 1 & z & z^2 \end{matrix}$
 » 10 months ago, # | ← Rev. 2 →   $\int_G f(g) \, \text{d}g = \frac{1}{|W|} \int_G \int_T \mathopen| \Delta(t) \mathclose|^2 f(gtg^{-1}) \, \text{d}t \, \text{d}g$Looks very pretty :) $1+2=3<4$
 » $\huge \mathcal{O}( N )$
»

### Testing

$\mathrm{f}[u]=b_u+\min\limits_{\substack{v\in anc_u\\\mathrm{dis}[u]-\mathrm{dis}[v]\le l_u}}(\mathrm{f}[v]-\mathrm{dis}[v]\times p_u)$

If $f(x)=\frac{1}{1-x^k}$, then $g(x)=(\ln f)(x)=\sum_{i=1}^{\infty}\frac{1}{i}x^{ik}$. Proof:

\begin{aligned}g(x)&=\ln f(x)\\&=\int(\frac{\mathrm{d}}{\mathrm{d}x}\ln f)(x)\mathrm{d}x\\&=\int(\frac{f'(x)}{f(x)})\mathrm{d}x\\&=\int((1-x^k)f'(x))\mathrm{d}x\\&=\int((1-x^k)\sum_{i=1}^{\infty}k\cdot i\cdot x^{ki-1})\mathrm{d}x\\&=\int(\sum_{i=1}^{\infty}k\cdot i\cdot x^{ki-1}-\sum_{i=1}^{\infty}k\cdot i\cdot x^{ki-1}\cdot x^k)\mathrm{d}x\\&=\int(\sum_{i=1}^{\infty}k\cdot i\cdot x^{ki-1}-\sum_{i=1}^{\infty}k\cdot (i-1)\cdot x^{ki-1})\mathrm{d}x\\&=\int(\sum_{i=1}^{\infty}k\cdot x^{ki-1})\mathrm{d}x\\&=\sum_{i=1}^{\infty}\frac{1}{i}x^{ki}\end{aligned}
•  » » 10 months ago, # ^ | ← Rev. 2 →   I think, that you forgot to try \left( instead ( and \right) instead ). This allows to auto detect correct height of parentheses under summation, like this: $\prod_{k=1}^{n-1} \left(\exp{\left(\dfrac{2 \cdot \pi \cdot i \cdot k}{n}\right)}-1\right) = \left(-1\right)^{n+1} \cdot n$
•  » » » Yeah, you're right. But sometimes it's too complicated.
 » Can explain me why backward compatibility is very important?
 » 10 months ago, # | ← Rev. 4 →   Deleted and screw uplaoding a photo
 » $\text{summitwei} \in \text{geniosity}$Proof left as an exercise to the reader.
•  » » $\text{fishy} \not\in \text{geniosity}$I have already proved this B).
•  » » hello, my platinum blue men
•  » » » nchn orz
 » $a^2$
•  » » waw:) its really awsome
 » Nice, Now I can draw beautiful owls in my posts. Thanks Mike! $\underline{\widehat{\dbinom{\odot_\vee\odot}{{\raise-8pt"}\wr{\raise-8pt"}}}}$
•  » » 10 months ago, # ^ | ← Rev. 2 →   LOL $\widetilde{ \dbinom{\odot_\vee\odot} {\underline{\ \smile\ }}}$ $\widetilde{ \dbinom{\odot_\vee\odot} {\underline{\ -\ }}}$ $\widetilde{ \dbinom{\odot_\vee\odot} {\underline{\ \frown\ }}}$
 » 10 months ago, # | ← Rev. 4 →   $x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$
 » 10 months ago, # | ← Rev. 3 →   $\require{AMScd}$ \begin{CD} T @>h>> A\\ @. @VV n V\\ M @<>e> !\\ \end{CD} $\frac{\color{purple}{4}}{\color{blue}{\Pi}} = \color{green}{1} + \cfrac{\color{red}{1}}{\color{orange}{2} + \cfrac{\color{red}{9}}{\color{orange}{2} + \cfrac{\color{red}{25}}{\color{orange}{2} + \cfrac{\color{red}{49}}{\color{orange}{2} + \dots}}}}$
•  » » red coder maths r very strong
 » 10 months ago, # | ← Rev. 6 →   $\displaystyle \sum_{i=1}^n \sum_{j=1}^m d_1(\gcd(i, j)) \\ \displaystyle\sum_{d=1}^n \sum_{i=1}^n \sum_{j=1}^m d_1(d)[\gcd(i,j)=d])\\ \displaystyle\sum_{d=1}^n d_1(d) \sum_{i=1}^n \sum_{j=1}^m [\gcd(i,j)=d])\\ \displaystyle\sum_{d=1}^n d_1(d) \sum_{k=1}^{\lfloor \frac nd \rfloor} \mu(k) \lfloor \frac n{kd} \rfloor \displaystyle\lfloor \frac m{kd} \rfloor \\$Let $T=kd$, $\displaystyle\sum_{T=1}^n \lfloor \frac nT \rfloor \lfloor \frac mT \rfloor \sum_{d|T}d_1(d) \mu(\frac Td)$ $\displaystyle dp(i)=\min\limits_{i < j \leq n, dp(j)\leq \operatorname{sum}(j - 1) - \operatorname{sum}(i - 1)}(\operatorname{sum}(j - 1) - \operatorname{sum}(i - 1))$Why the \sum became \prod?....
•  » » Maybe you can use.. $\Sigma_{i=1}^n \Sigma_{j=1}^m d_1(\gcd(i, j))$\Sigma_{i=1}^n \Sigma_{j=1}^m d_1(\gcd(i, j))
•  » » » 10 months ago, # ^ | ← Rev. 2 →   It seems that it was fixed now, also thank you...
•  » » » » I'm just crack a joke,if you use the \Sigma,it will be too small...
 » $a^{n}\equiv a^{\varphi(m)+(n \bmod \varphi(m))}\pmod{m}$
•  » » It is not always true when $n<\varphi(m)$. For example, $6^{2}\not\equiv 6^{4+2}\pmod8$.
•  » » » It's true for $n>\log_2 m$
•  » » » » More accurately, it's true for $n\ge\max_{i=1}^k\alpha_i$, where $m=p_1^{\alpha_1}p_2^{\alpha_2}\cdots p_k^{\alpha_k}$.
•  » » what's the theory behind the fomula plz
•  » » » Let $m=p_1^{d_1} \dots p_n^{d_n}$. Consider the periodicity of $a^n$ on each $p_k^{d_k}$ separately. By Chinese Remainder Theorem, pre-period of $a^n$ modulo $m$ will be equal to the maximum of pre-periods modulo $p_k^{d_k}$ and period itself will be least common multiple of periods modulo $p_k^{d_k}$.On each $p_k^{d_k}$ pre-period will be either $0$ if $\gcd(a,p)=1$ or at most $d_k \leq \log_2 m$ otherwise. And period will always be the divisor of $\varphi(p_k^{d_k})$ which is in turn the divisor of $\varphi(m)$. Thus their least common multiple will be the divisor of $\varphi(m)$. This gives you the result above, given that $\varphi(m) \geq \log_2 m$.
•  » » » » thank you vvery much. seems that I have a lot of things to catch up with
 » I don't care. I want another codeforces round asap.
•  » » You can have hundreds of virtual contests.
 » 10 months ago, # | ← Rev. 2 →   WoW, it's cool! Thank you~It was finally realized. A question about using LaTeX in blogs $\begin{bmatrix} F_i \\ F_{i-1} \\ (i+1)^3 \\ (i+1)^2 \\ i+1 \\ 1 \end{bmatrix} \Longleftarrow \begin{bmatrix} 1 & 1 & 1 & 1 & 1 & 1 \\ 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 3 & 3 & 1 \\ 0 & 0 & 0 & 1 & 2 & 1 \\ 0 & 0 & 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 0 & 0 & 1 \\ \end{bmatrix} \times \begin{bmatrix} F_{i-1} \\ F_{i-2} \\ i^3 \\ i^2 \\ i \\ 1 \end{bmatrix}$
 » The most convenient thing is that you can copy the formula by $\text{Right Click}\rightarrow\text{Show Math As}\rightarrow\text{TeX Commands}$.
 » WAIT! Why all \sums became \prods? $\underset{\text{actually \sum}}{\underline{\sum}}\neq\underset{\text{real \prod}}{\underline{\prod}}$
•  » » Fixed!
 » 10 months ago, # | ← Rev. 2 →   Looks like I found the following feature: If you use \newcommand or \renewcommand, it will affect all comments below yours. Apologies to all the people between my two comments that got confused by this.Stackexchange had the same issue, but there some people could at least edit the answers/comments and remove the malicious code. Their fix (mentioned in an answer to the linked post) was to wrap posts in \begingroup and \endgroup. Another fix mentioned there was to use \resetstack. MikeMirzayanov could you look into that?Edit: It looks like \newcommand and \renewcommand now get stripped from mathjax parts of comments. This should deal with people replacing $\pi$ with 40 owls for now. Nevertheless, I would love to see support for a \newcommand whose scope is just the comment it was written in. (But I see that implementing and testing that might take some time.)
 » 10 months ago, # | ← Rev. 3 →   \begin{align*}\sum_{i=1}^n\sum_{j=1}^nij\gcd\left(i,j\right)&=\sum_{d=1}^nd\sum_{i=1}^n\sum_{j=1}^nij[\gcd\left(i,j\right)==d]\\&=\sum_{d=1}^nd^3\sum_{i=1}^{\lfloor\dfrac nd\rfloor}\sum_{j=1}^{\lfloor\dfrac nd\rfloor}ij[\gcd\left(i,j\right)==1]\\&=\sum_{d=1}^nd^3\sum_{i=1}^{\lfloor\dfrac nd \rfloor}\sum_{j=1}^{\lfloor\dfrac nd\rfloor}ij\sum_{t|\gcd\left(i,j\right)}\mu\left(t\right)\\&=\sum_{d=1}^nd^3\sum_{t=1}^{\lfloor\dfrac nd \rfloor}\mu\left(t\right)t^2\sum_{i=1}^{\lfloor\dfrac n{td}\rfloor}\sum_{j=1}^{\lfloor\dfrac n{td}\rfloor}ij\\&=\sum_{d=1}^nd^3\sum_{t=1}^{\lfloor\dfrac nd \rfloor}\mu\left(t\right)t^2\left(1+2+3+\cdots+\lfloor\dfrac n{td}\rfloor\right)^2\\&=\sum_{d=1}^nd^3\sum_{d|T}^n\mu\left(\dfrac Td\right)\left(\dfrac Td\right)^2sum^2\left(\lfloor\dfrac nT\rfloor\right)\\&=\sum_{T=1}^nsum^2\lfloor\dfrac nT\rfloor T^2\sum_{d|T}d\mu\left(\dfrac Td\right)\\&=\sum_{T=1}^nsum^2\lfloor\dfrac nT\rfloor T^2\phi\left(T\right)\end{align*}It is a great joy to solve mathematical problems using $LaTeX$ !
•  » » this is disgusting, genuinely
 » $gcd(Fib_{a},Fib_{b})=Fib_{gcd(a,b)}$
•  » » 10 months ago, # ^ | ← Rev. 2 →   More generally, $F_n \equiv 0 \mod F_m$ if $n \equiv 0 \mod m$.
•  » » Is this fomula true? What's this theroem called?
 » 10 months ago, # | ← Rev. 2 →   \begin{equation*} e^{\pi i} + 1 = 0 \end{equation*}
 » Well, Let's see some tables $\begin{array}{c|lcr} n & \text{Left} & \text{Center} & \text{Right} \\ \hline 1 & 0.24 & 1 & 125 \\ 2 & -1 & 189 & -8 \\ 3 & -20 & 2000 & 1+10i \end{array}$
 » it doesnt work
 » 10 months ago, # | ← Rev. 3 →   $\rm Test$$a ^ 2 + b ^ 2 = c ^ 2$
 » 10 months ago, # | ← Rev. 6 →   Testing $\sin \pi = 0$
•  » » 10 months ago, # ^ | ← Rev. 4 →   Testing a second time $\sin \pi = 0$Yep, dacin21's feature is still not fixed.
 » $2019 \ good \ luck \ and \ high \ rating$ $2019 \ become \ master:D$
•  » » Wow, I find a person use the same picture as me! orz.
 » $-\dfrac{\hslash^2}{2m} \, \dfrac{\mathrm{d}^2 \psi}{\mathrm{d} x^2}$
•  » » Oh boi we should forbid posting Hamiltonians on codeforces...
•  » » » $\begin{pmatrix}1&0\\0&-1\\\end{pmatrix}$
•  » » » strange suggestion, coming from a string theorist...
 » and what does this have to do on a programming website? this website is for competitive programming, not math.
•  » » Relax competitive programming is just maths + coding
•  » » » do you realise what you're saying? just because some random website called codeforces decides to mess around with us by giving us terrible, useless problems full of math doesn't mean the whole thing called COMPETITIVE PROGRAMMING is like this. read before you comment because people who don't know better will take what you say as being true.
 » Looks pretty good! Gl for Codeforces in further developments.
 » \begin{CD} Me\\ @VV V\\ @>>> \\ solving\ problems @VVV @.\\ @<<< \\ @VVV\\ playing\ with\ LaTeX \end{CD}
•  » » $\LaTeX$
 » $LATEX$
 » It's fantastic! $f(x)=g(y)+1$
 » Great!It will make codeforces better. :D$\frac{-b\pm\sqrt{b^2-4ac}}{2a}$
 » $F(\omega_n^m)=F_0(\omega_{\frac{n}{2}}^m)+\omega_n^mF_1(\omega_{\frac{n}{2}}^m)$ $F(\omega_n^{m+\frac{n}{2}})=F_0(\omega_{\frac{n}{2}}^m)+\omega_n^{m+\frac{n}{2}}F_1(\omega_{\frac{n}{2}}^m)=F_0(\omega_{\frac{n}{2}}^m)-\omega_n^{m}F_1(\omega_{\frac{n}{2}}^m)$
 » $c_i = \sum_{\gcd(j,k)=i} a_j \cdot b_k$
 » $2\sum_{n=1}^n n^3$
 » 10 months ago, # | ← Rev. 2 →   $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$ $\LaTeX$
 » \begin{aligned}\left[ mx\right] =\sum ^{m}_{j=1}\left[ x+\dfrac {j-1}{m}\right] \left( m\in \mathbb{N} ^{+}\right) \end{aligned}​
 » That's what you love :D AhmadLoiy
•  » » Lmfao I wish there won't be any bug with it xD
 » 10 months ago, # | ← Rev. 4 →   $a_n=\sum_{k=0}^{n}\binom{n}{k}b_k\iff b_n=\sum_{k=0}^{n}(-1)^{n-k}\binom{n}{k}a_k$ $\int_a^bf(x)\text{d}x\approx\frac{b-a}{6}(f(a)+4f(\frac{a+b}{2})+f(b))$
 » Is it rated ?
»

Does it support Markdown and MathJax in the same post/comment ?

Here I'm trying to test both of this:

## Markdown & Latex Example

Codeforces is awesome!! Now let's try to write a matrix: Inline $\begin{bmatrix}a & b\ c & d\ e & f \end{bmatrix}$ and

Now in new line matrix:

$\begin{bmatrix}a & b\\ c & d\\ e & f \end{bmatrix}$

Seems it doesn't work in inline` form.

•  » » Use $\begin{bmatrix}a&b\\c&d\\e&f\end{bmatrix}$, I succeeded.
•  » » » Great!! You did it. Got it. Example: $\begin{bmatrix}a&b\\c&d\\e&f\end{bmatrix}$ inline matrix. Just need 3 backslashes (\) instead of 2 backslashes (\) . Thanks :)
 » $fb(n)=fb(n-1)+fb(n-2)$
 » Great! $\boldsymbol{f}(n) = \sum_{d \mid n} \boldsymbol{\mu} \left( \frac{n}{d} \right) \boldsymbol{g}(d)$
 » (2 + 3) / 55
 » $\bbox[5px,border:2px solid #B050FF] { \begin{array}{c|ccc} a \oplus b & 1 & 2 & 3 & 4 & 5 \\ \hline 1 & 0 & 3 & 2 & 5 & 4 \\ 2 & 3 & 0 & 1 & 6 & 7 \\ 3 & 2 & 1 & 0 & 7 & 6 \\ 4 & 5 & 6 & 7 & 0 & 1 \\ 5 & 4 & 7 & 6 & 1 & 0 \\ \end{array} }$
 » $\frac 1x = \frac 1a + \frac1b \\ \Downarrow \\ 1 = \frac xa + \frac xb \\ \Downarrow \\ 1 = \frac{xa+xb}{ab} \\ \Downarrow \\ xa+xb = ab \\ \Downarrow \\ xa = b\left(a - x\right) \Rightarrow xa - x^2 + x^2 = x\left(a - x\right) + x^2 \\ \Downarrow \\ x^2 = b(a-x) - x(a-x) = (a-x)(b-x)$
 » 10 months ago, # | ← Rev. 2 →   \begin{aligned} F(n) &= \sum_{d \mid n} f(d) \\ f(n) &= \sum_{d \mid n} F(d) \mu\!\left(\frac nd\right) \end{aligned}
 » new LaTex looks much better

Unable to parse markup [type=CF_MATHJAX]

•  » » F(n)f(n)=∑d∣nf(d)=∑d∣nF(d)μ(nd)
•  » » umm…… seem to be unable to use LaTex on my computer……
 » $\begin{pmatrix} 1&2&3\\ 4&5&6\\ \end{pmatrix}$
 » It's so cool, I want to comment too : $\frac{d}{dx} \int_{a}^{x} f(t) \hspace{0.2cm} dt = f(x)$
 » 6 months ago, # | ← Rev. 2 →   Am I the only one who feels that it doesn't work now?Inline: $\frac{x}{y}\in\mathbb{R}$Block: $\frac{x}{y}\in\mathbb{R}$Displaystyle: $\displaystyle \frac{x}{y}\in\mathbb{R}$UPD: never mind, I've changed my browser recently, and now I seem to have to change my mathjax math renderer. Sorry for necroposting