User:Roman Czyborra

[//en.wikipedia.org/wiki/Taxicab_geometry Rectangular] [//en.wikipedia.org/wiki/Stencil_code Stencil] Grows [//en.wikipedia.org/wiki/Sphere Perfect Roundness]
module Czyborra.Czybor[//arxiv.org/pdf/math-ph/0307038v1.pdf space]20160821 (q) where import Data.Function.Memoize ([//wiki.haskell.org/Memoization memoFix]) q :: (Integer,Integer,Integer,Integer) -> (Integer,Integer,Integer,Integer) q = memoFix ( \         q (h,i,j,k) ->         if h < 0 then (0,0,0,0)         else if (h,i,j,k) == (0,0,0,0) then (1,0,0,0)         else let                 (w, x, y, z)  [//wiki.haskell.org/Infix_operators ^] (h, i, j, k) = (w+h, x+i, y+j, z+k)                 (h, i, j, k)  * (0, 1, 0, 0) = [//en.wikipedia.org/wiki/Quaternion (-i, h, k, -j)]                 (h, i, j, k) * (0, 0, 1, 0) = (-j, -k, h, i)                 (h, i, j, k) * (0, 0, 0, 1) = (-k, j, -i, h)         in      ((q [//en.wikipedia.org/wiki/Octahedron (h-1, i-1, j, k)]^ q(h-1, i+1, j, k)) * (0, 1, 0, 0))         ^       ((q (h-1, i, j-1, k) ^ q(h-1, i, j+1, k)) * (0, 0, 1, 0))         ^       ((q (h-1, i, j, k-1) ^ q(h-1, i, j, k+1)) * (0, 0, 0, 1))         )

$\forall(h,i,j,k)\in\Z^4: q(h,i,j,k)=q(h,-i,j,k)=q(h,i,-j,k)=q(h,i,j,-k)$

$(h+i+j+k)\not\in2\Z\lor h^2<i^2+j^2+k^2 \implies q(h,i,j,k)=(0,0,0,0)$

$h\in2\N\implies q(h,i,j,k) \in \Z\times\{0\}^3\land h\not\in2\N\implies q(h,i,j,k) \in \{0\}\times\Z^3$

[//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&+P6&+P7&+P0&-P1&-P2&-P3&-PC&-PD&-PE&-PF&+P8&+P9&+PA&+PB \\ +P5&-P4&+P7&-P6&+P1&+P0&+P3&-P2&-PD&+PC&-PF&+PE&-P9&+P8&-PB&+PA \\ +P6&-P7&-P4&+P5&+P2&-P3&+P0&+P1&-PE&+PF&+PC&-PD&-PA&+PB&+P8&-P9 \\ +P7&+P6&-P5&-P4&+P3&+P2&-P1&+P0&-PF&-PE&+PD&+PC&-PB&-PA&+P9&+P8 \\ +P8&+P9&+PA&+PB&+PC&+PD&+PE&+PF&+P0&-P1&-P2&-P3&-P4&-P5&-P6&-P7 \\ +P9&-P8&+PB&-PA&+PD&-PC&-PF&+PE&+P1&+P0&+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)=map; 囪=filter; 㪭=fold