{"id":67,"date":"2016-06-23T20:34:10","date_gmt":"2016-06-23T18:34:10","guid":{"rendered":"http:\/\/berndt-schwerdtfeger.de\/?page_id=67"},"modified":"2026-02-08T15:20:31","modified_gmt":"2026-02-08T14:20:31","slug":"mathematical-recreation","status":"publish","type":"page","link":"https:\/\/berndt-schwerdtfeger.de\/?page_id=67","title":{"rendered":"Mathematical Recreation"},"content":{"rendered":"<h3><a name=\"life\"><\/a>Conway&#8217;s Game of Life<\/h3>\n<ul>\n<li>version 1.0, 2020-06-04 : <a title=\"life.c\" href=\"wp-content\/uploads\/c\/life.c\">life.c<\/a> source code<!--br \/>first published: 2020-06-04--><\/li>\n<li>version 1.0, 2020-06-04 : <a title=\"life.txt\" href=\"wp-content\/uploads\/txt\/life.txt\">life.txt<\/a> sample configuration file<!--br \/>first published: 2020-06-04--><\/li>\n<li>version 1.0, 2020-06-04 : <a title=\"life.pdf\" href=\"wp-content\/uploads\/pdf\/life.pdf\"><img decoding=\"async\" src=\"wp-content\/uploads\/pdf.png\" alt=\"pdf\" \/><\/a> doxygen documentation of the program<!--br \/>first published: 2020-05-15--><\/li>\n<\/ul>\n<p>This is a simple implementation of the well known Game of Life of John Conway. In this particular version the playing ground lives on a torus. The initial sample configuration shows two different glider guns that fire their gliders in different directions, missing the guns but hitting and effacing each other (after some turns around the torus). A nice example of never ending life on a torus.<\/p>\n<p><!-----><\/p>\n<h3><a name=\"soma\"><\/a>Soma W\u00fcrfel<\/h3>\n<ul>\n<li><!--img src=\"wp-content\/uploads\/new.gif\" alt=\"new\" \/--> version 1.2, 2017-04-08 : <a title=\"soma.pdf\" href=\"wp-content\/uploads\/pdf\/soma.pdf\"><img decoding=\"async\" src=\"wp-content\/uploads\/pdf.png\" alt=\"pdf\" \/><\/a><br \/>first published: 2015-05-15<\/li>\n<\/ul>\n<p>F\u00fcr Stefanie zum Geburtstag<\/p>\n<p>Dieser kurze Artikel beschreibt die von Piet Hein (&lowast;16.12.1905 &#8211; &dagger;18.04.1996) erfundenen Soma W\u00fcrfel.<br \/>\nInsbesondere sind 16 METAPOST Zeichnungen abgebildet.<br \/>Die Version v1.2 enth\u00e4lt einige Korrekturen von Udo WERMUTH.<\/p>\n<p><!-----><\/p>\n<h3><a name=\"calg\"><\/a>GUI program for calendar formulas<\/h3>\n<p>This paper describes my implementation of the <em>Julian<\/em> day function in a GUI program using <a title=\"Qt - cross platform application and UI framework\" href=\"http:\/\/qt-project.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">open source software Qt<\/a>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"GUI program calg\" src=\"wp-content\/uploads\/calg.png\" alt=\"GUI program calg\" width=\"362\" height=\"132\" \/><\/p>\n<ul>\n<li><!--img src=\"wp-content\/uploads\/new.gif\" alt=\"new\" \/--> version 1.3, 2024-01-27 : <a title=\"calg.pdf\" href=\"wp-content\/uploads\/pdf\/calg.pdf\"><img decoding=\"async\" src=\"wp-content\/uploads\/pdf.png\" alt=\"pdf\" \/><\/a> documentation (including source code)<br \/>first published: 2010-12-19<\/li>\n<\/ul>\n<p>In v1.2 I had to include the header file for QRegExpValidator in class CalgDialog (necessary for the actual version Qt5.11.1). No other change.<\/p>\n<p>In v1.3 the header file changed to QRegularExpressionValidator and Type QRegExp to QRegularExpression (version Qt6.6.1).<\/p>\n<p><!-----><\/p>\n<h3><a name=\"calj\"><\/a>On calendar formulas<\/h3>\n<p>This paper deals with calendar formulas for calculating the day of the week and the <em>Julian<\/em> day number as used in <em>Astronomy<\/em>. It describes my implementation of these formulas in C, C++ and Python.<\/p>\n<ul>\n<li><img decoding=\"async\" src=\"wp-content\/uploads\/new.png\" alt=\"new\" \/>version 1.4, 2025-11-26 : <a title=\"cal.cpp\" href=\"wp-content\/uploads\/txt\/cal.cpp\">cal.cpp<\/a> source code<!--br \/>first published: 2025-11-26--><\/li>\n<li>version 1.3.2, 2023-12-27 : <a title=\"cal.py\" href=\"wp-content\/uploads\/txt\/cal.txt\">cal.py<\/a> source code<!--br \/>first published: 2023-12-27--><\/li>\n<li>version 1.3.2, 2023-12-25 : <a title=\"cal.c\" href=\"wp-content\/uploads\/c\/cal.c\">cal.c<\/a> source code<br \/>first published: 2010-06-07<\/li>\n<li>version 1.4, 2025-11-26 : <a title=\"calj.pdf\" href=\"wp-content\/uploads\/pdf\/calj.pdf\"><img decoding=\"async\" src=\"wp-content\/uploads\/pdf.png\" alt=\"pdf\" \/><\/a> documentation<br \/>first published: 2010-06-07<\/li>\n<\/ul>\n<p>Dedicated to <em>Ralph<\/em>.<br \/>\nVersion 1.3 contains detailed formulas for calculating the <em>Julian<\/em> day number function and explains some points of the C program <code>cal.c<\/code> (the Python program is similar).<\/p>\n<p>The difference to the older article <a href=\"https:\/\/berndt-schwerdtfeger.de\/?page_id=67#cal\">Gauss&#8217; calendar formula for the day of the week<\/a> is that it does not use the proleptic <em>Gregorian<\/em> calendar exclusively, but uses the <em>Julian<\/em> calendar up to October 4, 1582 and the <em>Gregorian<\/em> since October 15, 1582. It also tells you that the dates October 5-14, 1582, are <em>false<\/em>, as they have been omitted by the <em>Gregorian<\/em> calendar reform.<\/p>\n<p><!-----><\/p>\n<h3><a name=\"rubik\"><\/a>Solving Rubik&#8217;s Cube<\/h3>\n<ul>\n<li><!--img src=\"wp-content\/uploads\/new.gif\" alt=\"new\" \/-->version 1.1, 2018-01-27 : <a title=\"rubik.pdf\" href=\"wp-content\/uploads\/pdf\/rubik.pdf\"><img decoding=\"async\" src=\"wp-content\/uploads\/pdf.png\" alt=\"pdf\" \/><\/a> updated world record in speedcubing (2017)<br \/>first published: 2010-09-28<br \/>MSC Primary 20B25, Secondary 20B30, 20B35<\/li>\n<\/ul>\n<p>Dedicated to <em>Sylvia<\/em> for her hospitality and in recognition of her MD promotion<\/p>\n<p>Description of a strategy for solving <em>Rubik<\/em>&#8216;s cube using methods and concepts of finite groups. This article describes my set of unscrambling operators together with the strategy that I follow during the pursuit. I put this into perspective to other strategies, which you may prefer, as they can be performed faster &#8211; but you have to learn much more &#8211; or they are more efficient in terms of number of turns. To go deeper you need to understand some mathematical concepts, like <em>groups<\/em>; some ideas are developed in the appendix.<\/p>\n<p><!-----><\/p>\n<h3>Solving Sudoku<\/h3>\n<ul>\n<li><img decoding=\"async\" src=\"wp-content\/uploads\/new.gif\" alt=\"new\" \/> version v1.1, 2026-02-07 <a title=\"sudoku.pdf\" href=\"wp-content\/uploads\/pdf\/sudoku.pdf\"><img decoding=\"async\" src=\"wp-content\/uploads\/pdf.png\" alt=\"pdf\" \/><\/a> programming notes and source file listing.<\/li>\n<li>version 1.0, 2015-03-04 : <a title=\"sudoku.pdf\" href=\"wp-content\/uploads\/pdf\/sudoku-v1_0.pdf\"><img decoding=\"async\" src=\"wp-content\/uploads\/pdf.png\" alt=\"pdf\" \/><\/a> &#8211; programming notes and source file listing<br \/>\nversion 2025-03-29 : <a title=\"sudoku.c\" href=\"wp-content\/uploads\/c\/sudoku.c\">sudoku.c<\/a> fixed wrong comment in functiuon foul and cand, <a title=\"sudoku.h\" href=\"wp-content\/uploads\/c\/sudoku.h\">sudoku.h<\/a><\/li>\n<\/ul>\n<p>first published: 2007-09-19<br \/>MSC Primary 05-04, Secondary 68R05<\/p>\n<p>This paper contains the description of a program for solving <em> sudoku<\/em> puzzles. There are several programs available in the Internet, see <a title=\"Angus Johnson\" href=\"https:\/\/angusj.com\/sudoku\/\" target=\"_blank\" rel=\"noopener noreferrer\">Simple Sudoku<\/a>, <a title=\"Team at sourceforge\" href=\"https:\/\/sudoku.sourceforge.net\/\" target=\"_blank\" rel=\"noopener noreferrer\">A Su Doku Solver<\/a>, <a title=\"Andrew Stuart\" href=\"http:\/\/www.scanraid.com\/sudoku.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Sudoku Solver by Andrew Stuart<\/a>.<\/p>\n<p>Some look mysterious to me, without much of a justification. I got interested in understanding the process of resolution and started to write my own routines. The article <a title=\"Wikipedia\" href=\"http:\/\/en.wikipedia.org\/wiki\/Algorithmics_of_Sudoku\" target=\"_blank\" rel=\"noopener noreferrer\">Algorithmics of sudoku<\/a> sketches one approach and has given me some early orientation.<\/p>\n<p>The Programming Notes explain the structure and development of my C program <code>sudoku<\/code> and give sufficient justification for understanding the algorithms. As I developed the program I made use of basic information structures, that Knuth describes in <a title=\"Donald Knuth's TAOCP\" href=\"http:\/\/www-cs-faculty.stanford.edu\/~knuth\/taocp.html\" target=\"_blank\" rel=\"noopener noreferrer\">The Art of Computer Programming<\/a> (volume 1: fundamental algorithms).<\/p>\n<p>I thank <em>Carmen<\/em> for firing up my inspiration in this task.<\/p>\n<p><!-----><\/p>\n<h3><a name=\"cal\"><\/a>Gauss&#8217; calendar formula for the day of the week<\/h3>\n<p>This paper describes a simple formula of C.F. Gauss for calculating the day of the week from the calendar date and gives a conceptual proof. A formula for the Julian day number is derived. My implementation in REXX and C is included. For an implementations in Perl see below.<\/p>\n<p>On Wed, May 06, 2009, I finally looked into <a title=\"Gauss Werke\" href=\"https:\/\/gdz.sub.uni-goettingen.de\/id\/PPN235957348\" target=\"_blank\" rel=\"noopener noreferrer\">Gauss Werke<\/a> and found the formula in the <a title=\"Gauss Nachlass\" href=\"https:\/\/gdz.sub.uni-goettingen.de\/id\/PPN236020595?tify={%22pages%22:[210],%22view%22:%22%22}\" target=\"_blank\" rel=\"noopener noreferrer\">Nachlass<\/a>. This new revision has been updated accordingly.<\/p>\n<ul>\n<li>version 1.4, 2010-12-03 : <a title=\"gauss.c\" href=\"wp-content\/uploads\/c\/gauss.c\" target=\"_blank\" rel=\"noopener noreferrer\">gauss.c<\/a> source code<br \/>first published: 2009-03-26<\/li>\n<li><!--img src=\"wp-content\/uploads\/new.gif\" alt=\"new\" \/--> version 1.4a, 2018-11-14 : <a title=\"cal.pdf\" href=\"wp-content\/uploads\/pdf\/cal.pdf\"><img decoding=\"async\" src=\"wp-content\/uploads\/pdf.png\" alt=\"pdf\" \/><\/a> (english)<br \/>first published: 2001-06-30<\/li>\n<li>version 1.4, 2015-03-04 : <a title=\"cald.pdf\" href=\"wp-content\/uploads\/pdf\/cald.pdf\"><img decoding=\"async\" src=\"wp-content\/uploads\/pdf.png\" alt=\"pdf\" \/><\/a> (deutsch)<br \/>first published: 2005-02-26<\/li>\n<\/ul>\n<p>Here are my older implementations of <em>gauss<\/em> made available under the <a title=\"General Public License\" href=\"http:\/\/www.gnu.org\/licenses\/licenses.html#GPL\" target=\"_blank\" rel=\"noopener noreferrer\">GPL<\/a> license in Perl <a title=\"gauss.pl\" href=\"wp-content\/uploads\/txt\/gauss.txt\" target=\"_blank\" rel=\"noopener noreferrer\">gauss.pl<\/a> and in REXX <a title=\"gauss.rexx\" href=\"wp-content\/uploads\/rex\/gauss.rexx\" target=\"_blank\" rel=\"noopener noreferrer\">gauss.rexx<\/a>.<\/p>\n<p>Much more historic background can be found in Peter Meyer&#8217;s excellent exposition on <a title=\"Julian and Gregorian calendars\" href=\"http:\/\/www.hermetic.ch\/cal_stud\/cal_art.html\" target=\"_blank\" rel=\"noopener noreferrer\">The Julian and Gregorian Calendars<\/a>. Other interesting articles there include the <a title=\"Julian Day Number\" href=\"http:\/\/www.hermetic.ch\/cal_stud\/jdn.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Julian Day Numbers<\/a> and <a title=\"Maya Calendar\" href=\"http:\/\/www.hermetic.ch\/cal_stud\/maya.htm\" target=\"_blank\" rel=\"noopener noreferrer\">The Maya Calendar<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Conway&#8217;s Game of Life version 1.0, 2020-06-04 : life.c source code version 1.0, 2020-06-04 : life.txt sample configuration file version 1.0, 2020-06-04 : doxygen documentation of the program This is a simple implementation of the well known Game of Life of John Conway. In this particular version the playing ground lives on a torus. The [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":57,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ngg_post_thumbnail":0,"footnotes":""},"class_list":["post-67","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/berndt-schwerdtfeger.de\/index.php?rest_route=\/wp\/v2\/pages\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/berndt-schwerdtfeger.de\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/berndt-schwerdtfeger.de\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/berndt-schwerdtfeger.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/berndt-schwerdtfeger.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=67"}],"version-history":[{"count":75,"href":"https:\/\/berndt-schwerdtfeger.de\/index.php?rest_route=\/wp\/v2\/pages\/67\/revisions"}],"predecessor-version":[{"id":1064,"href":"https:\/\/berndt-schwerdtfeger.de\/index.php?rest_route=\/wp\/v2\/pages\/67\/revisions\/1064"}],"up":[{"embeddable":true,"href":"https:\/\/berndt-schwerdtfeger.de\/index.php?rest_route=\/wp\/v2\/pages\/57"}],"wp:attachment":[{"href":"https:\/\/berndt-schwerdtfeger.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}