From c38acf81e2d6130ff440163aeefa4cf370f529a5 Mon Sep 17 00:00:00 2001
From: Camil Staps
Date: Tue, 26 Jan 2016 08:55:15 +0100
Subject: Ulam triangle

---
 ulam-triangular-golfed.tex | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 ulam-triangular-golfed.tex

(limited to 'ulam-triangular-golfed.tex')

diff --git a/ulam-triangular-golfed.tex b/ulam-triangular-golfed.tex
new file mode 100644
index 0000000..c9d0794
--- /dev/null
+++ b/ulam-triangular-golfed.tex
@@ -0,0 +1,2 @@
+\documentclass{standalone}\usepackage{pgf}\let\z\let\z\e\advance\z\f\ifnum\z\h\the\z\a\newcount\a\i\a\j\a\l\a\x\a\y\a\p\a\q\a\n\i=1\l=1\p=-1\q=1\def\m#1{\e\i by1\e\j by1\e\x by\h\p\e\y by\h\q\pgfmathparse{isprime(\h\i)}\f\pgfmathresult=1\pgfpathcircle{\pgfpoint{\h\x cm}{\h\y cm}}3pt\fi\f\j=\l\e\l by1\j=0\f\p=1\p=-1\q=1\else\f\p=-1\p=0\q=-1\else\p=1\q=0\fi\fi\fi\f#1>0\e#1by-1\m#1\fi}\begin{document}\begin{pgfpicture}\pgftransformcm10{cos(60)}{sin(60)}\pgfpointorigin\n=4000\m\n\pgfusepath{fill}\end{pgfpicture}\end{document}
+
-- 
cgit v1.2.3

