From fee5df168f2b592cc3f657b26b150e195c7553aa Mon Sep 17 00:00:00 2001
From: Camil Staps
Date: Mon, 25 Jan 2016 10:05:39 +0100
Subject: primes & composites

---
 composites-golfed.tex | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 composites-golfed.tex

(limited to 'composites-golfed.tex')

diff --git a/composites-golfed.tex b/composites-golfed.tex
new file mode 100644
index 0000000..3e038fa
--- /dev/null
+++ b/composites-golfed.tex
@@ -0,0 +1,7 @@
+\newcount\a\newcount\b\newcount\c\newcount\n\newcount\p\newcount\q\let\v\advance\let\e\else\let\z\ifnum
+\def\d#1:#2:#3:{\z#1>#2\v#1 by-#2\d#1:#2:#3:\e\z#1=#2#3=1\e#3=0\fi\fi}
+\def\i#1:#2:#3:{#3=0\z#1>#2\a=#1\d\a:#2:\c:
+\z\c=0\b=#2\v\b by 1\i#1:\the\b:#3:\e#1\par\fi\e#3=1\fi}
+\def\l#1:#2:#3:#4:{\i\the#1:2:#4:
+\z#4=0\v#2 by 1\fi\z#2<#3\v#1 by 1\l#1:#2:#3:#4:\fi}
+\l\p:\n:12:\q:\end
-- 
cgit v1.2.3

