diff --git a/content/willans.md b/content/willans.md new file mode 100644 index 0000000..b26b27e --- /dev/null +++ b/content/willans.md @@ -0,0 +1,7 @@ ++++ +title = "Willan’s Formula" +description = "An exact prime formula which is however quite insane and fairly useless." +extra.typesetters = [ "typst", "sile", "xelatex" ] ++++ + +Willan's formula for the nth prime circa 1964; a.k.a. an exact prime formula which is quite insane and fairly useless but a nice typesetting stress test. diff --git a/data/willans/sile.sil b/data/willans/sile.sil new file mode 100644 index 0000000..c017af4 --- /dev/null +++ b/data/willans/sile.sil @@ -0,0 +1,12 @@ +\begin[papersize=a7,landscape=true]{document} +\nofolios +\neverindent +\use[module=packages.math] + +\begin[mode=display]{math} + \def{floor}{\lfloor #1 \rfloor} + p_n = 1 + \sum_{i=1}^{2^n} \floor{(\frac{n}{\sum_{j=1}^i \floor{\cos^2(\pi \frac{(j-1)! + 1}{j})}})^{\frac{1}{n}}} +\end{math} + +\end{document} + diff --git a/data/willans/typst.typ b/data/willans/typst.typ new file mode 100644 index 0000000..a170165 --- /dev/null +++ b/data/willans/typst.typ @@ -0,0 +1,8 @@ +#set page( + paper: "a7", + flipped: true, +) + +$ +p_n = 1 + sum_(i=1)^(2^n) floor((n / (sum_(j=1)^i floor(cos^2(pi ((j - 1)! + 1) / j))))^(1/n)) +$ diff --git a/data/willans/xelatex.tex b/data/willans/xelatex.tex new file mode 100644 index 0000000..2d42059 --- /dev/null +++ b/data/willans/xelatex.tex @@ -0,0 +1,12 @@ +\documentclass{article} +\usepackage[paperheight=74mm,paperwidth=105mm,margin=4mm]{geometry} +\pagenumbering{gobble} +\usepackage{unicode-math} +\begin{document} + +$$ +p_n = 1 + \sum_{i=1}^{2^n} \left\lfloor \left(\frac{n}{\sum_{j=1}^i \left\lfloor \cos^2\left(\pi \frac{(j-1)! + 1}{j}\right) \right\rfloor}\right)^{\frac{1}{n}} \right\rfloor +$$ + +\end{document} +