title: Trevor Horn

text: In 1990, Horn produced English musician Seal's eponymous debut album. This began a multi-album collaboration which Horn reasoned down to his liking of Seal's voice and a "musical empathy" with how he works and the songs he writes. "Seal" reached No. 1 in the UK and lead single "Crazy" went to No. 2. The album marked a turning point in Horn's production method, switching typical studio hardware for computers, and recorded tracks on "Seal" using MIDI and Studio Vision software. Horn was pleased with the results and sold his PC equipment for an Apple Macintosh. At this stage of his career, Horn had lost his enthusiasm for producing 12-inch mixes of songs and brought in other remixers to make them, while concentrating on albums.


title: Trevor Horn

text: He also produced half of the songs on Marc Almond's 1991 album "Tenement Symphony", including the three singles on the album: "Jacky", "My Hand Over My Heart" and "The Days of Pearly Spencer", which reached #4 in the UK charts.


title: Trevor Horn

text: In the 1990s, Horn wrote two songs for solo female singers. "Riding into Blue (Cowboy Song)" was recorded by Inga Humpe and "Docklands" was recorded by Betsy Cook. He also co-wrote two songs with Terry Reid for his 1991 album, "The Driver" and "The Shape of Things to Come" for Cher's 1995 album "It's a Man's World".


title: Trevor Horn

text: Horn co-produced Mike Oldfield's 1992 album "Tubular Bells II" alongside Oldfield and Tom Newman. Oldfield was a fan of the Buggles song "Video Killed The Radio Star" and described Horn as like being a judge in a courtroom when presenting some of his ideas for the album, to which Horn would either nod or shake his head. This, according to Oldfield, gave him a kind of a filter, putting in ideas which worked and ejecting ideas which didn't work.


title: Trevor Horn

text: Horn co-wrote "Everybody Up", the theme song to the TV programme "The Glam Metal Detectives", a comedy sketch show which appeared on BBC Two in 1995. This was another collaboration with Lol Creme.


title: Trevor Horn

text: Horn's songwriting can be heard on numerous film soundtracks. In 1992, Horn collaborated with composer Hans Zimmer to produce the score for the film "Toys", which included interpretations by Tori Amos, Pat Metheny and Thomas Dolby.


title: Trevor Horn

text: In the mid-1990s, Horn bought Hook End Manor and renamed its recording facility Sarm Hook End. He put the property on sale in 2007 for £12 million and relocated to Primrose Hill in London.


title: Trevor Horn

text: In 1995, Horn produced "The Carpet Crawlers 1999", a rerecording of "The Carpet Crawlers" by Genesis which featured vocals from their former singers Peter Gabriel and Phil Collins. It was released on their "" (1999) box set.


title: Trevor Horn

text: In the 2000s, Horn provided additional production on three international hits for t.A.T.u., "All the Things She Said", "Not Gonna Get Us", and "Clowns (Can You See Me Now)". He also produced the theme tune to the 2000 film "Coyote Ugly", "Can't Fight the Moonlight", recorded by Leann Rimes, co-wrote "Pass the Flame" (the official torch relay song for the 2004 Olympics in Athens) in collaboration with Lol Creme and co-wrote the title track from Lisa Stansfield's 2004 album "The Moment".


title: Trevor Horn

text: He co-wrote "Sound the Bugle", performed by Bryan Adams and featured on the "Spirit: Stallion of the Cimarron" soundtrack.


title: Trevor Horn

text: and: produced 3 tracks (La Sombra del Gigante, Un Angel No Es and Mujer Amiga Mia) of Stilelibero (Freestyle) Estilolibre by Eros Ramazzotti, released on 29 May 2001.


title: Trevor Horn

text: On 11 November 2004, a Prince's Trust charity concert celebrating Horn's 25 years as a record producer took place at Wembley Arena. Performers at the show included the Buggles, Bruce Woolley, ABC, Art of Noise, Belle & Sebastian, Lisa Stansfield, Pet Shop Boys, Seal, Dollar, Propaganda, t.A.T.u., Yes, Grace Jones and Frankie Goes to Hollywood (with Ryan Molloy replacing original vocalist Holly Johnson). A double album, "Produced by Trevor Horn", was released in conjunction with the concert. An edited version of the concert has been broadcast on television in several countries under the title "25 Years of Pop: Produced by Trevor Horn", and a DVD release of the full concert called "Slaves to the Rhythm" is available.


title: Trevor Horn

text: In 2006, Horn co-formed the supergroup Producers, in which Horn plays with various musicians/producers, namely Lol Creme, producer Steve Lipson, drummer Ash Soan and initially singer/songwriter Chris Braide. The band performed its first gig at the Camden Barfly in November 2006. They continue to perform, now under the name the Trevor Horn Band.


title: Trevor Horn

text: On 22 May 2006, the Pet Shop Boys released their album "Fundamental" which was produced by Horn. The album reached No. 5 in the UK chart. In the same month, he featured in a Pet Shop Boys concert specially recorded for BBC Radio 2. Horn produced an album version of the event, "Concrete", released on 23 October 2006. Horn also produced Captain's debut album, "This is Hazelville", released late 2006. He has also worked with John Legend and David Jordan.


title: Trevor Horn

text: For the 2008 movie "Wanted" (starring James McAvoy and Angelina Jolie), Horn produced Danny Elfman's vocals on the closing credits song "The Little Things".


title: Trevor Horn

text: In 2009, Horn produced the album "Reality Killed the Video Star" for Robbie Williams. Aside from the album title paying homage to Horn's hit single with the Buggles back in 1979, it also reflects Horn and Williams' mutual disdain for the ongoing crop of reality television and music contest programmes in the UK and elsewhere. Ironically, the album was Williams' first studio album not to reach number 1 in the UK, beaten to the top spot by the debut album by JLS, who were runners-up on television's "The X Factor" in 2008.


title: Trevor Horn

text: Horn was also the executive producer of Jeff Beck's album, "Emotion & Commotion", released in early 2010. He returned to work with Yes again, producing their new album from October 2010. That album, 2011's "Fly From Here," is a reunion of sorts for Horn's former bandmate Geoff Downes; not only is Downes a member of the band's current incarnation, but the album also takes its title from a song written by Horn and Downes and performed by Yes during their original stint with the band in 1980.


title: Trevor Horn

text: In 2017, Horn wrote the music for the Stan Lee co-produced anime "The Reflection", the soundtrack being released as the first album under Trevor Horn's name.


title: Trevor Horn

text: In January 2018, Horn played the bass with Dire Straits Legacy for their Brazilian tour. He continued to tour with the band throughout the year.


title: Trevor Horn

text: Horn re-mixed 2011's "Fly From Here" with Yes, adding new vocals and editing parts. The album is called "Fly from Here – Return Trip" and was released in March 2018. He has also been working on musicals, including one called "The Robot Sings".


title: Trevor Horn

text: In November 2018, Horn performed a one-off concert at the Queen Elizabeth Hall in London. Horn's new album, "Trevor Horn Reimagines the Eighties", was released on 25 January 2019. A single, "Everybody Wants to Rule the World", with vocals by Robbie Williams, was released on 24 October 2018. Further guests include Rumer, All Saints, Simple Minds and Gabrielle Aplin.


title: Trevor Horn

text: Horn met his future wife Jill Sinclair, a former mathematics teacher and business partner, in 1977. They married in 1980 and became business partners. They have four children: two sons, Aaron and Will, and two daughters, Gabriella and Alexandra, the latter of whom has worked as a trainee solicitor. Aaron (known in the industry as "Aaron Audio"), like his father, is a musician and producer. He was in the band Sam and the Womp and frequently DJs around London (he lives in north London). Both Aaron and Ally Horn are co-directors of Sarm Studios. , Horn has three grandsons. He is not Jewish, but has attended synagogue with his children, who were raised in his wife's faith. In a 2019 interview, he said that he "believes in [Judaism] more than anything else".


title: Trevor Horn

text: On 25 June 2006, while at home from Goldsmiths College, University of London, Aaron was practising with his air rifle, not realising his mother was close by. A 4.5 mm (.177 calibre) air gun pellet accidentally hit Jill in the neck, severing an artery and causing irreversible brain damage from hypoxia, leaving only her lower brain functions and no chance for recovery. She was taken to the Royal Berkshire Hospital intensive care unit where her condition was described as "critical but stable". Communication from ZTT Records confirmed on 1 September 2006 that Jill was in a natural coma and had been moved to a rehabilitation centre. In September 2009, Horn told "The Times" confirmed that she was still in a coma. In June 2012, Horn told "The Sunday Times" that his wife was not in a coma, but, "She cannot speak, move, or smile. The only expression she can show is of discomfort." Jill Sinclair died of cancer on 22 March 2014, aged 61.


title: Trevor Horn

text: In late 2017, Horn's home and recording studio in the Bel Air neighbourhood of Los Angeles were destroyed by the Skirball Fire. Horn indicated via Twitter that he intended to rebuild at the property.


title: The Maze Runner

text: The Maze Runner is a 2009 young adult dystopian science fiction novel written by American author James Dashner and the first book released in "The Maze Runner" series. The novel was published on October 6, 2009, by Delacorte Press, an imprint of Random House, and was made into a 2014 major motion picture by 20th Century Fox, directed by Wes Ball.


title: The Maze Runner

text: Thomas wakes up in a metal elevator that brings him to the Glade. He has no memory of who he is or how he got there, except for his name. He gradually discovers that the Glade is run by two boys: Alby, the leader, and Newt, the second-in-charge, who both maintain order by enforcing simple but effective rules. The elevator box surfaces from under the ground once every week and supplies new food, tools, medicine, and sometimes weapons. Every month, a new boy with no memory of anything but his first name finds himself in that elevator box.


title: The Maze Runner

text: The Glade is surrounded by a square of four-mile-high walls made of concrete. The walls have openings in them, which slide shut doors every night. Outside the walls is the Maze, a labyrinth of high concrete walls covered in ivy that changes every day. The Maze houses strange, lethal creatures known as Grievers. Not much is known about them. The Gladers are trying to stay alive as well as "solve" the Maze by appointing "runners" to run through it as fast as they can while they track movements of the walls and try to find an exit to escape.


title: The Maze Runner

text: One day after Thomas's arrival, a girl, Teresa, is delivered through the elevator into the Glade. She was the first ever girl to arrive into the Glade. She had a note saying "She's the last one. Ever." The girl later lapses into a long coma. When Thomas comes to visit her, he recognizes her but cannot remember her name until he hears her voice in his mind, telling him her name. Teresa then wakes up and tells Thomas that they knew each other before they were sent into the Glade, revealing their ability to communicate telepathically.


title: The Maze Runner

text: Minho, the Keeper of the Runners, goes into the Maze with Alby to see what they think is their first dead Griever. Alby is stung by the creature, and while Minho is trying to help him out of the Maze, Thomas runs in to help, just as the doors shut. All three are then stranded in the Maze overnight. Minho, believing Alby is as good as dead, tells Thomas to leave him and look for shelter; Thomas, unwilling to abandon Alby, instead climbs the vines on the walls to evade the Grievers, then attracts their attention while staying hidden. Minho uses this tactic to kill the four Grievers by chasing them over the Cliff. Thomas, Alby, and Minho are the first people in the Glade to survive a night in the maze.


title: The Maze Runner

text: After returning to the Glade the next morning, Newt calls a Gathering of the Keepers to discuss what to do with Thomas. Some of the Keepers vote to relieve him of punishment, but others, especially Gally, vote to lock him up in the Slammer, the jail block, as a punishment. Minho, however, nominates Thomas to replace him as the Keeper of The Runners, although he later reveals that he did this to make the idea of naming Thomas a Runner less ambitious. Gally decides to kick Minho off The Council, causing Minho to attack him. Thomas is locked up in jail and becomes a Runner and, the next day, starts his training with Minho.


title: The Maze Runner

text: After their miraculous return, Teresa's arrival triggers a series of changes to life in the Glade. People start acting strangely, the sun disappears, the weekly deliveries of supplies stop coming, and the doors of the Maze stay open at night, which allows the Grievers to enter the Glade and to hunt the teens.


title: The Maze Runner

text: Thomas eventually proposes that the walls of the Maze are not random, but that their movements are actually a code, which leads to the discovery that the Maze is spelling out words. Thomas also discovers that what they previously thought was the Cliff is actually the exit used by the Grievers to leave the Maze ("The Griever Hole"). That drives Thomas to think that they need memories to get out, leading him to intentionally get stung by a Griever so that he can receive the antidote ("Grief Serum") and go through the Changing. It is known that the Changing can trigger memories and sometimes violence.


title: The Maze Runner

text: After Thomas and the Gladers discover the pattern, the Gladers decide to make a run for the exit. They succeed, only to find out that they were test subjects in an experiment conducted by the organization World In Catastrophe: Killzone Experiment Department (WICKED). The teenagers escape to a laboratory but encounter Gally, who did not escape with them. Acting under mind control, he moves to throw a knife at Thomas, but a young Glader, Chuck, jumps in the way and is subsequently killed.


title: The Maze Runner

text: After briefly mourning Chuck's death, all 20 Gladers are rescued and brought to a safe haven. There, they are informed about catastrophic solar flares that caused an apocalyptic event, followed by a virus, the Flare, which killed millions. The rescuers reveal that the Gladers are among the orphaned children being tested to find a cure for the virus.


title: The Maze Runner

text: The epilogue is written in the voice of Chancellor Ava Paige, a feature of all the trilogy's novels. She reveals that the group that rescued the Gladers may just be another variable in the experiment and that the Gladers were not the only group being evaluated. This leads directly into the events of the next book.


title: The Maze Runner

text: In late 2005 mid-June, Dashner had published four books to complete "The Jimmy Fincher Saga", which had been with a small regional publisher. His publisher wanted him to write another book, but he decided he would try for a national book market instead. In November of that year he had an idea when going to be "about a bunch of teenagers living inside an unsolvable Maze full of hideous creatures, in the future, in a dark, dystopian world. It would be an experiment, to study their minds. Terrible things would be done to them – awful things; completely hopeless – until the victims turn everything on its head." The book was later published in 2008. Dashner wrote the book from December 2005 to March 2006.


title: The Maze Runner

text: "Kirkus Reviews" wrote: "Hard to put down, this is clearly just a first installment, and it will leave readers dying to find out what comes next."


title: The Maze Runner

text: Jessica Harrison of the "Deseret Morning News" labeled "The Maze Runner" as "a thrilling adventurous book for kids ages 13+ that will get readers' hearts pumping and leave them asking for more." She noted that it "starts out a bit slow" but as it matched Thomas's confusion and picked up pace as he became more accustomed, she wrote that "it's almost as if Dashner is easing the reader into what becomes a fast-paced, nonstop action." However, she thought the "only drawback" was the "fictionalized slang", saying, "While it feels realistic and fits with his characters, it gets old pretty fast. On the plus side, however, it's used so often that the reader almost becomes desensitized and learns to ignore it."


title: The Maze Runner

text: Fox released a film adaptation of the book, titled "The Maze Runner", on 19 September 2014. Wes Ball signed on as director and T.S. Nowlin wrote the screenplay. Dylan O'Brien played the lead role of Thomas, Thomas Brodie-Sangster portrayed Newt and Kaya Scodelario portrayed Teresa. Ki Hong Lee as Minho, Blake Cooper, Will Poulter and Aml Ameen were added to the cast as Chuck, Gally and Alby, respectively. Patricia Clarkson played the role of the main antagonist Ava Paige. Dexter Darden portrayed Frypan, Alexander Flores portrayed Winston, Jacob Latimore played Jeff, Randal Cunningham portrayed Clint, Chris Sheffield portrayed Ben, and Joe Adler played Zart.


title: The Maze Runner

text: Wayne Haag served as an artist on the film, and Ellen Goldsmith-Vein, Lindsay Williams with Lee Stollman as producers.


title: Magic square

text: In recreational mathematics, a square array of numbers, usually positive integers, is called a magic square if the sums of the numbers in each row, each column, and both main diagonals are the same. The 'order' of the magic square is the number of integers along one side ("n"), and the constant sum is called the 'magic constant'. If the array includes just the positive integers formula_1, the magic square is said to be 'normal'. Some authors take magic square to mean normal magic square.


title: Magic square

text: Magic squares that include repeated entries do not fall under this definition and are referred to as 'trivial'. Some well-known examples, including the Sagrada Família magic square and the Parker square are trivial in this sense. When all the rows and columns but not both diagonals sum to the magic constant this gives a "semimagic square (sometimes called orthomagic square"').


title: Magic square

text: The mathematical study of magic squares typically deals with their construction, classification, and enumeration. Although completely general methods for producing all the magic squares of all orders do not exist, historically three general techniques have been discovered: by bordering method, by making composite magic squares, and by adding two preliminary squares. There are also more specific strategies like the continuous enumeration method that reproduces specific patterns. Magic squares are generally classified according to their order "n" as: odd if "n" is odd, evenly even (also referred to as "doubly even") if "n" is a multiple of 4, oddly even (also known as "singly even") if "n" is any other even number. This classification is based on different techniques required to construct odd, evenly even, and oddly even squares. Beside this, depending on further properties, magic squares are also classified as associative magic squares, pandiagonal magic squares, most-perfect magic squares, and so on. More challengingly, attempts have also been made to classify all the magic squares of a given order as transformations of a smaller set of squares. Except for "n" ≤ 5, the enumeration of higher order magic squares is still an open challenge. The enumeration of most-perfect magic squares of any order was only accomplished in the late 20th century.


title: Magic square

text: Magic squares have a long history, dating back to at least 190 BCE in China. At various times they have acquired occult or mythical significance, and have appeared as symbols in works of art. In modern times they have been generalized a number of ways, including using extra or different constraints, multiplying instead of adding cells, using alternate shapes or more than two dimensions, and replacing numbers with shapes and addition with geometric operations.


title: Magic square

text: The third-order magic square was known to Chinese mathematicians as early as 190 BCE, and explicitly given by the first century of the common era. The first dateable instance of the fourth-order magic square occurred in 587 CE in India. Specimens of magic squares of order 3 to 9 appear in an encyclopedia from Baghdad , the "Encyclopedia of the Brethren of Purity" ("Rasa'il Ikhwan al-Safa"). By the end of 12th century, the general methods for constructing magic squares were well established. Around this time, some of these squares were increasingly used in conjunction with magic letters, as in Shams Al-ma'arif, for occult purposes. In India, all the fourth-order pandiagonal magic squares were enumerated by Narayana in 1356. Magic squares were made known to Europe through translation of Arabic sources as occult objects during the Renaissance, and the general theory had to be re-discovered independent of prior developments in China, India, and Middle East. Also notable are the ancient cultures with a tradition of mathematics and numerology that did not discover the magic squares: Greeks, Babylonians, Egyptians, and Pre-Columbian Americans.


title: Magic square

text: While ancient references to the pattern of even and odd numbers in the 3×3 magic square appears in the "I Ching", the first unequivocal instance of this magic square appears in the chapter called "Mingtang" (Bright Hall) of a 1st-century book "Da Dai Liji" (Record of Rites by the Elder Dai), which purported to describe ancient Chinese rites of the Zhou dynasty.


title: Magic square

text: The above magic squares of orders 3 to 9 are taken from Yang Hui's treatise, in which the Luo Shu principle is clearly evident. The order 5 square is a bordered magic square, with central 3×3 square formed according to Luo Shu principle. The order 9 square is a composite magic square, in which the nine 3×3 sub squares are also magic. After Yang Hui, magic squares frequently occur in Chinese mathematics such as in Ding Yidong's "Dayan suoyin" (), Cheng Dawei's "Suanfa tongzong" (1593), Fang Zhongtong's "Shuduyan" (1661) which contains magic circles, cubes and spheres, Zhang Chao's "Xinzhai zazu" (), who published China's first magic square of order ten, and lastly Bao Qishou's "Binaishanfang ji" (), who gave various three dimensional magic configurations. However, despite being the first to discover the magic squares and getting a head start by several centuries, the Chinese development of the magic squares are much inferior compared to the Indian, Middle Eastern, or European developments. The high point of Chinese mathematics that deals with the magic squares seems to be contained in the work of Yang Hui; but even as a collection of older methods, this work is much more primitive, lacking general methods for constructing magic squares of any order, compared to a similar collection written around the same time by the Byzantine scholar Manuel Moschopoulos. This is possibly because of the Chinese scholars' enthralment with the Lo Shu principle, which they tried to adapt to solve higher squares; and after Yang Hui and the fall of Yuan dynasty, their systematic purging of the foreign influences in Chinese mathematics.


title: Magic square

text: Japan and China have similar mathematical traditions and have repeatedly influenced each other in the history of magic squares. The Japanese interest in magic squares began after the dissemination of Chinese works—Yang Hui's "Suanfa" and Cheng Dawei's "Suanfa tongzong"—in the 17th century, and as a result, almost all the "wasans" devoted their time to its study.


title: Magic square

text: In the 1660 edition of "Ketsugi-sho", Isomura Kittoku gave both odd and even ordered bordered magic squares as well as magic circles; while the 1684 edition of the same book contained a large section on magic squares, demonstrating that he had a general method for constructing bordered magic squares. In "Jinko-ki" (1665) by Muramatsu Kudayu Mosei, both magic squares and magic circles are displayed. The largest square Mosei constructs is of 19th order. Various magic squares and magic circles were also published by Nozawa Teicho in "Dokai-sho" (1666), Sato Seiko in "Kongenki" (1666), and Hosino Sanenobu in "Ko-ko-gen Sho" (1673). One of Seki Takakazu's "Seven Books" ("Hojin Yensan") (1683) is devoted completely to magic squares and circles. This is the first Japanese book to give a general treatment of magic squares in which the algorithms for constructing odd, singly even and doubly even bordered magic squares are clearly described. In 1694 and 1695, Yueki Ando gave different methods to create the magic squares and displayed squares of order 3 to 30. A fourth-order magic cube was constructed by Yoshizane Tanaka (1651–1719) in "Rakusho-kikan" (1683). The study of magic squares was continued by Seki's pupils, notably by Katahiro Takebe, whose squares were displayed in the fourth volume of "Ichigen Kappo" by Shukei Irie, Yoshisuke Matsunaga in "Hojin-Shin-jutsu", Yoshihiro Kurushima in "Kyushi Iko" who rediscovered a method to produce the odd squares given by Agrippa, and Naonobu Ajima. Thus by the beginning of the 18th century, the Japanese mathematicians were in possession of methods to construct magic squares of arbitrary order. After this, attempts at enumerating the magic squares was initiated by Nushizumi Yamaji.


title: Magic square

text: The 3×3 magic square first appears in India in "Gargasamhita" by Garga, who recommends its use to pacify the nine planets ("navagraha"). The oldest version of this text dates from 100 CE, but the passage on planets could not have been written earlier than 400 CE. The first dateable instance of 3×3 magic square in India occur in a medical text "Siddhayog" (c. 900 CE) by Vrnda, which was prescribed to women in labor in order to have easy delivery.


title: Magic square

text: The oldest dateable fourth order magic square in the world is found in an encyclopaedic work written by Varahamihira around 587 CE called "Brhat Samhita". The magic square is constructed for the purpose of making perfumes using 4 substances selected from 16 different substances. Each cell of the square represents a particular ingredient, while the number in the cell represents the proportion of the associated ingredient, such that the mixture of any four combination of ingredients along the columns, rows, diagonals, and so on, gives the total volume of the mixture to be 18. Although the book is mostly about divination, the magic square is given as a matter of combinatorial design, and no magical properties are attributed to it. The special features of this magic square were commented on by Bhattotpala (c. 966 CE)


title: Magic square

text: The square of Varahamihira as given above has sum of 18. Here the numbers 1 to 8 appear twice in the square. It is a pan-diagonal magic square. Four different magic squares can be obtained by adding 8 to one of the two sets of 1 to 8 sequence. The sequence is selected such that the number 8 is added exactly twice in each row, each column and each of the main diagonals. One of the possible magic squares shown in the right side. This magic square is remarkable in that it is a 90 degree rotation of a magic square that appears in the 13th century Islamic world as one of the most popular magic squares.


title: Magic square

text: The construction of 4th-order magic square is detailed in a work titled "Kaksaputa", composed by the alchemist Nagarjuna around 10th century CE. All of the squares given by Nagarjuna are 4×4 magic squares, and one of them is called "Nagarjuniya" after him. Nagarjuna gave a method of constructing 4×4 magic square using a primary skeleton square, given an odd or even magic sum. The Nagarjuniya square is given below, and has the sum total of 100.


title: Magic square

text: The Nagarjuniya square is a pan-diagonal magic square. The Nagarjuniya square is made up of two arithmetic progressions starting from 6 and 16 with eight terms each, with a common difference between successive terms as 4. When these two progressions are reduced to the normal progression of 1 to 8, the adjacent square is obtained.


title: Magic square

text: Around 12th-century, a 4×4 magic square was inscribed on the wall of Parshvanath temple in Khajuraho, India. Several Jain hymns teach how to make magic squares, although they are undateable.


title: Magic square

text: As far as is known, the first systematic study of magic squares in India was conducted by Thakkar Pheru, a Jain scholar, in his "Ganitasara Kaumudi" (c. 1315). This work contains a small section on magic squares which consists of nine verses. Here he gives a square of order four, and alludes to its rearrangement; classifies magic squares into three (odd, evenly even, and oddly even) according to its order; gives a square of order six; and prescribes one method each for constructing even and odd squares. For the even squares, Pheru divides the square into component squares of order four, and puts the numbers into cells according to the pattern of a standard square of order four. For odd squares, Pheru gives the method using horse move or knight's move. Although algorithmically different, it gives the same square as the De la Loubere's method.


title: Magic square

text: The next comprehensive work on magic squares was taken up by Narayana Pandit, who in the fourteenth chapter of his "Ganita Kaumudi" (1356) gives general methods for their construction, along with the principles governing such constructions. It consists of 55 verses for rules and 17 verses for examples. Narayana gives a method to construct all the pan-magic squares of fourth order using knight's move; enumerates the number of pan-diagonal magic squares of order four, 384, including every variation made by rotation and reflection; three general methods for squares having any order and constant sum when a standard square of the same order is known; two methods each for constructing evenly even, oddly even, and of squares when the sum is given. While Narayana describes one older method for each species of square, he claims the method of superposition for evenly even and odd squares and a method of interchange for oddly even squares to be his own invention. The superposition method was later re-discovered by De la Hire in Europe. In the last section, he conceives of other figures, such as circles, rectangles, and hexagons, in which the numbers may be arranged to possess properties similar to those of magic squares. Below are some of the magic squares constructed by Narayana:


title: Magic square

text: The order 8 square is interesting in itself since it is an instance of the most-perfect magic square. Incidentally, Narayana states that the purpose of studying magic squares is to construct "yantra", to destroy the ego of bad mathematicians, and for the pleasure of good mathematicians. The subject of magic squares is referred to as "bhadraganita" and Narayana states that it was first taught to men by god Shiva.


title: Magic square

text: Although the early history of magic squares in Persia and Arabia is not known, it has been suggested that they were known in pre-Islamic times. It is clear, however, that the study of magic squares was common in medieval Islam, and it was thought to have begun after the introduction of chess into the region. The first dateable appearance of a magic square of order 3 occurs in Jābir ibn Hayyān's (fl. c. 721 – c. 815) "Kitab al-mawazin al-Saghir" (The Small Book of Balances) where the magic square and its related numerology is associated with alchemy. While it is known that treatises on magic squares were written in the 9th century, the earliest extant treaties date from the 10th-century: one by Abu'l-Wafa al-Buzjani () and another by Ali b. Ahmad al-Antaki (). These early treatises were purely mathematical, and the Arabic designation for magic squares used is "wafq al-a'dad", which translates as "harmonious disposition of the numbers". By the end of 10th century, the two treatises by Buzjani and Antaki makes it clear that the Middle Eastern mathematicians had understood how to construct bordered squares of any order as well as simple magic squares of small orders ("n" ≤ 6) which were used to make composite magic squares. A specimen of magic squares of orders 3 to 9 devised by Middle Eastern mathematicians appear in an encyclopedia from Baghdad , the Rasa'il Ikhwan al-Safa (the Encyclopedia of the Brethren of Purity). The squares of order 3 to 7 from Rasa'il are given below:


title: Magic square

text: The 11th century saw the finding of several ways to construct simple magic squares for odd and evenly-even orders; the more difficult case of evenly-odd case ("n = 4k + 2") was solved by Ibn al-Haytham with "k" even (c. 1040), and completely by the beginning of 12th century, if not already in the latter half of the 11th century. Around the same time, pandiagonal squares were being constructed. Treaties on magic squares were numerous in the 11th and 12th century. These later developments tended to be improvements on or simplifications of existing methods. From the 13th century on wards, magic squares were increasingly put to occult purposes. However, much of these later texts written for occult purposes merely depict certain magic squares and mention their attributes, without describing their principle of construction, with only some authors keeping the general theory alive. One such occultist was the Algerian Ahmad al-Buni (c. 1225), who gave general methods on constructing bordered magic squares; some others were the 17th century Egyptian Shabramallisi and the 18th century Nigerian al-Kishnawi.


title: Magic square

text: The magic square of order three was described as a child-bearing charm since its first literary appearances in the alchemical works of Jābir ibn Hayyān (fl. c. 721 – c. 815) and al-Ghazālī (1058–1111) and it was preserved in the tradition of the planetary tables. The earliest occurrence of the association of seven magic squares to the virtues of the seven heavenly bodies appear in Andalusian scholar Ibn Zarkali's (known as Azarquiel in Europe) (1029–1087) "Kitāb tadbīrāt al-kawākib" ("Book on the Influences of the Planets"). A century later, the Algerian scholar Ahmad al-Buni attributed mystical properties to magic squares in his highly influential book "Shams al-Ma'arif" ("The Book of the Sun of Gnosis and the Subtleties of Elevated Things"), which also describes their construction. This tradition about a series of magic squares from order three to nine, which are associated with the seven planets, survives in Greek, Arabic, and Latin versions. There are also references to the use of magic squares in astrological calculations, a practice that seems to have originated with the Arabs.


title: Magic square

text: Unlike in Persia and Arabia, better documentation exists of how the magic squares were transmitted to Europe. Around 1315, influenced by Arab sources, the Greek Byzantine scholar Manuel Moschopoulos wrote a mathematical treatise on the subject of magic squares, leaving out the mysticism of his Middle Eastern predecessors, where he gave two methods for odd squares and two methods for evenly even squares. Moschopoulos was essentially unknown to the Latin Europe until the late 17th century, when Philippe de la Hire rediscovered his treatise in the Royal Library of Paris. However, he was not the first European to have written on magic squares; and the magic squares were disseminated to rest of Europe through Spain and Italy as occult objects. The early occult treaties that displayed the squares did not describe how they were constructed. Thus the entire theory had to be rediscovered.


title: Magic square

text: Magic squares had first appeared in Europe in "Kitāb tadbīrāt al-kawākib" ("Book on the Influences of the Planets") written by Ibn Zarkali of Toledo, Al-Andalus, as planetary squares by 11th century. The magic square of three was discussed in numerological manner in early 12th century by Jewish scholar Abraham ibn Ezra of Toledo, which influenced later Kabbalists. Ibn Zarkali's work was translated as "Libro de Astromagia" in the 1280s, due to Alfonso X of Castille. In the Alfonsine text, magic squares of different orders are assigned to the respective planets, as in the Islamic literature; unfortunately, of all the squares discussed, the Mars magic square of order five is the only square exhibited in the manuscript.


title: Magic square

text: Magic squares surface again in Florence, Italy in the 14th century. A 6×6 and a 9×9 square are exhibited in a manuscript of the "Trattato d'Abbaco" (Treatise of the Abacus) by Paolo Dagomari. It is interesting to observe that Paolo Dagomari, like Pacioli after him, refers to the squares as a useful basis for inventing mathematical questions and games, and does not mention any magical use. Incidentally, though, he also refers to them as being respectively the Sun's and the Moon's squares, and mentions that they enter astrological calculations that are not better specified. As said, the same point of view seems to motivate the fellow Florentine Luca Pacioli, who describes 3×3 to 9×9 squares in his work "De Viribus Quantitatis" by the end of 15th century.


title: Magic square

text: The planetary squares had disseminated into northern Europe by the end of 15th century. For instance, the Cracow manuscript of "Picatrix" from Poland displays magic squares of orders 3 to 9. The same set of squares as in the Cracow manuscript later appears in the writings of Paracelsus in "Archidoxa Magica" (1567), although in highly garbled form. In 1514 Albrecht Dürer immortalized a 4×4 square in his famous engraving "Melencolia I." Paracelsus' contemporary Heinrich Cornelius Agrippa von Nettesheim published his famous three volume book "De occulta philosophia" in 1531, where he devoted Chapter 22 of Book II to the planetary squares shown below. The same set of squares given by Agrippa reappear in 1539 in "Practica Arithmetice" by Girolamo Cardano, where he explains the construction of the odd ordered squares using "diamond method", which was later reproduced by Bachet. The tradition of planetary squares was continued into the 17th century by Athanasius Kircher in "Oedipi Aegyptici" (1653). In Germany, mathematical treaties concerning magic squares were written in 1544 by Michael Stifel in" Arithmetica Integra", who rediscovered the bordered squares, and Adam Riese, who rediscovered the continuous numbering method to construct odd ordered squares published by Agrippa. However, due to the religious upheavals of that time, these work were unknown to the rest of Europe.


title: Magic square

text: In 1624 France, Claude Gaspard Bachet described the "diamond method" for constructing Agrippa's odd ordered squares in his book "Problèmes Plaisants". During 1640 Bernard Frenicle de Bessy and Pierre Fermat exchanged letters on magic squares and cubes, and in one of the letters Fermat boasts of being able to construct 1,004,144,995,344 magic squares of order 8 by his method. An early account on the construction of bordered squares was given by Antoine Arnauld in his "Nouveaux éléments de géométrie" (1667). In the two treatise "Des quarrez ou tables magiques" and "Table générale des quarrez magiques de quatre de côté", published posthumously in 1693, twenty years after his death, Bernard Frenicle de Bessy demonstrated that there were exactly 880 distinct magic squares of order four. Frenicle gave methods to construct magic square of any odd and even order, where the even ordered squares were constructed using borders. He also showed that interchanging rows and columns of a magic square produced new magic squares. In 1691, Simon de la Loubère described the Indian continuous method of constructing odd ordered magic squares in his book "Du Royaume de Siam", which he had learned while returning from a diplomatic mission to Siam, which was faster than Bachet's method. In an attempt to explain its working, de la Loubere used the primary numbers and root numbers, and rediscovered the method of adding two preliminary squares. This method was further investigated by Abbe Poignard in "Traité des quarrés sublimes" (1704), by Philippe de La Hire in "Mémoires de l'Académie des Sciences" for the Royal Academy (1705), and by Joseph Sauveur in "Construction des quarrés magiques" (1710). Concentric bordered squares were also studied by De la Hire in 1705, while Sauveur introduced magic cubes and lettered squares, which was taken up later by Euler in 1776, who is often credited for devising them. In 1750 d'Ons-le-Bray rediscovered the method of constructing doubly even and singly even squares using bordering technique; while in 1767 Benjamin Franklin published a semi-magic square that had the properties of eponymous Franklin square. By this time the earlier mysticism attached to the magic squares had completely vanished, and the subject was treated as a part of recreational mathematics.


title: Magic square

text: In the 19th century, Bernard Violle gave a comprehensive treatment of magic squares in his three volume "Traité complet des carrés magiques" (1837–1838), which also described magic cubes, parallelograms, parallelopipeds, and circles. Pandiagonal squares were extensively studied by Andrew Hollingworth Frost, who learned it while in the town of Nasik, India, (thus calling them Nasik squares) in a series of articles: "On the knight's path" (1877), "On the General Properties of Nasik Squares" (1878), "On the General Properties of Nasik Cubes" (1878), "On the construction of Nasik Squares of any order" (1896). He showed that it is impossible to have normal singly-even pandiagonal magic squares. Frederick A.P. Barnard constructed inlaid magic squares and other three dimensional magic figures like magic spheres and magic cylinders in "Theory of magic squares and of magic cubes" (1888). In 1897, Emroy McClintock published "On the most perfect form of magic squares", coining the words "pandiagonal square" and "most perfect square", which had previously been referred to as perfect, or diabolic, or Nasik.


title: Magic square

text: Legends dating from as early as 650 BCE tell the story of the Lo Shu (洛書) or "scroll of the river Lo". According to the legend, there was at one time in ancient China a huge flood. While the great king Yu was trying to channel the water out to sea, a turtle emerged from it with a curious pattern on its shell: a 3×3 grid in which circular dots of numbers were arranged, such that the sum of the numbers in each row, column and diagonal was the same: 15. According to the legend, thereafter people were able to use this pattern in a certain way to control the river and protect themselves from floods. The Lo Shu Square, as the magic square on the turtle shell is called, is the unique normal magic square of order three in which 1 is at the bottom and 2 is in the upper right corner. Every normal magic square of order three is obtained from the Lo Shu by rotation or reflection.


title: Magic square

text: There is a well-known 12th-century 4×4 normal magic square inscribed on the wall of the Parshvanath temple in Khajuraho, India.


title: Magic square

text: This is known as the "Chautisa Yantra" ("Chautisa", 34; "Yantra", lit. "device"), since its magic sum is 34. It is one of the three 4×4 pandiagonal magic squares and is also an instance of the most-perfect magic square. The study of this square led to the appreciation of pandiagonal squares by European mathematicians in the late 19th century. Pandiagonal squares were referred to as Nasik squares or Jain squares in older English literature.


title: Magic square

text: The order four normal magic square Albrecht Dürer immortalized in his 1514 engraving "Melencolia I", referred to above, is believed to be the first seen in European art. The square associated with Jupiter appears as a talisman used to drive away melancholy. It is very similar to Yang Hui's square, which was created in China about 250 years before Dürer's time. As with every order 4 normal magic square, the magic sum is 34. But in the Durer square this sum is also found


title: Magic square

text: in each of the quadrants, in the center four squares, and in the corner squares (of the 4×4 as well as the four contained 3×3 grids). This sum can also be found in the four outer numbers clockwise from the corners (3+8+14+9) and likewise the four counter-clockwise (the locations of four queens in the two solutions of the 4 queens puzzle), the two sets of four symmetrical numbers (2+8+9+15 and 3+5+12+14), the sum of the middle two entries of the two outer columns and rows (5+9+8+12 and 3+2+15+14), and in four kite or cross shaped quartets (3+5+11+15, 2+10+8+14, 3+9+7+15, and 2+6+12+14). The two numbers in the middle of the bottom row give the date of the engraving: 1514. The numbers 1 and 4 at either side of the date correspond respectively to the letters "A" and "D," which are the initials of the artist.


title: Magic square

text: The Passion façade of the Sagrada Família church in Barcelona, conceptualized by Antoni Gaudí and designed by sculptor Josep Subirachs, features a trivial order 4 magic square: The magic constant of the square is 33, the age of Jesus at the time of the Passion. Structurally, it is very similar to the Melancholia magic square, but it has had the numbers in four of the cells reduced by 1.


title: Magic square

text: Trivial squares such as this one are not generally mathematically interesting and only have historical significance. Lee Sallows has pointed out that, due to Subirachs's ignorance of magic square theory, the renowned sculptor made a needless blunder, and supports this assertion by giving several examples of non-trivial 4×4 magic squares showing the desired magic constant of 33.


title: Magic square

text: Similarly to Dürer's magic square, the Sagrada Familia's magic square can also be extended to a magic cube.


title: Magic square

text: The Parker Square, named after recreational mathematician Matt Parker, is an attempt to create a 33 magic square of squares — a prized unsolved problem since Euler. The Parker Square is a trivial semimagic square since it uses some numbers more than once, and the diagonal sums to , not as for all the other rows, columns, or diagonal. The Parker Square became a "mascot for people who give it a go, but ultimately fall short". It is also a metaphor for something that is almost right, but is a little off.


title: Magic square

text: The Gardner Square, named after recreational mathematician Martin Gardner, similar to the Parker square,


title: Magic square

text: This solution for a=74, b=113, c=94 and d=97 gives a semimagic square; the diagonal sums to , not as for all the other rows, columns and diagonal;


title: Magic square

text: The constant that is the sum of any row, or column, or diagonal is called the magic constant or magic sum, "M." Every normal magic square has a constant dependent on the order , calculated by the formula formula_2. This can be demonstrated by noting that the sum of formula_1 is formula_4. Since the sum of each row is formula_5, the sum of formula_6 rows is formula_7, which when divided by the order yields the magic constant. For normal magic squares of orders "n" = 3, 4, 5, 6, 7, and 8, the magic constants are, respectively: 15, 34, 65, 111, 175, and 260 (sequence in the OEIS).


title: Magic square

text: The 1×1 magic square, with only one cell containing the number 1, is called "trivial", because it is typically not under consideration when discussing magic squares; but it is indeed a magic square by definition, if a single cell is regarded as a square of order one.


title: Magic square

text: If the numbers in the magic square are seen as masses located in various cells, then the center of mass of a magic square coincides with its geometric center.


title: Magic square

text: The "moment of inertia" of a magic square has been defined as the sum over all cells of the number in the cell times the squared distance from the center of the cell to the center of the square; here the unit of measurement is the width of one cell. (Thus for example a corner cell of a 3×3 square has a distance of formula_8 a non-corner edge cell has a distance of 1, and the center cell has a distance of 0.) Then all magic squares of a given order have the same moment of inertia as each other. For the order-3 case the moment of inertia is always 60, while for the order-4 case the moment of inertia is always 340. In general, for the "n"×"n" case the moment of inertia is formula_9


title: Magic square

text: Dividing each number of the magic square by the magic constant will yield a doubly stochastic matrix, whose row sums and column sums equal to unity. However, unlike the doubly stochastic matrix, the diagonal sums of such matrices will also equal to unity. Thus, such matrices constitute a subset of doubly stochastic matrix. The Birkhoff–von Neumann theorem states that for any doubly stochastic matrix formula_10, there exists real numbers formula_11, where formula_12 and permutation matrices formula_13 such that


title: Magic square

text: This representation may not be unique in general. By Marcus-Ree theorem, however, there need not be more than formula_15 terms in any decomposition. Clearly, this decomposition carries over to magic squares as well, since a magic square can be recovered from a doubly stochastic matrix by multiplying it by the magic constant.


title: Magic square

text: While the classification of magic squares can be done in many ways, some useful categories are given below. An "n"×"n" square array of integers 1, 2, ..., "n" is called:


title: Magic square

text: There is only one (trivial) magic square of order 1 and no magic square of order 2. As mentioned above, the set of normal squares of order three constitutes a single equivalence class-all equivalent to the Lo Shu square. Thus there is basically just one normal magic square of order 3.


title: Magic square

text: Cross-referenced to the above sequence, a new classification enumerates the magic tori that display these magic squares. The number of magic tori of order "n" from 1 to 5, is:


title: Magic square

text: The 880 magic squares of order 4 are displayed on 255 magic tori of order 4 and the 275,305,224 squares of order 5 are displayed on 251,449,712 magic tori of order 5. The number of magic tori and distinct normal squares is not yet known for any higher order.


title: Magic square

text: Algorithms tend to only generate magic squares of a certain type or classification, making counting all possible magic squares quite difficult. Since traditional counting methods have proven unsuccessful, statistical analysis using the Monte Carlo method has been applied. The basic principle applied to magic squares is to randomly generate "n" × "n" matrices of elements 1 to "n" and check if the result is a magic square. The probability that a randomly generated matrix of numbers is a magic square is then used to approximate the number of magic squares.


title: Magic square

text: More intricate versions of the Monte Carlo method, such as the exchange Monte Carlo, and Monte Carlo backtracking have produced even more accurate estimations. Using these methods it has been shown that the probability of magic squares decreases rapidly as n increases. Using fitting functions give the curves seen to the right.


title: Magic square

text: Over the millennium, many ways to construct magic squares have been discovered. These methods can be classified as general methods and special methods, in the sense that general methods allow us to construct more than a single magic square of a given order, whereas special methods allow us to construct just one magic square of a given order. Special methods are specific algorithms whereas general methods may require some trial-and-error.


title: Magic square

text: Special methods are standard and most simple ways to construct a magic square. It follows certain configurations / formulas / algorithm which generates regular patterns of numbers in a square. The correctness of these special methods can be proved using one of the general methods given in later sections. After a magic square has been constructed using a special method, the transformations described in the previous section can be applied to yield further magic squares. Special methods are usually referred to using the name of the author(s) (if known) who described the method, for e.g. De la Loubere's method, Starchey's method, Bachet's method, etc.


title: Magic square

text: Magic squares exist for all values of "n", except for order 2. Magic squares can be classified according to their order as odd, doubly even ("n" divisible by four), and singly even ("n" even, but not divisible by four). This classification is based on the fact that entirely different techniques need to be employed to construct these different species of squares. Odd and doubly even magic squares are easy to generate; the construction of singly even magic squares is more difficult but several methods exist, including the LUX method for magic squares (due to John Horton Conway) and the Strachey method for magic squares.


title: Magic square

text: In the 19th century, Édouard Lucas devised the general formula for order 3 magic squares. Consider the following table made up of positive integers "a", "b" and "c":


title: Magic square

text: These nine numbers will be distinct positive integers forming a magic square with the magic constant 3"c" so long as 0 < "a" < "b" < "c" − "a" and "b" ≠ 2"a". Moreover, every 3×3 magic square of distinct positive integers is of this form.


title: Magic square

text: In 1997 Lee Sallows discovered that leaving aside rotations and reflections, then every distinct parallelogram drawn on the Argand diagram defines a unique 3×3 magic square, and vice versa, a result that had never previously been noted.


title: Magic square

text: A method for constructing magic squares of odd order was published by the French diplomat de la Loubère in his book, "A new historical relation of the kingdom of Siam" (Du Royaume de Siam, 1693), in the chapter entitled "The problem of the magical square according to the Indians". The method operates as follows:


title: Magic square

text: The method prescribes starting in the central column of the first row with the number 1. After that, the fundamental movement for filling the squares is diagonally up and right, one step at a time. If a square is filled with a multiple of the order "n", one moves vertically down one square instead, then continues as before. When an "up and to the right" move would leave the square, it is wrapped around to the last row or first column, respectively.


title: Magic square

text: Starting from other squares rather than the central column of the first row is possible, but then only the row and column sums will be identical and result in a magic sum, whereas the diagonal sums will differ. The result will thus be a semimagic square and not a true magic square. Moving in directions other than north east can also result in magic squares.


title: Magic square

text: Doubly even means that "n" is an even multiple of an even integer; or 4"p" (e.g. 4, 8, 12), where "p" is an integer.


title: Magic square

text: All the numbers are written in order from left to right across each row in turn, starting from the top left hand corner. Numbers are then either retained in the same place or interchanged with their diametrically opposite numbers in a certain regular pattern. In the magic square of order four, the numbers in the four central squares and one square at each corner are retained in the same place and the others are interchanged with their diametrically opposite numbers.


title: Magic square

text: Starting from top left, go left to right through each row of the square, counting each cell from 1 to 16 and filling the cells along the diagonals with its corresponding number. Once the bottom right cell is reached, continue by going right to left, starting from the bottom right of the table through each row, and fill in the non-diagonal cells counting up from 1 to 16 with its corresponding number. As shown below:


title: Magic square

text: First generate a pattern table, where a '1' indicates selecting from the square where the numbers are written in order 1 to n (left-to-right, top-to-bottom), and a '0' indicates selecting from the square where the numbers are written in reverse order "n" to 1. For "M" = 4, the pattern table is as shown below (third matrix from left). Whith the unaltered cells (cells with '1') shaded, a criss-cross pattern is obtained.


title: Magic square

text: The patterns are a) there are equal number of '1's and '0's in each row and column; b) each row and each column are "palindromic"; c) the left- and right-halves are mirror images; and d) the top- and bottom-halves are mirror images (c and d imply b). The pattern table can be denoted using hexadecimals as (9, 6, 6, 9) for simplicity (1-nibble per row, 4 rows). The simplest method of generating the required pattern for higher ordered doubly even squares is to copy the generic pattern for the fourth-order square in each four-by-four sub-squares.


title: Magic square

text: For M = 8, possible choices for the pattern are (99, 66, 66, 99, 99, 66, 66, 99); (3C, 3C, C3, C3, C3, C3, 3C, 3C); (A5, 5A, A5, 5A, 5A, A5, 5A, A5) (2-nibbles per row, 8 rows).


title: Magic square

text: For M = 12, the pattern table (E07, E07, E07, 1F8, 1F8, 1F8, 1F8, 1F8, 1F8, E07, E07, E07) yields a magic square (3-nibbles per row, 12 rows.) It is possible to count the number of choices one has based on the pattern table, taking rotational symmetries into account.


title: Magic square

text: The earliest discovery of the superposition method was made by the Indian mathematician Narayana in the 14th century. The same method was later re-discovered and studied in early 18th century Europe by de la Loubere, Poignard, de La Hire, and Sauveur; and the method is usually referred to as de la Hire's method. Although Euler's work on magic square was unoriginal, he famously conjectured the impossibility of constructing the evenly odd ordered mutually orthogonal Graeco-Latin squares. This conjecture was disproved in the mid 20th century. For clarity of exposition, two important variations of this method can be tinguished.


title: Magic square

text: This method consists in constructing two preliminary squares, which when added together gives the magic square. As a running example, a 3×3 magic square is considered. Each number of the 3×3 natural square by a pair of numbers can be labeled as


title: Magic square

text: where every pair of Greek and Latin alphabets, e.g. "αa", are meant to be added together, i.e. "αa" = "α" + "a". Here, ("α", "β", "γ") = (0, 3, 6) and ("a", "b", "c") = (1, 2, 3). The numbers 0, 3, and 6 are referred to as the "root numbers" while the numbers 1, 2, and 3 are referred to as the "primary numbers". An important general constraint here is


title: Magic square

text: The lettered squares are referred to as "Greek square" or "Latin square" if they are filled with Greek or Latin letters, respectively. A magic square can be constructed by ensuring that the Greek and Latin squares are magic squares too. The converse of this statement is also often, but not always (e.g. bordered magic squares), true: A magic square can be decomposed into a Greek and a Latin square, which are themselves magic squares. Thus the method is useful for both synthesis as well as analysis of a magic square. Lastly, by examining the pattern in which the numbers are laid out in the finished square, it is often possible to come up with a faster algorithm to construct higher order squares that replicate the given pattern, without the necessity of creating the preliminary Greek and Latin squares.


title: Magic square

text: During the construction of the 3×3 magic square, the Greek and Latin squares with just three unique terms are much easier to deal with than the original square with nine different terms. The row sum and the column sum of the Greek square will be the same, "α" + "β" + "γ", if


title: Magic square

text: This can be achieved by cyclic permutation of "α", "β", and "γ". Satisfaction of these two conditions ensures that the resulting square is a semi-magic square; and such Greek and Latin squares are said to be "mutually orthogonal" to each other. For a given order "n", there are at most "n" - 1 squares in a set of mutually orthogonal squares, not counting the variations due to permutation of the symbols. This upper bound is exact when "n" is a prime number.


title: Magic square

text: In order to construct a magic square, we should also ensure that the diagonals sum to magic constant. For this, we have a third condition:


title: Magic square

text: The mutually orthogonal Greek and Latin squares that satisfy the first part of the third condition (that all letters appear in both the diagonals) are said to be "mutually orthogonal doubly diagonal Graeco-Latin squares".


title: Magic square

text: Odd squares: For the 3×3 odd square, since "α", "β", and "γ" are in arithmetic progression, their sum is equal to the product of the square's order and the middle term, i.e. "α" + "β" + "γ" = 3 "β". Thus, the diagonal sums will be equal if we have "β"s in the main diagonal and "α", "β", "γ" in the skew diagonal. Similarly, for the Latin square. The resulting Greek and Latin squares and their combination will be as below. The Latin square is just a 90 degree anti-clockwise rotation of the Greek square (or equivalently, flipping about the vertical axis) with the corresponding letters interchanged. Substituting the values of the Greek and Latin letters will give the 3×3 magic square.


title: Magic square

text: For the odd squares, this method explains why the Siamese method (method of De la Loubere) and its variants work. This basic method can be used to construct odd ordered magic squares of higher orders. To summarise:


title: Magic square

text: A peculiarity of the construction method given above for the odd magic squares is that the middle number ("n" + 1)/2 will always appear at the center cell of the magic square. Since there are ("n" - 1)! ways to arrange the skew diagonal terms, we can obtain ("n" - 1)! Greek squares this way; same with the Latin squares. Also, since each Greek square can be paired with ("n" - 1)! Latin squares, and since for each of Greek square the middle term may be arbitrarily placed in the main diagonal or the skew diagonal (and correspondingly along the skew diagonal or the main diagonal for the Latin squares), we can construct a total of 2 × ("n" - 1)! × ("n" - 1)! magic squares using this method. For "n" = 3, 5, and 7, this will give 8, 1152, and 1,036,800 different magic squares, respectively. Dividing by 8 to neglect equivalent squares due to rotation and reflections, we obtain 1, 144, and 129,600 essentially different magic squares, respectively.


title: Magic square

text: As another example, the construction of 5×5 magic square is given. Numbers are directly written in place of alphabets. The numbered squares are referred to as "primary square" or "root square" if they are filled with primary numbers or root numbers, respectively. The numbers are placed about the skew diagonal in the root square such that the middle column of the resulting root square has 0, 5, 10, 15, 20 (from bottom to top). The primary square is obtained by rotating the root square counter-clockwise by 90 degrees, and replacing the numbers. The resulting square is an associative magic square, in which every pair of numbers symmetrically opposite to the center sum up to the same value, 26. For e.g., 16+10, 3+23, 6+20, etc. In the finished square, 1 is placed at center cell of bottom row, and successive numbers are placed via elongated knight's move (two cells right, two cells down), or equivalently, bishop's move (two cells diagonally down right). When a collision occurs, the break move is to move one cell up. All the odd numbers occur inside the central diamond formed by 1, 5, 25 and 21, while the even numbers are placed at the corners. The occurrence of the even numbers can be deduced by copying the square to the adjacent sides. The even numbers from four adjacent squares will form a cross.


title: Magic square

text: A variation of the above example, where the skew diagonal sequence is taken in different order, is given below. The resulting magic square is the flipped version of the famous Agrippa's Mars magic square. It is an associative magic square and is the same as that produced by Moschopoulos's method. Here the resulting square starts with 1 placed in the cell which is to the right of the centre cell, and proceeds as De la Loubere's method, with downwards-right move. When a collision occurs, the break move is to shift two cells to the right.


title: Magic square

text: In the previous examples, for the Greek square, the second row can be obtained from the first row by circularly shifting it to the right by one cell. Similarly, the third row is a circularly shifted version of the second row by one cell to the right; and so on. Likewise, the rows of the Latin square is circularly shifted to the left by one cell. The row shifts for the Greek and Latin squares are in mutually opposite direction. It is possible to circularly shift the rows by more than one cell to create the Greek and Latin square.


title: Magic square

text: This essentially re-creates the knight's move. All the letters will appear in both the diagonals, ensuring correct diagonal sum. Since there are "n"! permutations of the Greek letters by which we can create the first row of the Greek square, there are thus "n"! Greek squares that can be created by shifting the first row in one direction. Likewise, there are "n"! such Latin squares created by shifting the first row in the opposite direction. Since a Greek square can be combined with any Latin square with opposite row shifts, there are "n"! × "n"! such combinations. Lastly, since the Greek square can be created by shifting the rows either to the left or to the right, there are a total of 2 × "n"! × "n"! magic squares that can be formed by this method. For "n" = 5 and 7, since they are prime numbers, this method creates 28,800 and 50,803,200 pandiagonal magic squares. Dividing by 8 to neglect equivalent squares due to rotation and reflections, we obtain 3,600 and 6,350,400 equivalent squares. Further dividing by "n" to neglect equivalent panmagic squares due to cyclic shifting of rows or columns, we obtain 144 and 129,600 essentially different panmagic squares. For order 5 squares, these are the only panmagic square there are. The condition that the square's order not be divisible by 3 means that we cannot construct squares of orders 9, 15, 21, 27, and so on, by this method.


title: Magic square

text: In the example below, the square has been constructed such that 1 is at the center cell. In the finished square, the numbers can be continuously enumerated by the knight's move (two cells up, one cell right). When collision occurs, the break move is to move one cell up, one cell left. The resulting square is a pandiagonal magic square. This square also has a further diabolical property that any five cells in quincunx pattern formed by any odd sub-square, including wrap around, sum to the magic constant, 65. For e.g., 13+7+1+20+24, 23+1+9+15+17, 13+21+10+19+2 etc. Also the four corners of any 5×5 square and the central cell, as well as the middle cells of each side together with the central cell, including wrap around, give the magic sum: 13+10+19+22+1 and 20+24+12+8+1. Lastly the four rhomboids that form elongated crosses also give the magic sum: 23+1+9+24+8, 15+1+17+20+12, 14+1+18+13+19, 7+1+25+22+10.


title: Magic square

text: We can also combine the Greek and Latin squares constructed by different methods. In the example below, the primary square is made using knight's move. We have re-created the magic square obtained by De la Loubere's method. As before, we can form 8 × ("n" - 1)! × "n"! magic squares by this combination. For "n" = 5 and 7, this will create 23,040 and 29,030,400 magic squares. After dividing by 8 in order to neglect equivalent squares due to rotation and reflection, we get 2,880 and 3,628,800 squares.


title: Magic square

text: For order 5 squares, these three methods give a complete census of the number of magic squares that can be constructed by the method of superposition. Neglecting the rotation and reflections, the total number of magic squares of order 5 produced by the superposition method is 144 + 3,600 + 2,880 = 6,624.


title: Magic square

text: Even squares: We can also construct even ordered squares in this fashion. Since there is no middle term among the Greek and Latin alphabets for even ordered squares, in addition to the first two constraint, for the diagonal sums to yield the magic constant, all the letters in the alphabet should appear in the main diagonal and in the skew diagonal.


title: Magic square

text: An example of a 4×4 square is given below. For the given diagonal and skew diagonal in the Greek square, the rest of the cells can be filled using the condition that each letter appear only once in a row and a column.


title: Magic square

text: Using these two Graeco-Latin squares, we can construct 2 × 4! × 4! = 1,152 magic squares. Dividing by 8 to eliminate equivalent squares due to rotation and reflections, we get 144 essentially different magic squares of order 4. These are the only magic squares constructible by the Euler method, since there are only two mutually orthogonal doubly diagonal Graeco-Latin squares of order 4.


title: Magic square

text: Similarly, an 8×8 magic square can be constructed as below. Here the order of appearance of the numbers is not important; however the quadrants imitate the layout pattern of the 4×4 Graeco-Latin squares.


title: Magic square

text: Euler's method has given rise to the study of Graeco-Latin squares. Euler's method for constructing magic squares is valid for any order except 2 and 6.


title: Magic square

text: Variations: Magic squares constructed from mutually orthogonal doubly diagonal Graeco-Latin squares are interesting in themselves since the magic property emerges from the relative position of the alphabets in the square, and not due to any arithmetic property of the value assigned to them. This means that we can assign any value to the alphabets of such squares and still obtain a magic square. This is the basis for constructing squares that display some information (e.g. birthdays, years, etc.) in the square and for creating "reversible squares". For example, we can display the number "π" ≈ at the bottom row of a 4×4 magic square using the Graeco-Latin square given above by assigning ("α", "β", "γ", "δ") = (10, 0, 90, 15) and ("a", "b", "c", "d") = (0, 2, 3, 4). We will obtain the following non-normal magic square with the magic sum 124:


title: Magic square

text: Narayana-De la Hire's method for odd square is the same as that of Euler's. However, for even squares, we drop the second requirement that each Greek and Latin letter appear only once in a given row or column. This allows us to take advantage of the fact that the sum of an arithmetic progression with an even number of terms is equal to the sum of two opposite symmetric terms multiplied by half the total number of terms. Thus, when constructing the Greek or Latin squares,


title: Magic square

text: As a running example, if we take a 4×4 square, where the Greek and Latin terms have the values ("α", "β", "γ", "δ") = (0, 4, 8, 12) and ("a", "b", "c", "d") = (1, 2, 3, 4), respectively, then we have "α" + "β" + "γ" + "δ" = 2 ("α" + "δ") = 2 ("β" + "γ"). Similarly, "a" + "b" + "c" + "d" = 2 ("a" + "d") = 2 ("b" + "c"). This means that the complementary pair "α" and "δ" (or "β" and "γ") can appear twice in a column (or a row) and still give the desired magic sum. Thus, we can construct:


title: Magic square

text: In the example given below, the main diagonal (from top left to bottom right) is filled with sequence ordered as "α", "β", "γ", "δ", while the skew diagonal (from bottom left to top right) filled in the same order. The remaining cells are then filled column wise such that the complementary letters appears only once within a row, but twice within a column. In the first column, since "α" appears on the 1st and 4th row, the remaining cells are filled with its complementary term "δ". Similarly, the empty cells in the 2nd column are filled with "γ"; in 3rd column "β"; and 4th column "α". Each Greek letter appears only once along the rows, but twice along the columns. As such, the row sums are "α" + "β" + "γ" + "δ" while the column sums are either 2 ("α" + "δ") or 2 ("β" + "γ"). Likewise for the Latin square, which is obtained by flipping the Greek square along the main diagonal and interchanging the corresponding letters.


title: Magic square

text: The above example explains why the "criss-cross" method for doubly even magic square works. Another possible 4×4 magic square, which is also pan-diagonal as well as most-perfect, is constructed below using the same rule. However, the diagonal sequence is chosen such that all four letters "α", "β", "γ", "δ" appear inside the central 2×2 sub-square. Remaining cells are filled column wise such that each letter appears only once within a row. In the 1st column, the empty cells need to be filled with one of the letters selected from the complementary pair "α" and "δ". Given the 1st column, the entry in the 2nd row can only be "δ" since "α" is already there in the 2nd row; while, in the 3rd row the entry can only be "α" since "δ" is already present in the 3rd row. We proceed similarly until all cells are filled. The Latin square given below has been obtained by flipping the Greek square along the main diagonal and replacing the Greek alphabets with corresponding Latin alphabets.


title: Magic square

text: We can use this approach to construct singly even magic squares as well. However, we have to be more careful in this case since the criteria of pairing the Greek and Latin alphabets uniquely is not automatically satisfied. Violation of this condition leads to some missing numbers in the final square, while duplicating others. Thus, here is an important proviso:


title: Magic square

text: Below is a construction of a 6×6 magic square, where the numbers are directly given, rather than the alphabets. The second square is constructed by flipping the first square along the main diagonal. Here in the first column of the root square the 3rd cell is paired with its complement in the 4th cells. Thus, in the primary square, the numbers in the 1st and 6th cell of the 3rd row are same. Likewise, with other columns and rows. In this example the flipped version of the root square satisfies this proviso.


title: Magic square

text: As another example of a 6×6 magic square constructed this way is given below. Here the diagonal entries are arranged differently. The primary square is constructed by flipping the root square about the main diagonal. In the second square the proviso for singly even square is not satisfied, leading to a non-normal magic square (third square) where the numbers 3, 13, 24, and 34 are duplicated while missing the numbers 4, 18, 19, and 33.


title: Magic square

text: The last condition is a bit arbitrary and may not always need to be invoked, as in this example, where in the root square each cell is vertically paired with its complement:


title: Magic square

text: As one more example, we have generated an 8×8 magic square. Unlike the criss-cross pattern of the earlier section for evenly even square, here we have a checkered pattern for the altered and unaltered cells. Also, in each quadrant the odd and even numbers appear in alternating columns.


title: Magic square

text: Variations: A number of variations of the basic idea are possible: "a complementary pair can appear "n"/2 times or less in a column". That is, a column of a Greek square can be constructed using more than one complementary pair. This method allows us to imbue the magic square with far richer properties. The idea can also be extended to the diagonals too. An example of an 8×8 magic square is given below. In the finished square each of four quadrants are pan-magic squares as well, each quadrant with same magic constant 130.


title: Magic square

text: In this method, the objective is to wrap a border around a smaller magic square which serves as a core. Consider the 3×3 square for example. Subtracting the middle number 5 from each number 1, 2, ..., 9, we obtain 0, ± 1, ± 2, ± 3, and ± 4, which we will, for lack of better words, following S. Harry White, refer to as bone numbers. The magic constant of a magic square, which we will refer to as the skeleton square, made by these bone numbers will be zero since adding all the rows of a magic square will give "nM" = Σ "k" = 0; thus "M" = 0.


title: Magic square

text: It is not difficult to argue that the middle number should be placed at the center cell: let "x" be the number placed in the middle cell, then the sum of the middle column, middle row, and the two diagonals give Σ "k" + 3 "x" = 4 "M". Since Σ "k" = 3 "M", we have "x" = "M" / 3. Here "M" = 0, so "x" = 0.


title: Magic square

text: Putting the middle number 0 in the center cell, we want to construct a border such that the resulting square is magic. Let the border be given by:


title: Magic square

text: Now, if we have chosen "a", "b", "u", and "v", then we have "a*" = - "a", "b*" = - "b", "u*" = - "u", and "v*" = - "v". This means that if we assign a given number to a variable, say "a" = 1, then its complement will be assigned to "a*", i.e. "a*" = - 1. Thus out of eight unknown variables, it is sufficient to specify the value of only four variables. We will consider "a", "b", "u", and "v" as independent variables, while "a*", "b*", "u*", and "v*" as dependent variables. This allows us to consider a bone number ± x as a single number regardless of sign because (1) its assignment to a given variable, say "a", will automatically imply that the same number of opposite sign will be shared with its complement "a*", and (2) two independent variables, say "a" and "b", cannot be assigned the same bone number. But how should we choose "a", "b", "u", and "v"? We have the sum of the top row and the sum of the right column as


title: Magic square

text: Since 0 is an even number, there are only two ways that the sum of three integers will yield an even number: 1) if all three were even, or 2) if two were odd and one was even. Since in our choice of numbers we only have two even non-zero number (± 2 and ± 4), the first statement is false. Hence, it must be the case that the second statement is true: that two of the numbers are odd and one even.


title: Magic square

text: The only way that both the above two equations can satisfy this parity condition simultaneously, and still be consistent with the set of numbers we have, is when "u" and "v" are odd. For on the contrary, if we had assumed "u" and "a" to be odd and "v" to be even in the first equation, then "u*" = - "u" will be odd in the second equation, making "b" odd as well, in order to satisfy the parity condition. But this requires three odd numbers ("u", "a", and "b"), contradicting the fact that we only have two odd numbers (± 1 and ± 3) which we can use. This proves that the odd bone numbers occupy the corners cells. When converted to normal numbers by adding 5, this implies that the corners of a 3×3 magic square are all occupied by even numbers.


title: Magic square

text: Thus, taking "u" = 1 and "v" = 3, we have "a" = - 4 and "b" = - 2. Hence, the finished skeleton square will be as in the left. Adding 5 to each number, we get the finished magic square.


title: Magic square

text: Similar argument can be used to construct larger squares. Since there does not exist a 2×2 magic square around which we can wrap a border to construct a 4×4 magic square, the next smallest order for which we can construct bordered square is the order 5.


title: Magic square

text: Consider the fifth-order square. For this, we have a 3×3 magic core, around which we will wrap a magic border. The bone numbers to be used will be ± 5, ± 6, ± 7, ± 8, ± 9, ± 10, ± 11, and ± 12. Disregarding the signs, we have 8 bone numbers, 4 of which are even and 4 of which are odd. In general, for a square of any order "n", there will be 4("n" - 1) border cells, which are to be filled using 2("n" - 1) bone numbers. Let the magic border be given as


title: Magic square

text: It is sufficient to determine the numbers "u, v, a, b, c, d, e, f" to describe the magic border. As before, we have the two constraint equations for the top row and right column:


title: Magic square

text: There are 28 ways of choosing two numbers from the set of 8 bone numbers for the corner cells "u" and "v". However, not all pairs are admissible. Among the 28 pairs, 16 pairs are made of an even and an odd number, 6 pairs have both as even numbers, while 6 pairs have them both as odd numbers.


title: Magic square

text: We can prove that the corner cells "u" and "v" cannot have an even and an odd number. This is because if this were so, then the sums "u" + "v" and "v" + "u*" will be odd, and since 0 is an even number, the sums "a" + "b" + "c" and "d" + "e" + "f" should be odd as well. The only way that the sum of three integers will result in an odd number is when 1) two of them are even and one is odd, or 2) when all three are odd. Since the corner cells are assumed to be odd and even, neither of these two statements are compatible with the fact that we only have 3 even and 3 odd bone numbers at our disposal. This proves that "u" and "v" cannot have different parity. This eliminates 16 possibilities.


title: Magic square

text: Using similar type reasoning we can also draw some conclusions about the sets {"a", "b", "c"} and {"d", "e", "f"}. If "u" and "v" are both even, then both the sets should have two odd numbers and one even number. If "u" and "v" are both odd, then one of the sets should have three even numbers while the other set should have one even number and two odd numbers.


title: Magic square

text: As a running example, consider the case when both "u" and "v" are even. The 6 possible pairs are: (6, 8), (6, 10), (6, 12), (8, 10), (8, 12), and (10, 12). Since the sums "u" + "v" and "v" + "u*" are even, the sums "a" + "b" + "c" and "d" + "e" + "f" should be even as well. The only way that the sum of three integers will result in an even number is when 1) two of them are odd and one is even, or 2) when all three are even. The fact that the two corner cells are even means that we have only 2 even numbers at our disposal. Thus, the second statement is not compatible with this fact. Hence, it must be the case that the first statement is true: two of the three numbers should be odd, while one be even.


title: Magic square

text: Now let "a, b, d, e" be odd numbers while "c" and "f" be even numbers. Given the odd bone numbers at our disposal: ± 5, ± 7, ± 9, and ± 11, their differences range from "D" = { ± 2, ± 4, ± 6} while their sums range from "S" = {± 12, ± 14, ± 16, ± 18, ± 20}. It is also useful to have a table of their sum and differences for later reference. Now, given the corner cells ("u", "v"), we can check its admissibility by checking if the sums "u" + "v" + "c" and "v" + "u*" + "f" fall within the set "D" or "S". The admissibility of the corner numbers is a necessary but not a sufficient condition for the solution to exist.


title: Magic square

text: For example, if we consider the pair ("u", "v") = (8, 12), then "u" + "v" = 20 and "v" + "u*" = 6; and we will have ± 6 and ± 10 even bone numbers at our disposal. Taking "c" = ± 6, we have the sum "u" + "v" + "c" to be 26 and 14, depending on the sign of "± 6" taken, both of which do not fall within the sets "D" or "S". Likewise, taking "c" = ± 10, we have the sum "u" + "v" + "c" to be 30 and 10, both of which again do not fall within the sets "D" or "S". Thus, the pair (8, 12) is not admissible. By similar process of reasoning, we can also rule out the pair (6, 12).


title: Magic square

text: As another example, if we consider the pair ("u", "v") = (10, 12), then "u" + "v" = 22 and "v" + "u*" = 2; and we will have ± 6 and ± 8 even bone numbers at our disposal. Taking "c" = ± 6, we have the sum "u" + "v" + "c" to be 28 and 16. While 28 does not fall within the sets "D" or "S", 16 falls in set "S". By inspection, we find that if ("a", "b") = (-7, -9), then "a" + "b" = -16; and it will satisfy the first constraint equation. Also, taking "f" = ± 8, we have the sum "v" + "u*" + "f" to be 10 and -6. While 10 does not fall within the sets "D" or "S", -6 falls in set "D". Since -7 and -9 have already been assigned to "a" and "b", clearly ("d", "e") = (-5, 11) so that "d" + "e" = 6; and it will satisfy the second constraint equation.


title: Magic square

text: Likewise, taking "c" = ± 8, we have the sum "u" + "v" + "c" to be 30 and 14. While 30 does not fall within the sets "D" or "S", 14 falls in set "S". By inspection, we find that if ("a", "b") = (-5, -9), then "a" + "b" = -14. Also, taking "f" = ± 6, we have the sum "v" + "u*" + "f" to be 8 and -4. While 8 does not fall within the sets "D" or "S", -4 falls in set "D". Clearly, ("d", "e") = (-7, 11) so that "d" + "e" = 4, and the second constraint equation will be satisfied.


title: Magic square

text: Hence the corner pair ("u", "v") = (10, 12) is admissible; and it admits two solutions: (a, b, c, d, e, f) = (-7, -9, -6, -5, 11, -8) and (a, b, c, d, e, f) = ( -5, -9, -8, -7, 11, -6). The finished skeleton squares are given below. The magic square is obtained by adding 13 to each cells.


title: Magic square

text: Using similar process of reasoning, we can construct the following table for the values of "u, v, a, b, c, d, e, f" expressed as bone numbers as given below. There are only 6 possible choices for the corner cells, which leads to 10 possible border solutions.


title: Magic square

text: Given this group of 10 borders, we can construct 10×8×(3!) = 2880 essentially different bordered magic squares. Here the bone numbers ± 5, ..., ± 12 were consecutive. More bordered squares can be constructed if the numbers are not consecutive. If non-consecutive bone numbers were also used, then there are a total of 605 magic borders. Thus, the total number of order 5 essentially different bordered magic squares (with consecutive and non-consecutive numbers) is 174,240. See history. It is worth noting that the number of fifth-order magic squares constructible via the bordering method is about 26 times larger than via the superposition method.


title: Magic square

text: Exhaustive enumeration of all the borders of a magic square of a given order, as done previously, is very tedious. As such a structured solution is often desirable, which allows us to construct a border for a square of any order. Below we give three algorithms for constructing border for odd, doubly even, and singly even squares. These continuous enumeration algorithms were discovered in 10th century by Arab scholars; and their earliest surviving exposition comes from the two treatises by al-Buzjani and al-Antaki, although they themselves were not the discoverers. Since then many more such algorithms have been discovered.


title: Magic square

text: Odd ordered squares: The following is the algorithm given by al-Buzjani to construct a border for odd squares. A peculiarity of this method is that for order "n" square, the two adjacent corners are numbers "n - 1" and "n + 1".


title: Magic square

text: Starting from the cell above the lower left corner, we put the numbers alternately in left column and bottom row until we arrive at the middle cell. The next number is written in the middle cell of the bottom row just reached, after which we fill the cell in the upper left corner, then the middle cell of the right column, then the upper right corner. After this, starting from the cell above middle cell of the right column already filled, we resume the alternate placement of the numbers in the right column and the top row. Once half of the border cells are filled, the other half are filled by numbers complementary to opposite cells. The subsequent inner borders is filled in the same manner, until the square of order 3 is filled.


title: Magic square

text: Doubly even order: The following is the method given by al-Antaki. Consider an empty border of order "n" = 4"k" with "k" ≥ 3. The peculiarity of this algorithm is that the adjacent corner cells are occupied by numbers "n" and "n - 1".


title: Magic square

text: Starting at the upper left corner cell, we put the successive numbers by groups of four, the first one next to the corner, the second and the third on the bottom, and the fourth at the top, and so on until there remains in the top row (excluding the corners) six empty cells. We then write the next two numbers above and the next four below. We then fill the upper corners, first left then right. We place the next number below the upper right corner in the right column, the next number on the other side in the left column. We then resume placing groups of four consecutive numbers in the two columns as before. Once half of the border cells are filled, the other half are filled by numbers complementary to opposite cells.


title: Magic square

text: Singly even order: For singly even order, we have the algorithm given by al-Antaki. Here the corner cells are occupied by "n" and "n" - 1. Below is an example of 10th-order square.


title: Magic square

text: Start by placing 1 at the bottom row next to the left corner cell, then place 2 in the top row. After this, place 3 at the bottom row and turn around the border in anti-clockwise direction placing the next numbers, until "n" - 2 is reached on the right column. The next two numbers are placed in the upper corners ("n" - 1 in upper left corner and "n" in upper right corner). Then, the next two numbers are placed on the left column, then we resume the cyclic placement of the numbers until half of all the border cells are filled. Once half of the border cells are filled, the other half are filled by numbers complementary to opposite cells.


title: Magic square

text: This is a method reminiscent of the Kronecker product of two matrices, that builds an "nm" × "nm" magic square from an "n" × "n" magic square and an "m" × "m" magic square. The "product" of two magic squares creates a magic square of higher order than the two multiplicands. Let the two magic squares be of orders "m" and "n". The final square will be of order "m × n". Divide the square of order "m × n" into "m × m" sub-squares, such that there are a total of "n" such sub-squares. In the square of order "n", reduce by 1 the value of all the numbers. Multiply these reduced values by "m", and place the results in the corresponding sub-squares of the "m × n" whole square. The squares of order "m" are added "n" times to the sub-squares of the final square. The peculiarity of this construction method is that each magic subsquare will have different magic sums. The square made of such magic sums from each magic subsquare will again be a magic square. The smallest composite magic square of order 9, composed of two order 3 squares is given below.


title: Magic square

text: Since each of the 3×3 sub-squares can be independently rotated and reflected into 8 different squares, from this single 9×9 composite square we can derive 8 = 134,217,728 essentially different 9×9 composite squares. Plenty more composite magic squares can also be derived if we select non-consecutive numbers in the magic sub-squares, like in Yang Hui's version of the 9×9 composite magic square. The next smallest composite magic squares of order 12, composed of magic squares of order 3 and 4 are given below.


title: Magic square

text: For the base squares, there is only one essentially different 3rd order square, while there 880 essentially different 4th-order squares that we can choose from. Each pairing can produce two different composite squares. Since each magic sub-squares in each composite square can be expressed in 8 different forms due to rotations and reflections, there can be 1×880×8 + 880×1×8 ≈ 2.476×10 essentially different 12×12 composite magic squares created this way, with consecutive numbers in each sub-square. In general, if there are "c" and "c" essentially different magic squares of order "m" and "n", then we can form "c" × "c" × ( 8 + 8) composite squares of order "mn", provided "m" ≠ "n". If "m" = "n", then we can form ("c") × 8 composite squares of order "m".


title: Magic square

text: When the squares are of doubly even order, we can construct a composite magic square in a manner more elegant than the above process, in the sense that every magic subsquare will have the same magic constant. Let "n" be the order of the main square and "m" the order of the equal subsquares. The subsquares are filled one by one, in any order, with a continuous sequence of "m"/2 smaller numbers (i.e. numbers less than or equal to "n"/2) together with their complements to "n" + 1. Each subsquare as a whole will yield the same magic sum. The advantage of this type of composite square is that each subsquare is filled in the same way and their arrangement is arbitrary. Thus, the knowledge of a single construction of even order will suffice to fill the whole square. Furthermore, if the subsquares are filled in the natural sequence, then the resulting square will be pandiagonal. The magic sum of the subsquares is related to the magic sum of the whole square by formula_66 where "n" = "km".


title: Magic square

text: In the examples below, we have divided the order 12 square into nine subsquares of order 4 filled each with eight smaller numbers and, in the corresponding bishop's cells (two cells diagonally across, including wrap arounds, in the 4×4 subsquare), their complements to "n" + 1 = 145. Each subsquare is pandiagonal with magic constant 290; while the whole square on the left is also pandiagonal with magic constant 870.


title: Magic square

text: In another example below, we have divided the order 12 square into four order 6 squares. Each of the order 6 squares are filled with eighteen small numbers and their complements using bordering technique given by al-Antaki. If we remove the shaded borders of the order 6 subsquares and form an order 8 square, then this order 8 square is again a magic square. In its full generality, we can take any "m"/2 smaller numbers together with their complements to "n" + 1 to fill the subsquares, not necessarily in continuous sequence.


title: Magic square

text: In this method a magic square is "multiplied" with a medjig square to create a larger magic square. The namesake of this method derives from mathematical game called medjig created by Willem Barink in 2006, although the method itself is much older. An early instance of a magic square constructed using this method occurs in Yang Hui's text for order 6 magic square. The LUX method to construct singly even magic squares is a special case of the medjig method, where only 3 out of 24 patterns are used to construct the medjig square.


title: Magic square

text: The pieces of the medjig puzzle are 2×2 squares on which the numbers 0, 1, 2 and 3 are placed. There are three basic patterns by which the numbers 0, 1, 2 and 3 can be placed in a 2×2 square, where 0 is at the top left corner:


title: Magic square

text: Each pattern can be reflected and rotated to obtain 8 equivalent patterns, giving us a total of 3×8 = 24 patterns. The aim of the puzzle is to take "n" medjig pieces and arrange them in an "n" × "n" "medjig square" in such a way that each row, column, along with the two long diagonals, formed by the medjig square sums to 3"n", the magic constant of the medjig square. An "n" × "n" medjig square can create a 2"n" × 2"n" magic square where "n" > 2.


title: Magic square

text: Given an "n"×"n" medjig square and an "n"×"n" magic square base, a magic square of order 2"n"×2"n" can be constructed as follows:


title: Magic square

text: Assuming that we have an initial magic square base, the challenge lies in constructing a medjig square. For reference, the sums of each medjig piece along the rows, columns and diagonals, denoted in italics, are:


title: Magic square

text: Doubly even squares: The smallest even ordered medjig square is of order 2 with magic constant 6. While it is possible to construct a 2×2 medjig square, we cannot construct a 4×4 magic square from it since 2×2 magic squares required to "multiply" it does not exist. Nevertheless, it is worth constructing these 2×2 medjig squares. The magic constant 6 can be partitioned into two parts in three ways as 6 = 5 + 1 = 4 + 2 = 3 + 3. There exist 96 such 2×2 medjig squares. In the examples below, each 2×2 medjig square is made by combining different orientations of a single medjig piece.


title: Magic square

text: We can use the 2×2 medjig squares to construct larger even ordered medjig squares. One possible approach is to simply combine the 2×2 medjig squares together. Another possibility is to wrap a smaller medjig square core with a medjig border. The pieces of a 2×2 medjig square can form the corner pieces of the border. Yet another possibility is to append a row and a column to an odd ordered medjig square. An example of an 8×8 magic square is constructed below by combining four copies of the left most 2×2 medjig square given above:


title: Magic square

text: Singly even squares: Medjig square of order 1 does not exist. As such, the smallest odd ordered medjig square is of order 3, with magic constant 9. There are only 7 ways of partitioning the integer 9, our magic constant, into three parts. If these three parts correspond to three of the medjig pieces in a row, column or diagonal, then the relevant partitions for us are:


title: Magic square

text: A 3×3 medjig square can be constructed with some trial-and-error, as in the left most square below. Another approach is to add a row and a column to a 2×2 medjig square. In the middle square below, a left column and bottom row has been added, creating an L-shaped medjig border, to a 2×2 medjig square given previously. The right most square below is essentially same as the middle square, except that the row and column has been added in the middle to form a cross while the pieces of 2×2 medjig square are placed at the corners.


title: Magic square

text: Once a 3×3 medjig square has been constructed, it can be converted into a 6×6 magic square. For example, using the left most 3×3 medjig square given above: