Попробовал применить материал выложенной статьи для получения "практических" результатов.
Код:
Идеальный квадрат N=5
A[0,0]=+p1
A[0,1]=+p2
A[0,2]=+p3
A[0,3]=+p4
A[0,4]=+5S/5-p1-p2-p3-p4
A[1,0]=+3S/5-p1-p2
A[1,1]=+3S/5-p1-p2-p3+p4
A[1,2]=+3S/5-p2-p4
A[1,3]=-2S/5+p1+2p2
A[1,4]=-2S/5+p1+p2+p3
A[2,0]=+S/5+p2-p4
A[2,1]=-4S/5+2p1+2p2+p3
A[2,2]=+S/5
A[2,3]=+6S/5-2p1-2p2-p3
A[2,4]=+S/5-p2+p4
A[3,0]=+4S/5-p1-p2-p3
A[3,1]=+4S/5-p1-2p2
A[3,2]=-S/5+p2+p4
A[3,3]=-S/5+p1+p2+p3-p4
A[3,4]=-S/5+p1+p2
A[4,0]=-3S/5+p1+p2+p3+p4
A[4,1]=+2S/5-p4
A[4,2]=+2S/5-p3
A[4,3]=+2S/5-p2
A[4,4]=+2S/5-p1
Идеальный квадрат N=6
A[0,0]=+p1
A[0,1]=+p2
A[0,2]=+p3
A[0,3]=+p4
A[0,4]=+p5
A[0,5]=+6S/6-p1-p2-p3-p4-p5
A[1,0]=+p6
A[1,1]=+p7
A[1,2]=+6S/6-p1-2p2-p3+p5-p6-p7
A[1,3]=+6S/6-p1-p2-p3-p6-p7
A[1,4]=-6S/6+2p1+2p2+2p3+p7
A[1,5]=+p2-p5+p6
A[2,0]=+9S/6-2p1-2p2-p3-2p6-p7
A[2,1]=-3S/6+p1+p2+p3+p5
A[2,2]=-3S/6+p1+2p2-2p5+2p6+p7
A[2,3]=-3S/6+p1+p2+p3-p4-p5+2p6+p7
A[2,4]=+3S/6-p1-p3
A[2,5]=+3S/6-2p2+p4+2p5-2p6-p7
A[3,0]=-S/6+2p2-p4-2p5+2p6+p7
A[3,1]=-S/6+p1+p3
A[3,2]=+5S/6-p1-p2-p3+p4+p5-2p6-p7
A[3,3]=+5S/6-p1-2p2+2p5-2p6-p7
A[3,4]=+5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p2+2p3+p4+p5+p7+p9-p14+p15
A[3,0]=+16S/8-2p1-2p2-2p3-p4-2p8-2p9-p10-2p15-p16
A[3,1]=+8S/8-2p1-2p2-2p3-p4-p5+p6-p9+p12+p13+2p14-p15-p16-p17
A[3,2]=-8S/8+2p1+2p2+2p3+p4+p5+p7+p9-p12-p14+p15
A[3,3]=-16S/8+3p1+4p2+4p3+2p4-2p6-2p7+2p8+3p9+2p10-2p13-2p14+2p15+2p16+p17
A[3,4]=-16S/8+3p1+3p2+4p3+2p4-2p6-p7+2p8+3p9+p10+p11-p12-p13-2p14+2p15+2p16+p17
A[3,5]=+p7-p11+p15
A[3,6]=+16S/8-2p1-3p2-3p3-2p4+2p6+p7-2p8-2p9-2p10-p11+p13+p14-p15-p16-p17
A[3,7]=+8S/8-2p1-2p2-3p3-p4+p6-2p9+p11+p12+p13+2p14-2p15-p16
A[4,0]=-6S/8+2p1+2p2+3p3+p4-p6+2p9-p11-p12-p13-2p14+2p15+p16
A[4,1]=-14S/8+2p1+3p2+3p3+2p4-2p6-p7+2p8+2p9+2p10+p11-p13-p14+p15+p16+p17
A[4,2]=+2S/8-p7+p11-p15
A[4,3]=+18S/8-3p1-3p2-4p3-2p4+2p6+p7-2p8-3p9-p10-p11+p12+p13+2p14-2p15-2p16-p17
A[4,4]=+18S/8-3p1-4p2-4p3-2p4+2p6+2p7-2p8-3p9-2p10+2p13+2p14-2p15-2p16-p17
A[4,5]=+10S/8-2p1-2p2-2p3-p4-p5-p7-p9+p12+p14-p15
A[4,6]=-6S/8+2p1+2p2+2p3+p4+p5-p6+p9-p12-p13-2p14+p15+p16+p17
A[4,7]=-14S/8+2p1+2p2+2p3+p4+2p8+2p9+p10+2p15+p16
A[5,0]=+10S/8-2p1-p2-2p3-p4-p5-p7-p9+p14-p15
A[5,1]=+10S/8-2p2-p3-p4+p5+p6+2p7-2p8-2p9-2p10-p11-p12-p16
A[5,2]=+10S/8-2p1-2p2-3p3-p4-p5+p6-p9-p10-p11+p12+p13+p14-p17
A[5,3]=-14S/8+2p1+2p2+3p3+p4+p5-p6+p8+2p9+p10+p11-p14+p15+p16+p17
A[5,4]=-14S/8+2p1+3p2+3p3+2p4-p6-p7+p8+2p9+2p10+p11-p13-p14+p15+p16+p17
A[5,5]=+2S/8-p17
A[5,6]=+2S/8-p16
A[5,7]=+2S/8-p15
A[6,0]=-6S/8+p8+p9+p10+p11+p12+p13+p14
A[6,1]=+2S/8-p14
A[6,2]=+2S/8-p13
A[6,3]=+2S/8-p12
A[6,4]=+2S/8-p11
A[6,5]=+2S/8-p10
A[6,6]=+2S/8-p9
A[6,7]=+2S/8-p8
A[7,0]=-6S/8+p1+p2+p3+p4+p5+p6+p7
A[7,1]=+2S/8-p7
A[7,2]=+2S/8-p6
A[7,3]=+2S/8-p5
A[7,4]=+2S/8-p4
A[7,5]=+2S/8-p3
A[7,6]=+2S/8-p2
A[7,7]=+2S/8-p1
Идеальный квадрат N=9
A[0,0]=+p1
A[0,1]=+p2
A[0,2]=+p3
A[0,3]=+p4
A[0,4]=+p5
A[0,5]=+p6
A[0,6]=+p7
A[0,7]=+p8
A[0,8]=+9S/9-p1-p2-p3-p4-p5-p6-p7-p8
A[1,0]=+p9
A[1,1]=+p10
A[1,2]=+p11
A[1,3]=+p12
A[1,4]=+p13
A[1,5]=+p14
A[1,6]=+p15
A[1,7]=+p16
A[1,8]=+9S/9-p9-p10-p11-p12-p13-p14-p15-p16
A[2,0]=+p17
A[2,1]=+p18
A[2,2]=+p19
A[2,3]=+p20
A[2,4]=+p21
A[2,5]=+p22
A[2,6]=+p23
A[2,7]=+p24
A[2,8]=+9S/9-p17-p18-p19-p20-p21-p22-p23-p24
A[3,0]=+10S/9-p1-p2-p3-p4-p9-p10-p11-p17-p18
A[3,1]=+10S/9-p1-2p2-2p3-p4-p5+p6+p7+p8-p9-2p10-p11-p12+p15+p16-p17-p18-p19+p24
A[3,2]=+10S/9-p1-2p2-2p3-2p4+2p7+p8-p9-p10-2p11-p12-p13+p14+p15+p16-p18-p19-p20+p23
A[3,3]=+10S/9-p1-p2-2p3-p4-p5+p6+p8-p10-p11-2p12+p15-p19-p20-p21+p22
A[3,4]=+10S/9-p2-p4-p6-p8-p11-p13-p15-p20-p22
A[3,5]=+S/9+p1+2p2+p3+2p4-p7+p11-2p14-p15-p16+p20-p21-p22-p23
A[3,6]=-8S/9+p1+2p2+3p3+p4+p5-p6-p7-p8+p9+2p10+2p11+2p12-p15+p19-p22-p23-p24
A[3,7]=-17S/9+p1+2p2+2p3+2p4-p7-p8+p9+2p10+2p11+p12+p13-p16+p17+2p18+p19+p20+p21+p22
A[3,8]=-17S/9+p1+p2+p3+p4+p5+p9+p10+p11+p12+p13+p14+p17+p18+p19+p20+p21+p22+p23
A[4,0]=+S/9+p2+p3+p4-p6-p7-p8+p10+p11-p15-p16+p18-p24
A[4,1]=-26S/9+2p1+3p2+4p3+3p4+p5-p6-2p7-p8+2p9+3p10+3p11+2p12+p13-p15-p16+2p17+2p18+2p19+p20+p21+p22
A[4,2]=-17S/9+2p1+4p2+4p3+3p4+p5-p6-2p7-2p8+2p9+3p10+3p11+3p12+p13-p14-p15-p16+p18+p19+p20-p22-p23-p24
A[4,3]=-8S/9+2p1+3p2+3p3+2p4+p5-p7-p8+p10+2p11+p12-p14-2p15-p16+p19+p20-p22-p23
A[4,4]=+S/9
A[4,5]=+10S/9-2p1-3p2-3p3-2p4-p5+p7+p8-p10-2p11-p12+p14+2p15+p16-p19-p20+p22+p23
A[4,6]=+19S/9-2p1-4p2-4p3-3p4-p5+p6+2p7+2p8-2p9-3p10-3p11-3p12-p13+p14+p15+p16-p18-p19-p20+p22+p23+p24
A[4,7]=+28S/9-2p1-3p2-4p3-3p4-p5+p6+2p7+p8-2p9-3p10-3p11-2p12-p13+p15+p16-2p17-2p18-2p19-p20-p21-p22
A[4,8]=+S/9-p2-p3-p4+p6+p7+p8-p10-p11+p15+p16-p18+p24
A[5,0]=+19S/9-p1-p2-p3-p4-p5-p9-p10-p11-p12-p13-p14-p17-p18-p19-p20-p21-p22-p23
A[5,1]=+19S/9-p1-2p2-2p3-2p4+p7+p8-p9-2p10-2p11-p12-p13+p16-p17-2p18-p19-p20-p21-p22
A[5,2]=+10S/9-p1-2p2-3p3-p4-p5+p6+p7+p8-p9-2p10-2p11-2p12+p15-p19+p22+p23+p24
A[5,3]=+S/9-p1-2p2-p3-2p4+p7-p11+2p14+p15+p16-p20+p21+p22+p23
A[5,4]=-8S/9+p2+p4+p6+p8+p11+p13+p15+p20+p22
A[5,5]=-8S/9+p1+p2+2p3+p4+p5-p6-p8+p10+p11+2p12-p15+p19+p20+p21-p22
A[5,6]=-8S/9+p1+2p2+2p3+2p4-2p7-p8+p9+p10+2p11+p12+p13-p14-p15-p16+p18+p19+p20-p23
A[5,7]=-8S/9+p1+2p2+2p3+p4+p5-p6-p7-p8+p9+2p10+p11+p12-p15-p16+p17+p18+p19-p24
A[5,8]=-8S/9+p1+p2+p3+p4+p9+p10+p11+p17+p18
A[6,0]=-7S/9+p17+p18+p19+p20+p21+p22+p23+p24
A[6,1]=+2S/9-p24
A[6,2]=+2S/9-p23
A[6,3]=+2S/9-p22
A[6,4]=+2S/9-p21
A[6,5]=+2S/9-p20
A[6,6]=+2S/9-p19
A[6,7]=+2S/9-p18
A[6,8]=+2S/9-p17
A[7,0]=-7S/9+p9+p10+p11+p12+p13+p14+p15+p16
A[7,1]=+2S/9-p16
A[7,2]=+2S/9-p15
A[7,3]=+2S/9-p14
A[7,4]=+2S/9-p13
A[7,5]=+2S/9-p12
A[7,6]=+2S/9-p11
A[7,7]=+2S/9-p10
A[7,8]=+2S/9-p9
A[8,0]=-7S/9+p1+p2+p3+p4+p5+p6+p7+p8
A[8,1]=+2S/9-p8
A[8,2]=+2S/9-p7
A[8,3]=+2S/9-p6
A[8,4]=+2S/9-p5
A[8,5]=+2S/9-p4
A[8,6]=+2S/9-p3
A[8,7]=+2S/9-p2
A[8,8]=+2S/9-p1
Идеальный квадрат N=10
A[0,0]=+p1
A[0,1]=+p2
A[0,2]=+p3
A[0,3]=+p4
A[0,4]=+p5
A[0,5]=+p6
A[0,6]=+p7
A[0,7]=+p8
A[0,8]=+p9
A[0,9]=+10S/10-p1-p2-p3-p4-p5-p6-p7-p8-p9
A[1,0]=+p10
A[1,1]=+p11
A[1,2]=+p12
A[1,3]=+p13
A[1,4]=+p14
A[1,5]=+p15
A[1,6]=+p16
A[1,7]=+p17
A[1,8]=+p18
A[1,9]=+10S/10-p10-p11-p12-p13-p14-p15-p16-p17-p18
A[2,0]=+p19
A[2,1]=+p20
A[2,2]=+p21
A[2,3]=+p22
A[2,4]=+p23
A[2,5]=+p24
A[2,6]=+p25
A[2,7]=+p26
A[2,8]=+p27
A[2,9]=+10S/10-p19-p20-p21-p22-p23-p24-p25-p26-p27
A[3,0]=+p28
A[3,1]=+p29
A[3,2]=+p30
A[3,3]=+p31
A[3,4]=+30S/10-2p1-4p2-4p3-4p4-2p5+2p7+2p8+2p9-2p10-3p11-4p12-3p13-2p14+p16+2p17+p18-p19-2p20-2p21-2p22-p23+p25+p26+p27-p28-p29-p30-p31
A[3,5]=+30S/10-2p1-3p2-4p3-3p4-2p5+p7+2p8+p9-2p10-3p11-3p12-3p13-p14-p15+p16+p17+p18-p19-2p20-2p21-p22-p23+p26+p27-p28-p29-p30-p31
A[3,6]=-10S/10+2p1+2p2+3p3+2p4+2p5-p8+p11+p12+2p13-2p16-p17-p18+p21+p22+p23-p24-p25-p26+p31
A[3,7]=-10S/10+2p2+2p3+2p4-2p7-2p8-2p9+2p10+2p11+3p12+2p13+2p14-p17+p20+p21+p22-p25-p26-p27+p30
A[3,8]=-20S/10+2p1+2p2+3p3+2p4+2p5-p8+2p11+p12+p13-p16-p17-2p18+2p19+2p20+2p21+p22+p23+p24+p25+p29
A[3,9]=-10S/10+p2+p4-p7-p9+2p10+p11+2p12+p13+p14+p15+p16+p18+p20-p27+p28
A[4,0]=+25S/10-2p1-2p2-2p3-2p4-p5-2p10-2p11-2p12-p13-2p19-2p20-p21-2p28-p29
A[4,1]=+5S/10-2p2-p3-p4+2p7+p8+2p9-2p10-2p11-2p12-p13-p14+p17-p20+p23+p24+p25+p26+2p27-p28-p29-p30
A[4,2]=+15S/10-2p1-2p2-3p3-2p4-2p5+2p8-p11-p12-p13+2p16+2p17+2p18-p19-p20-2p21-p22-p23+p26-p29-p30-p31
A[4,3]=-15S/10+2p1+3p2+3p3+2p4+2p5-p8+p10+2p11+2p12+p13-p16-p17-p18+p19+p20+p21-p24-p26-p27+p28+p29
A[4,4]=-35S/10+3p1+6p2+6p3+6p4+2p5-4p7-4p8-4p9+4p10+5p11+6p12+4p13+2p14-2p16-4p17-2p18+2p19+4p20+3p21+2p22-2p25-2p26-2p27+2p28+2p29+2p30+p31
A[4,5]=-35S/10+3p1+5p2+6p3+5p4+3p5-p6-3p7-4p8-3p9+4p10+5p11+5p12+4p13+2p14-2p16-3p17-2p18+2p19+4p20+3p21+p22+p23-p24-p25-2p26-2p27+2p28+2p29+2p30+p31
A[4,6]=-5S/10+p2+p4-p7+p10+p11+p12+p19+p20-p23-p27+p28+p29
A[4,7]=+25S/10-2p1-4p2-4p3-4p4-2p5+2p7+3p8+2p9-2p10-3p11-3p12-3p13-2p14+2p16+2p17+2p18-p19-2p20-2p21-2p22-p23+p25+p26+p27-p29-p30-p31
A[4,8]=+25S/10-2p1-3p2-4p3-3p4-2p5+2p7+2p8+p9-2p10-3p11-3p12-2p13-p14+p16+2p17+p18-2p19-2p20-2p21-p22+p26+p27-p28-p29-p30
A[4,9]=+5S/10-2p2-p3-2p4+p6+2p7+p8+2p9-2p10-2p11-3p12-p13+p17-2p20+p22+p23+p24+p25+p26+2p27-2p28-p29
A[5,0]=-3S/10+2p2+p3+2p4-p6-2p7-p8-2p9+2p10+2p11+3p12+p13-p17+2p20-p22-p23-p24-p25-p26-2p27+2p28+p29
A[5,1]=-23S/10+2p1+3p2+4p3+3p4+2p5-2p7-2p8-p9+2p10+3p11+3p12+2p13+p14-p16-2p17-p18+2p19+2p20+2p21+p22-p26-p27+p28+p29+p30
A[5,2]=-23S/10+2p1+4p2+4p3+4p4+2p5-2p7-3p8-2p9+2p10+3p11+3p12+3p13+2p14-2p16-2p17-2p18+p19+2p20+2p21+2p22+p23-p25-p26-p27+p29+p30+p31
A[5,3]=+7S/10-p2-p4+p7-p10-p11-p12-p19-p20+p23+p27-p28-p29
A[5,4]=+37S/10-3p1-5p2-6p3-5p4-3p5+p6+3p7+4p8+3p9-4p10-5p11-5p12-4p13-2p14+2p16+3p17+2p18-2p19-4p20-3p21-p22-p23+p24+p25+2p26+2p27-2p28-2p29-2p30-p31
A[5,5]=+37S/10-3p1-6p2-6p3-6p4-2p5+4p7+4p8+4p9-4p10-5p11-6p12-4p13-2p14+2p16+4p17+2p18-2p19-4p20-3p21-2p22+2p25+2p26+2p27-2p28-2p29-2p30-p31
A[5,6]=+17S/10-2p1-3p2-3p3-2p4-2p5+p8-p10-2p11-2p12-p13+p16+p17+p18-p19-p20-p21+p24+p26+p27-p28-p29
A[5,7]=-13S/10+2p1+2p2+3p3+2p4+2p5-2p8+p11+p12+p13-2p16-2p17-2p18+p19+p20+2p21+p22+p23-p26+p29+p30+p31
A[5,8]=-3S/10+2p2+p3+p4-2p7-p8-2p9+2p10+2p11+2p12+p13+p14-p17+p20-p23-p24-p25-p26-2p27+p28+p29+p30
A[5,9]=-23S/10+2p1+2p2+2p3+2p4+p5+2p10+2p11+2p12+p13+2p19+2p20+p21+2p28+p29
A[6,0]=+12S/10-p2-p4+p7+p9-2p10-p11-2p12-p13-p14-p15-p16-p18-p20+p27-p28
A[6,1]=+22S/10-2p1-2p2-3p3-2p4-2p5+p8-2p11-p12-p13+p16+p17+2p18-2p19-2p20-2p21-p22-p23-p24-p25-p29
A[6,2]=+12S/10-2p2-2p3-2p4+2p7+2p8+2p9-2p10-2p11-3p12-2p13-2p14+p17-p20-p21-p22+p25+p26+p27-p30
A[6,3]=+12S/10-2p1-2p2-3p3-2p4-2p5+p8-p11-p12-2p13+2p16+p17+p18-p21-p22-p23+p24+p25+p26-p31
A[6,4]=-28S/10+2p1+3p2+4p3+3p4+2p5-p7-2p8-p9+2p10+3p11+3p12+3p13+p14+p15-p16-p17-p18+p19+2p20+2p21+p22+p23-p26-p27+p28+p29+p30+p31
A[6,5]=-28S/10+2p1+4p2+4p3+4p4+2p5-2p7-2p8-2p9+2p10+3p11+4p12+3p13+2p14-p16-2p17-p18+p19+2p20+2p21+2p22+p23-p25-p26-p27+p28+p29+p30+p31
A[6,6]=+2S/10-p31
A[6,7]=+2S/10-p30
A[6,8]=+2S/10-p29
A[6,9]=+2S/10-p28
A[7,0]=-8S/10+p19+p20+p21+p22+p23+p24+p25+p26+p27
A[7,1]=+2S/10-p27
A[7,2]=+2S/10-p26
A[7,3]=+2S/10-p25
A[7,4]=+2S/10-p24
A[7,5]=+2S/10-p23
A[7,6]=+2S/10-p22
A[7,7]=+2S/10-p21
A[7,8]=+2S/10-p20
A[7,9]=+2S/10-p19
A[8,0]=-8S/10+p10+p11+p12+p13+p14+p15+p16+p17+p18
A[8,1]=+2S/10-p18
A[8,2]=+2S/10-p17
A[8,3]=+2S/10-p16
A[8,4]=+2S/10-p15
A[8,5]=+2S/10-p14
A[8,6]=+2S/10-p13
A[8,7]=+2S/10-p12
A[8,8]=+2S/10-p11
A[8,9]=+2S/10-p10
A[9,0]=-8S/10+p1+p2+p3+p4+p5+p6+p7+p8+p9
A[9,1]=+2S/10-p9
A[9,2]=+2S/10-p8
A[9,3]=+2S/10-p7
A[9,4]=+2S/10-p6
A[9,5]=+2S/10-p5
A[9,6]=+2S/10-p4
A[9,7]=+2S/10-p3
A[9,8]=+2S/10-p2
A[9,9]=+2S/10-p1
Если обнаружите ошибку, то прошу сообщить. Я не успел проверить правильность формул.