Prime Magic Block Checker — Deep Nested Coloring

Created by Inder J. Taneja

Checks prime magic squares in separate structural modes and creates publication-style Excel matrices with optional block, sub-block, and sub-sub-block borders.

Nested Block Coloring and Concentric Shades

Format an Excel matrix without changing its values. Tile the square into groups and smaller blocks, then add centered squares inside the smallest block. Each group keeps its own color, becoming lighter toward the center.

Step 1 (optional): TXT to plain Excel

Upload a TXT file or paste integer entries. Use one matrix row per line, with spaces, tabs, commas or semicolons between entries. Separate different square matrices by a blank line. If a TXT file is selected, it takes priority over pasted text.

Plain Excel contains only the original numbers, starting at A1, with one worksheet per matrix. Conversion does not run the prime or magic checks.

Step 2: Load or color your Excel matrix

Default borders: black: outer groups. Blue: nested tiled blocks. Green: centered 5×5 level. Red: centered 3×3 level. Further centered levels alternate green and red. For more than two tiled levels, deeper boundaries use thinner blue lines. All worksheets and matrix positions are retained. Existing formats outside the matrix are retained where supported by the Excel reader; this is intended for numeric workbooks, not macros or embedded objects.

Coloring does not establish magicity or primality. Use the original checker below for numerical verification. The Excel library is included in this HTML file, so this formatter can run offline.



The coloring modes are separate. Whole-square concentric mode adds no block separators. Block mode adds no whole-square concentric rings. Block-concentric mode colors concentric rings only inside each selected block; thick colored lines separate neighboring concentric blocks, while internal ring borders remain thin. Blocks-and-sub-blocks mode uses two independent sizes; check "Sub-block: separate inner region" to color each sub-block as a 1-cell border ring plus one solid interior color instead of one flat color — for example, main blocks of order 20 divided into a 4×4 grid of 5×5 sub-blocks, each 5×5 shown as a border ring around one solid 3×3 center; or order 18 into 3×3 of 6×6, each 6×6 as a border ring around a solid 4×4 center. Hierarchical mode adds an optional third level, for example 20×20 → 10×10 → 5×5. The external-border mode first separates a centered internal square, then divides only that internal square into blocks; for example 10 → inner 8 → 4×4, or 14 → inner 12 → 3×3/4×4, or 19 → inner 15 → 3×3/5×5. The nested "blocks with their own border" mode applies that same border-then-blocks idea to EACH block individually — for example, main blocks of order 10, each with a 1-cell border around its own centered 2×2-of-4×4 region (set Main block order=10, Centered internal order=8, Blocks inside internal part=4). Examples: 40×40 divided into 10×10 blocks; 32×32 divided into 8×8 or 4×4 blocks. The Excel block and sub-block settings are now checked independently of the Internal block orders field.