Tupper's self-referential formula: Difference between revisions
Content added Content deleted
(Add C# implementation) |
No edit summary |
||
Line 466: | Line 466: | ||
{{out}} |
{{out}} |
||
Same as Algol 68. |
Same as Algol 68. |
||
=={{header|Mathematica}}/{{header|Wolfram Language}}== |
|||
{{trans|Julia}} |
|||
<syntaxhighlight lang="Mathematica"> |
|||
(*Define the Tupper's self-referential formula function*) |
|||
tupperMat[k_] := |
|||
Table[1 - |
|||
Mod[Floor[Mod[Floor[y/17] 2^(-17 Floor[x] - Mod[y, 17]), 2]], |
|||
2], {y, k, k + 16}, {x, 0, 105}] |
|||
(*Define the constant k*) |
|||
k = 960939379918958884971672962127852754715004339660129306651505519271\ |
|||
7028023952664246896428421743507181212671537827706233559932372808741443\ |
|||
0789132596394133772348785773574982392662971551717371699516523289053822\ |
|||
1612403238855866184013235585136048828693337902491454229288667081096184\ |
|||
4960917051834540678277315517054053816273809676025656250169814820834187\ |
|||
8316384911559022561000365235137034387446184837873723819822484986346503\ |
|||
3159410054974700593138339226497249461751545728366702369745461014655997\ |
|||
933798537483143786841806593422227898388722980000748404719; |
|||
(*Display the heatmap*) |
|||
ArrayPlot[Map[Reverse, tupperMat[k]], AspectRatio -> 1/6, |
|||
Frame -> False, ImageSize -> Large, |
|||
ColorRules -> {0 -> Black, 1 -> White}] |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
[[File:Tupper's self-referential formula.png|thumb]] |
|||
=={{header|Nim}}== |
=={{header|Nim}}== |