User:Roman Czyborra

Lerch Transcendent
$\sum_{n=N}^\infty R^n =\frac{1-R}{1-R}\sum_{n=N}^\infty R^n =\frac{\sum_{n=N}^\infty R^n-R\sum_{n=N}^\infty R^n}{1-R} =\frac{\sum_{n=N}^\infty R^n-\sum_{n=N}^\infty R^{n+1}}{1-R} =\frac{\sum_{n=N}^\infty R^n-\sum_{n=N+1}^\infty R^n}{1-R} =\frac{R^N}{1-R}$

$\sum_{n=N}^\infty nR^n =\frac{\sum_{n=N}^\infty nR^n-\sum_{n=N+1}^\infty[n-1]R^n}{1-R} =\frac{NR^N+\sum_{n=N+1}^\infty 1R^n}{1-R} =\frac{NR^N+\frac{R^{N+1}}{1-R}}{1-R} =\frac{R^N}{1-R}\left[N+\frac{R}{1-R}\right]$

$\sum_{n=N}^\infty n^2R^n =\frac{\sum_{n=N}^\infty n^2R^n-\sum_{n=N+1}^\infty[n-1]^2R^n}{1-R} =\frac{\sum_{n=N}^\infty n^2R^n-\sum_{n=N+1}^\infty n^2R^n+2\sum_{n=N+1}^\infty nR^n-\sum_{n=N+1}^\infty R^n}{1-R} =\frac{N^2R^N+2\frac{R^{N+1}}{1-R}\left[N+1+\frac{R}{1-R}\right]-\frac{R^{N+1}}{1-R}}{1-R} =\frac{R^N}{1-R}\left[N^2+\frac{R}{1-R}\left[2N+1+\frac{2R}{1-R}\right]\right]$

$\sum_{n=N}^\infty n^3R^n =\frac{N^3R^N+3\frac{R^{N+1}}{1-R}\left[N^2+2N+1+\frac{R}{1-R}\left[2N+3+\frac{2R}{1-R}\right]\right]-3\frac{R^{N+1}}{1-R}\left[N+1+\frac{R}{1-R}\right]+\frac{R^{N+1}}{1-R}}{1-R} =\frac{R^N}{1-R}\left[N^3+\frac{R}{1-R}\left[3N^2+3N+1+\frac{R}{1-R}\left[6N+6+\frac{6R}{1-R}\right]\right]\right]$

$\sum_{n=N}^\infty n^4R^n =\frac{R^N}{1-R}\left[N^4+\frac{R}{1-R}\left[4N^3+6N^2+4N+1+\frac{R}{1-R}\left[12N^2+24N+14+\frac{R}{1-R}\left[24N+36+\frac{24R}{1-R}\right]\right]\right]\right]$

apparently $\sum_{n=N}^\infty n^pR^n=\frac{R^N}{1-R}\sum_{r=0}^p(\frac{R}{1-R})^r\sum_{n=0}^{p-r}N^nϤ(p,r,n)$ where $Ϥ(p,r,n)=[r=0][p=n]-[r\ne0]\sum_{s=1}^p(-1)^s{p\choose s}\sum_{m=n}^{p-r}{m\choose n}Ϥ(p-s,r-1,m)$

import Data.Function.Memoize c::Int->Int->Int c = memoFix2$ \c n k-> if k<0||k>n then 0 else if k==0 then 1 else c(n-1)(k-1)+c(n-1)k q::Int->Int->Int->Int q = memoFix3$ \q p r n->if r==0 then sum[1|p==n] else sum[ -(-1)^s*c p s*sum[c m n*q(p-s)(r-1)m|m<-[n..p-r]]|s<-[1..p]] main=mapM_ printn<-[0..p-r|r<-[0..p]]|p<-[0..9]]

$\sum_{n=N}^\infty n^5R^n =\frac{R^N}{1-R}\left[N^5+\frac{R}{1-R}\left[5N^4+10N^3+10N^2+5N+1+\frac{R}{1-R}\left[20N^3+60N^2+70N+30+\frac{R}{1-R}\left[60N^2+180N+150+\frac{R}{1-R}\left[120N+240+\frac{120R}{1-R}\right]\right]\right]\right]\right]$

$\sum_{n=N}^\infty n^6R^n =\frac{R^N}{1-R}\begin{bmatrix} (\frac{R}{1-R})^0\\ (\frac{R}{1-R})^1\\ (\frac{R}{1-R})^2\\ (\frac{R}{1-R})^3\\ (\frac{R}{1-R})^4\\ (\frac{R}{1-R})^5\\ (\frac{R}{1-R})^6\end{bmatrix}^T\begin{bmatrix} 0&0&0&0&0&0&1\\ 1&6&15&20&15&6&0\\ 62&180&210&120&30&0&0\\ 540&900&540&120&0&0&0\\ 1560&1440&360&0&0&0&0\\ 1800&720&0&0&0&0&0\\ 720&0&0&0&0&0&0\end{bmatrix}\begin{bmatrix} 1\\ N\\ N^2\\ N^3\\ N^4\\ N^5\\ N^6\end{bmatrix}$

$\sum_{n=N}^\infty [K+Ln]R^n$ $=\frac{R^N}{1-R}\left[K+L\left[N+\frac{R}{1-R}\right]\right]$ $=\frac{R^N}{1-R}$ $\begin{bmatrix}(R^{-1}-1)^{-0}\\(R^{-1}-1)^{-1}\end{bmatrix}^T$ $\begin{bmatrix}K&L\\L&0\end{bmatrix}$ $\begin{bmatrix}N^0\\N^1\end{bmatrix}$

$\sum_{n=N}^\infty [K+Ln]R^n\sum_{n_2=n+1}^\infty [K+Ln_2]R^{n_2} =\sum_{n=N}^\infty [K+Ln]R^n\frac{R^{n+1}}{1-R}\left[K+L\left[n+\frac{1}{1-R}\right]\right] \\=\sum_{n=N}^\infty\left[\left[K^2+\frac1{1-R}KL\right]+\left[2KL+\frac1{1-R}L^2\right]n+L^2n^2\right]\frac{R^{2n+1}}{1-R} \\=\frac{R}{1-R}\frac{R^{2N}}{1-R^2}\begin{bmatrix}(\frac{R^2}{1-R^2})^0\\(\frac{R^2}{1-R^2})^1\\(\frac{R^2}{1-R^2})^2\end{bmatrix}^T \begin{bmatrix}K^2+\frac1{1-R}KL&2KL+\frac1{1-R}L^2&L^2\\2KL+[1+\frac1{1-R}]L^2&2L^2&0\\2L^2&0&0\end{bmatrix}\begin{bmatrix}1\\N\\N^2\end{bmatrix} \\=\frac{R^{2N+1}}{[1-R][1-R^2]} \begin{bmatrix}K^2+[\frac1{1-R}+\frac{2R^2}{1-R^2}]KL+\frac{R^2}{1-R^2}[1+\frac1{1-R}+\frac{2R^2}{1-R^2}]L^2 \\2KL+[\frac1{1-R}+\frac{2R^2}{1-R^2}]L^2 \\L^2\end{bmatrix}^T\begin{bmatrix}1\\N\\N^2\end{bmatrix} $

$\sum_{n=N}^\infty [K+Ln]R^n\sum_{n_2=n+1}^\infty [K+Ln_2]R^{n_2}\sum_{n_3=n_2+1}^\infty [K+Ln_3]R^{n_3} \\=\sum_{n=N}^\infty [K+Ln]R^n\frac{R}{1-R}\frac{R^{2n+2}}{1-R^2} \begin{bmatrix}(\frac{R^2}{1-R^2})^0\\(\frac{R^2}{1-R^2})^1\\(\frac{R^2}{1-R^2})^2\end{bmatrix}^T \begin{bmatrix}K^2+[2+\frac1{1-R}]KL+[1+\frac1{1-R}]L^2&2KL+[2+\frac1{1-R}]L^2&L^2 \\2KL+[3+\frac1{1-R}]L^2&2L^2&0\\2L^2&0&0\end{bmatrix}\begin{bmatrix}1\\n\\n^2\end{bmatrix} \\=\sum_{n=N}^\infty\frac{R^{3n+3}}{[1-R][1-R^2]} \begin{bmatrix}(\frac{R^2}{1-R^2})^0\\(\frac{R^2}{1-R^2})^1\\(\frac{R^2}{1-R^2})^2\end{bmatrix}^T \begin{bmatrix}K^3+[2+\frac1{1-R}]K^2L+[1+\frac1{1-R}]KL^2&3K^2L+[4+\frac2{1-R}]KL^2+[1+\frac1{1-R}]L^3&3KL^2+[2+\frac1{1-R}]L^3&L^3 \\2K^2L+[3+\frac1{1-R}]KL^2&4KL^2+[3+\frac1{1-R}]L^3&2L^3&0\\2KL^2&2L^3&0&0\end{bmatrix}\begin{bmatrix}1\\n\\n^2\\n^3\end{bmatrix} \\=\sum_{n=N}^\infty\frac{R^{3n+3}}{[1-R][1-R^2]} \begin{bmatrix}K^3+[2+\frac1{1-R}+\frac{2R^2}{1-R^2}]K^2L+[1+\frac1{1-R}+\frac{R^2}{1-R^2}[3+\frac1{1-R}+\frac{2R^2}{1-R^2}]]KL^2\\ 3K^2L+[4+\frac2{1-R}+\frac{4R^2}{1-R^2}]KL^2+[1+\frac1{1-R}+\frac{R^2}{1-R^2}[3+\frac1{1-R}+\frac{2R^2}{1-R^2}]]L^3\\ 3KL^2+[2+\frac1{1-R}+\frac{2R^2}{1-R^2}]L^3\\L^3\end{bmatrix}^T\begin{bmatrix}1\\n\\n^2\\n^3\end{bmatrix} \\=\frac{\frac{\frac{R^{3N+3}}{1-R^3}}{1-R^2}}{1-R}\begin{bmatrix} [\frac{R^3}{1-R^3}]^0\\ [\frac{R^3}{1-R^3}]^1\\ [\frac{R^3}{1-R^3}]^2\\ [\frac{R^3}{1-R^3}]^3\end{bmatrix}^T\begin{bmatrix} K^3+[2+\frac1{1-R}+\frac{2R^2}{1-R^2}]K^2L+[1+\frac1{1-R}+\frac{R^2}{1-R^2}[3+\frac1{1-R}+\frac{2R^2}{1-R^2}]]KL^2& 3K^2L+[4+\frac2{1-R}+\frac{4R^2}{1-R^2}]KL^2+[1+\frac1{1-R}+\frac{R^2}{1-R^2}[3+\frac1{1-R}+\frac{2R^2}{1-R^2}]]L^3& 3KL^2+[2+\frac1{1-R}+\frac{2R^2}{1-R^2}]L^3&L^3\\ 3K^2L+[7+\frac2{1-R}+\frac{4R^2}{1-R^2}]KL^2+[3+\frac2{1-R}+\frac{R^2}{1-R^2}[5+\frac1{1-R}+\frac{2R^2}{1-R^2}]]L^3& 6KL^2+[7+\frac2{1-R}+\frac{4R^2}{1-R^2}]L^3&3L^3&0\\ 6KL^2+[10+\frac2{1-R}+\frac{4R^2}{1-R^2}]L^3&6L^3&0&0\\6L^3&0&0&0\end{bmatrix}\begin{bmatrix}1\\N\\N^2\\N^3\end{bmatrix} \\=\frac{\frac{\frac{R^{3N+3}}{1-R^3}}{1-R^2}}{1-R}\begin{bmatrix} K^3+[2+\frac1{1-R}+\frac{2R^2}{1-R^2}+\frac{3R^3}{1-R^3}]K^2L+[1+\frac1{1-R}+\frac{R^2}{1-R^2}[3+\frac1{1-R}+\frac{2R^2}{1-R^2}]+\frac{R^3}{1-R^3}[7+\frac2{1-R}+\frac{4R^2}{1-R^2}+\frac{6R^3}{1-R^3}]]KL^2+\frac{R^3}{1-R^3}[3+\frac2{1-R}+\frac{R^2}{1-R^2}[5+\frac1{1-R}+\frac{2R^2}{1-R^2}]+\frac{R^3}{1-R^3}[10+\frac2{1-R}+\frac{4R^2}{1-R^2}+\frac{6R^3}{1-R^3}]]L^3\\ 3K^2L+[4+\frac2{1-R}+\frac{4R^2}{1-R^2}+\frac{6R^3}{1-R^3}]KL^2+[1+\frac1{1-R}+\frac{R^2}{1-R^2}[3+\frac1{1-R}+\frac{2R^2}{1-R^2}]+\frac{R^3}{1-R^3}[7+\frac2{1-R}+\frac{4R^2}{1-R^2}+\frac{6R^3}{1-R^3}]]L^3\\ 3KL^2+[2+\frac1{1-R}+\frac{2R^2}{1-R^2}+\frac{3R^3}{1-R^3}]L^3\\L^3\end{bmatrix}^T\begin{bmatrix}1\\N\\N^2\\N^3\end{bmatrix} $

[//en.wikipedia.org/wiki/Exact_cover#Exact_hitting_set Exact Covers and Hittings]
$c(s) = \{ r\subseteq s : \forall x \in \cup s : \exists! y \in r: y \ni x \}$

$h(s) = \{ r\subseteq \cup s: \forall x \in s : \exists! y \in r: y \in x \}$

exacthittings sets = if null sets then else [ pivot : extension | pivot <- minimumBy (comparing length) sets, let (deletables, undeletables) = partition (elem pivot) sets, extension <- exacthittings (map (\\ unions deletables) undeletables) ] test0 = exacthittings (words "ab ef de abc cd de acef") == words "bdf" sudokus = exacthittings (concat [ [       row x >< [y],       col x >< [y],       [x] >< [y] >< [0..8],       box (divMod x 3) >< [y] ] | (x,y) <- [0..8] >< [0..8] ]) where (><) = liftM2 row i = [i] >< [0..8] col i = [0..8] >< [i] box (i,j) = map (3*i+) [0..2] >< map (3*j+) [0..2] test1 = sudokus

[//en.wikipedia.org/wiki/Sedenion Sedenion Multiplication]
tee --append PowerNum.lhs << 0 - partner (umbox - row) col where umbox = until (>row) (2*) 1 LT -> 0 - flip partner row col EQ -> row EOF

$ \begin{bmatrix} +P0&-P1&-P2&-P3&-P4&-P5&-P6&-P7&-P8&-P9&-PA&-PB&-PC&-PD&-PE&-PF \\ +P1&+P0&-P3&+P2&-P5&+P4&+P7&-P6&-P9&+P8&+PB&-PA&+PD&-PC&-PF&+PE \\ +P2&+P3&+P0&-P1&-P6&-P7&+P4&+P5&-PA&-PB&+P8&+P9&+PE&+PF&-PC&-PD \\ +P3&-P2&+P1&+P0&-P7&+P6&-P5&+P4&-PB&+PA&-P9&+P8&+PF&-PE&+PD&-PC \\ +P4&+P5&+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