Tidbits
-
Assuming the Riemann hypothesis, the Möbius function behaves like a random walk. (Math Stack Exchange)
-
Mole frees up disk space on MacOS automatically. (From Ellie Huxtable’s blog)
-
$n! \textstyle=\left\lfloor n^{n^2}\big/\binom{n^n}n\right\rfloor$ (MathOverflow)
-
There exists a complex sequence $(a_n)_n$ such that $\sum_{n \ge 0} a_n^k$ converges if and only if $k$ is prime.
More generally, for any fixed subset $A \subseteq \mathbb{Z}^+$, there exists a complex sequence $(a_n)_n$ such that $\sum_{n \ge 0} a_n^k$ converges if and only if $k \in A$. (Math Stack Exchange)
-
If $a(b+1)(ab+1)$ is a perfect square, then $(b+1)$ divides $a(ab+1)$.
(I conjectured this based on computational evidence, and Mastrem on Math Stack Exchange proved it!)
-
In C++, all literal expressions (e.g.,
42,true,nullptr) are prvalues, with the sole exception of string literals (e.g."hello world"), which are lvalues. (cppreference) -
A quartic polynomial $f$ can be expressed as the composition of two quadratic polynomials $g$ and $h$ (such that $f(x) = g(h(x))$) if and only if two of the roots of $f(x)$ have the same sum as the other two. (Math Stack Exchange)
-
In Go, the following is not an error:
1 2 3type A struct { Field string } type B struct { Field int } type C struct { A; B }even though
CembedsAandB, both of which declare a field calledField. -
If $f : \mathbb{Z}^\infty \to \mathbb{Z}$ is an additive function that vanishes on all sequences of the form $(1, 0, 0, \dots)$, $(0, 1, 0, \dots)$, $(0, 0, 1, \dots)$, and so on, then $f$ is the zero function. (Math Stack Exchange)
If this seems obvious, note that the statement is false for $f : \mathbb{Z}^\infty \to \mathbb{Q}$.
-
It’s well known that heapsort has worst-case runtime $O(n \log n)$. But the best-case runtime for heapsort is also $O(n \log n)$ (assuming distinct keys), and this was only proved several decades after heapsort’s invention. (“On the Best Case of Heapsort”)