<jupyter_start><jupyter_text>Magic Square made easy  Step 1: Form a Square MatrixLet ‘n’ be the size of the Magic Square, say 5. Write numbers 1 to 25 (n x n) in sequence. Let us identify the final Matrix from below matrix.     12345    678910    1112131415    1617181920    2122232425  Step 2: Row and Column Identifier MatricesForm two matrices of same size, one for identifying the row and another for column  Row identifier Matrix is formed by numbering middle column from 1 to 5 and rest of the Columns on either side by subtracting and adding 1    45123    51234    12345    23451    34512 The Column identifer Matrix is a mirror image of row identifier matrix    32154    43215    54321    15432    21543  Step 3: Final Matrix  Super impose row and column matrices and find the number for each cell from the corresponding row and column in the first matrix For e.g Using yellow cells in Step 2, 4th row 3rd column i.e 18 in Step 1 Using green cells in Step 2, 3rd row 5th column i.e 15 in Step 1     182211014    24371120    59131721    61519232    12162548  The above steps works for Magic Square of any size<jupyter_code>"""
 Magic Square
"""

n = 5;
for r in range(n):
    for c in range(n):        
        rm = (((n + 1) // 2 + r + c) % n) # row matrix
        cm = (((n + 1) // 2 + r + n - c - 1) % n) + 1 # column matrix
        magic = (rm * n) + cm
        print('{:>3}'.format(magic), end=" ")
    print()<jupyter_output>18  22   1  10  14 
 24   3   7  11  20 
  5   9  13  17  21 
  6  15  19  23   2 
 12  16  25   4   8
{'fraction_non_alphanumeric': 0.05974025974025974, 'fraction_numerical': 0.1318181818181818, 'mean_word_length': 2.486425339366516, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '405466', 'license': 'CC0-1.0', 'n_tokens_mistral': 607, 'n_tokens_neox': 471, 'n_words': 251, 'path': 'notebooks/magicsquare.ipynb', 'repo_name': 'chellash/jupyterlab-demo', 'size': '1540'}