Anonymous user
Ulam spiral (for primes): Difference between revisions
align grids horizontally
(→{{header|Java}}: added larger scale Ulam spiral) |
(align grids horizontally) |
||
Line 19:
Sometimes, the starting number can be specified to show more visual striking patterns (of prime densities).
[A larger than necessary grid (numbers wise) is shown here to illustrate the pattern of numbers on the diagonals (which may be used by the method to orientate the direction of spiral-construction algorithm within the example computer programs)]. ▼
{| class="wikitable" style="float:center;border: 4px solid blue; background:lightgreen; color:black; margin-left:auto;margin-right:auto;text-align:center;width:34em;height:34em;table-layout:fixed;font-size:125%"▼
Then, in the next phase in the transformation of the Ulam prime spiral, the non-primes are translated to blanks. ▼
In the orange grid below, the primes are left intact, and all non-primes are changed to blanks. ▼
Then, in the final transformation of the Ulam spiral (the yellow grid), translate the primes to a glyph such as a <big><big><b> ∙ </b></big></big> or some other suitable glyph.▼
<br>
▲{| class="wikitable" style="float:
|-
| <big><big>'''65'''</big></big> || <big><big>'''64'''</big></big> || <big><big>'''63'''</big></big> || <big><big>'''62'''</big></big> || <big><big>'''61'''</big></big> || <big><big>'''60'''</big></big> || <big><big>'''59'''</big></big> || <big><big>'''58'''</big></big> || <big><big>'''57'''</big></big>
Line 40 ⟶ 49:
|}
{| class="wikitable" style="float:
▲[A larger than necessary grid (numbers wise) is shown here to illustrate the pattern of numbers on the diagonals (which may be used by the method to orientate the direction of spiral-construction algorithm within the example computer programs)].
▲Then, in the next phase in the transformation of the Ulam prime spiral, the non-primes are translated to blanks.
▲In the orange grid below, the primes are left intact, and all non-primes are changed to blanks.
▲{| class="wikitable" style="float:center;border: 4px solid blue; background:orange; color:black; margin-left:auto;margin-right:auto;text-align:center;width:34em;height:34em;table-layout:fixed;font-size:125%"
|-
| <big><big>''' '''</big></big> || <big><big>''' '''</big></big> || <big><big>''' '''</big></big> || <big><big>''' '''</big></big> || <big><big>'''61'''</big></big> || <big><big>''' '''</big></big> || <big><big>'''59'''</big></big> || <big><big>''' '''</big></big> || <big><big>''' '''</big></big>
Line 68 ⟶ 70:
|}
{| class="wikitable" style="float:
▲Then, in the final transformation of the Ulam spiral (the yellow grid), translate the primes to a glyph such as a <big><big><b> ∙ </b></big></big> or some other suitable glyph.
▲{| class="wikitable" style="float:center;border: 4px solid blue; background:yellow; color:black; margin-left:auto;margin-right:auto;text-align:center;width:34em;height:34em;table-layout:fixed;font-size:125%"
|-
| <big><big>''' '''</big></big> || <big><big>''' '''</big></big> || <big><big>''' '''</big></big> || <big><big>''' '''</big></big> || <big><big>''' ∙'''</big></big> || <big><big>''' '''</big></big> || <big><big>''' ∙'''</big></big> || <big><big>''' '''</big></big> || <big><big>''' '''</big></big>
Line 91:
|}
<br style="clear:both">
The Ulam spiral becomes more visually obvious as the grid increases in size.
Line 101 ⟶ 103:
;Also see:
<br><br>
|