Conceptio › Archive › Stack Exchange
Stack Exchange open access CC BY-SA

Help with a prime number spiral which turns 90 degrees at each prime

Karl · 2016
Stack Exchange · Datasets · License: CC BY-SA · 2016
Open Source ↗
mathpattern-recognitionvisualization
I awoke with the following puzzle that I would like to investigate, but the answer may require some programming (it may not either). I have asked on the meta site and believe the question to be suitable and hopefully interesting for the community. I will try to explain the puzzle as best I can then detail the questions I am interested in after. Imagine squared paper. In one square write the number $1.$ Continue to write numbers from left to right (as normal) until you reach a prime. The next number after a prime should be written in the square located $90$ degrees clockwise to the last. You then continue writing numbers in that direction. This procedure should be continued indefinitely. Here is a sample of the grid: $$\begin{array}{} 7&8&9&10&11&40&41 \\6&1&2&&12&&42\\5&4&3&14&13&44&43\\&&34&&26\\&&33&&27\\&&32&&28\\&&31&30&29\end{array}$$ Note that the square containing 3 also contains 15 (I couldn't put it in without confusing the diagram. In fact some squares contain multiple entries. I would have liked to see an expanded version of the diagram. I originally thought of shading squares that contain at least one number. Questions Does the square surrounded by $2,3,9,10,11,12,13,14$ ever get shaded? If so, will the whole grid ever be shaded? Is there a maximum number of times a square can be visited? I have got to 4 times but it is easy to make mistakes by hand. Are there any repeated patterns in the gaps? I have other ideas but this is enough for now as I have genuinely no idea how easy or difficult this problem is. Please forgive me for not taking it any further as it is so easy to make mistakes. I hope this is interesting for the community and look forwards to any results. Thanks. Any questions I'll do my best to clarify. Side note: I observed that initially at least the pattern likes to cling to itself but I suspect it doesn't later on.
Conceptio Open Archive

Analyze & explore related research in Conceptio

Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.

This document is indexed with metadata only: full text is not available in the archive for this record. Open the official source ↗

Related documents

Record · ID 787390
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Bring this data into your agent: Connect via MCP or API · 20 free credits to start · no card required
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive