13 Ways of Looking at the Number 13

MonthName 9, Year

Ed Pegg Jr, Scientific Information Editor, Scientific Information Group

Why are we releasing Version 13 of Mathematica?

As a math and science company, Wolfram doesn’t fear two-digit number integers, especially that particular one between 12 and 14. That is to say, we don’t have triskaidekaphobia, not on Friday the 13th or any other day of the year.

Many nice things can be said about 13 beyond it being a ternary repdigit (Subscript["111", "3"]) or the answer to Prime[6]. It’s one of just three known Wilson primes because (((13-1)! +1)/(13^2))=2834329, an integer, and is also the fifth Mersenne prime exponent:

mersenne={2,3,5,7,13,17,19,31,61,89,107,127,521,607,1279,2203,2281,3217,4253,4423,9689,9941,11213,19937,21701,23209,44497,86243,110503,132049,216091,756839,859433,1257787,1398269,2976221,3021377,6972593,13466917,20996011,24036583,25964951,30402457,32582657,37156667,42643801,43112609};
PrimeQ[(2^(#))-1]&/@Take[mersenne,13]

But 13 has much more going for it than just being a prime number, and here are 13 reasons why.

1. First, 13 is part of many linear recurrences. For example, 13 is a Fibonacci number where the limit of ratios between values goes to the golden ratio, phi, (ϕ^2)=ϕ+1:

LinearRecurrence[{1,1},{0,1},14]

Limit[Fibonacci[n+1]/Fibonacci[n], n-> ∞]

The fifth substitution in the Ammann chair tiling thus has 13 chairs:

Row@Table[ResourceFunction["AlgebraicSubstitutionTiling"]["AmmannChair",k, {"N", "ImageSize"->100}],{k,1,5}]

Thirteen is also a tribonacci number, a term coined by Mark Feinberg at the age of 14. The ratio between terms goes to the tribonacci constant, (t^(3 ))=(t^2)+t+1:

LinearRecurrence[{1,1,1},{0,0,1},14]

Tribonacci numbers can be thought of as binary sequences without 000:

Table[Length[Select[Tuples[{0,1},{k}], 
Not[MemberQ[Partition[#,3,1],{0,0,0}]]&]],{k,3,10}]

2. Thirteen is also a Narayana cow number, based on psi, (Ψ^3)=(Ψ^2)+1, the supergolden ratio:

LinearRecurrence[{1,0,1},{1,1,1},14]

The sixth substitution in the psi-quad tiling thus has 13 quads:

Row@Table[ResourceFunction["AlgebraicSubstitutionTiling"]["PsiQuad",k, {"N", "ImageSize"->100}],{k,2,6}]

3. There are 13 Archimedean solids, in which both the golden ratio and tribonacci constant feature prominently. Similarly, there are 13 Archimedean duals, all of which make fair dice:

Column[Grid[Partition[Graphics3D[PolyhedronData[#][[1]],
ImageSize-> {80,80},Boxed-> False]&/@#,UpTo[5]]]&/@{PolyhedronData["Archimedean"],PolyhedronData["ArchimedeanDual"]}]

4. As a number of form (n^2)+(((n+1))^2), 13 is a centered square number:

Graphics[{EdgeForm[{Black, Thick}], Gray,Disk[#,1/Sqrt[2]]&/@Select[Tuples[Range[-2,2],{2}],EvenQ[Total[#]]&]}, ImageSize-> 300]

5. A combination lock with three buttons has 13 combinations where every button is pressed once, making it the third Fubini, or ordered Bell, number:

Select[Flatten[Table[Tuples[Subsets[Range[3],{1,3}],{k}],{k,1,3}],1],Sort[Flatten[#]]=={1,2,3}&]

6. Balanced ternary notation allows three weights and a two-pan scale to measure weights 1 to 13:

{9,3,1}.#&/@Drop[Tuples[{-1,0,1},{3}],14]

7. The remainder graph of 13 has the following form. To use it, pick a number like 2,522. Then start at 0 and follow 2 blue, 1 red, 5 blue, 1 red, 2 blue, 1 red, 2 blue to find the remainder of dividing 2,522 by 13. This works for any positive integer:

ResourceFunction["NestGraphTagged"][n|->Mod[{10 n, n+1},13],1,10,"StateLabeling"->True,ImageSize-> 520]

8. Using steps of N, E, NE or (1,0), (0,1), (1,1), there are 13 ways to get from (0,0) to (2,2), part of a combinatorial sequence known as the central Delannoy numbers:

del=Select[Flatten[Table[Tuples[{{0,1},{1,0},{1,1}},{k}],{k,2,4}],1],Total[#]=={2,2}&];
Row[Graphics[Line[FoldList[Plus,{0,0},#]], ImageSize-> 40]&/@del]

These values can be calculated with Legendre polynomials:

Table[LegendreP[n,3],{n,0,5}]

9. There are 13 books in Euclid’s Elements. For example, Book I, Proposition 1 discusses the making of an equilateral triangle:

RandomInstance[GeometricScene[{a,b,c},{CircleThrough[{b,c},a],CircleThrough[{a,c},b],Style[Triangle[{a,b,c}],Pink]}]]

10. A sparse ruler of length n allows all integer distances up to n to be measured with a minimal number of marks. The sparse ruler for length 211 uses 26 marks and features 13 spacings of 13:

sparse={0,1,2,3,6,12,18,31,44,57,70,83,96,109,122,135,148,161,174,187,194,201,208,209,210,211};
cases=First/@SplitBy[SortBy[Subsets[sparse,{2}],Differences],Differences];
Graphics[{Black,Rectangle[{0,0},{211,6}], Yellow, Line[{{#,.5},{#,5.5}}]&/@sparse, Green,Text[#[[2]]-#[[1]],{Mean[#],3}]&/@Select[Partition[sparse,2,1],#[[2]]-#[[1]]>1&],Black,
Style[Text[#, {#,8}],9]&/@sparse,
Table[{Hue[n/13],AbsoluteThickness[.4],Line[Transpose[{cases[[n]],-.4{n,n}}]]},{n,1,211}]}]

11. The BioSequence for the string "THIRTEEN" is as follows:

MoleculePlot[BioSequence["THIRTEEN"]]

12. Books like An Elementary Introduction to the Wolfram Language use ISBN-13 numbers:

ResourceFunction["ValidISBNQ"]["978-1944183059"]

13. Finally, for obscuring text in a 26-letter alphabet, the standard is the ROT13 Caesar cipher that rotates each letter forward 13 places:

ResourceFunction["CaesarCipher"]["abjurer",13]

This allows us to finish this article with an obscure piece of code:

ResourceFunction["CaesarCipher"]["Nyy va nyy, gur ahzore guvegrra unf znal snfpvangvat cebcregvrf. Nyfb, Nccyr eryrnfrq gur vCubar 13, fb gung funzrq hf sebz fxvccvat evtug gb Irefvba 14.",13]