Skip to content

Commit c622e68

Browse files
alerqueOmikhleia
andcommitted
Add example of typesetting Willan's Formula
Closes #17 Co-authored-by: Omikhleia <didier.willis@gmail.com>
1 parent 220213c commit c622e68

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

content/willans.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
+++
2+
title = "Willan’s Formula"
3+
description = "An exact prime formula which is however quite insane and fairly useless."
4+
extra.typesetters = [ "typst", "sile", "xelatex" ]
5+
+++
6+
7+
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.

data/willans/sile.sil

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
\begin[papersize=a7,landscape=true]{document}
2+
\nofolios
3+
\neverindent
4+
\use[module=packages.math]
5+
6+
\begin[mode=display]{math}
7+
\def{floor}{\lfloor #1 \rfloor}
8+
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}}}
9+
\end{math}
10+
11+
\end{document}
12+

data/willans/typst.typ

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#set page(
2+
paper: "a7",
3+
flipped: true,
4+
)
5+
6+
$
7+
p_n = 1 + sum_(i=1)^(2^n) floor((n / (sum_(j=1)^i floor(cos^2(pi ((j - 1)! + 1) / j))))^(1/n))
8+
$

data/willans/xelatex.tex

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
\documentclass{article}
2+
\usepackage[paperheight=74mm,paperwidth=105mm,margin=4mm]{geometry}
3+
\pagenumbering{gobble}
4+
\usepackage{unicode-math}
5+
\begin{document}
6+
7+
$$
8+
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
9+
$$
10+
11+
\end{document}
12+

0 commit comments

Comments
 (0)