期刊文献+

幻方的实现方法研究 被引量:4

Research on Magic Square Method for Programmer
下载PDF
导出
摘要 用3种不同的构造法可以生成奇阶、单偶阶和双偶阶三类不同的幻方。以全排列为基础,可以求出全部8个三阶幻方。为了求出全部四阶幻方,先找出1至16中和为34的四个数字组合,共有2064组。该文提出了两个求解全部四阶幻方的算法。算法一先确定一列,再确定4行。算法二先确定两列,再确定4行。四阶幻方共有7040个,其中880个无重复。算法二比算法一效率高得多,表明增加循环之前的检验之后,程序运行的速度大大提高了。 Three different methods are used to structure three different kinds of magic squares in this paper: odd order, single-even order and doubly even order. Based on full permutation, All the third-order magic square are found, a total of 8. In order to get all the fourth-order magic square, firstly, identify the group containing 4 elements the sum of which is 34. There are 2064 such groups. This paper provides two algorithms to calculate all the fourth-order magic squares. Algorithm I first determine one column, and then determines the four ranks. Algorithm II first determines two columns, and then determines the four ranks. There are 7040 fourth-order magic squares, in which no-repeat of 880. Algorithm II is far more efficient than Algorithm I, which indicates that the increase of the checks before the cycles contributes to the promotion of the program’s operating speed.
出处 《微型电脑应用》 2010年第1期17-18,4,共2页 Microcomputer Applications
关键词 四阶幻方 构造法 全部解 无重复解 Fourth-order Magic Squares Structure Method All Solutions No-repeat Solutions
  • 相关文献

参考文献3

  • 1高治源.幻方的应用前景[J].延安教育学院学报,2000,14(1):44-46. 被引量:4
  • 2吴鹤龄.幻方及其他[M].北京:科学出版社,2005.15-90.
  • 3沈康身.数学魅力(四)[M].上海:上海辞书出版社,2006,7:57-85.

二级参考文献2

共引文献5

同被引文献47

引证文献4

二级引证文献2

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部