Mathematical Recreation

Conway’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 : pdf 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 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.

Soma Würfel

  • version 1.2, 2017-04-08 : pdf
    first published: 2015-05-15

Für Stefanie zum Geburtstag

Dieser kurze Artikel beschreibt die von Piet Hein (∗16.12.1905 – †18.04.1996) erfundenen Soma Würfel.
Insbesondere sind 16 METAPOST Zeichnungen abgebildet.
Die Version v1.2 enthält einige Korrekturen von Udo WERMUTH.

GUI program for calendar formulas

This paper describes my implementation of the Julian day function in a GUI program using open source software Qt.

GUI program calg

  • new version 1.3, 2024-01-27 : pdf documentation (including source code)
    first published: 2010-12-19

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.

In v1.3 the header file changed to QRegularExpressionValidator and Type QRegExp to QRegularExpression (version Qt6.6.1).

On calendar formulas

This paper deals with calendar formulas for calculating the day of the week and the Julian day number as used in Astronomy. It describes my implementation of these formulas in C and newPython.

  • newversion 1,3,2, 2023-12-27 : cal.py source code
    first published: 2023-12-27
  • version 1,3,2, 2023-12-25 : cal.c source code
    first published: 2010-06-07
  • version 1.3.2, 2023-12-24 : pdf documentation
    first published: 2010-06-07

Dedicated to Ralph.
Version 1.3 contains detailed formulas for calculating the Julian day number function and explains some points of the C program cal.c (the Python program is similar).

The difference to the older article Gauss’ calendar formula for the day of the week” is that it does not use the proleptic Gregorian calendar exclusively, but uses the Julian calendar up to October 4, 1582 and the Gregorian since October 15, 1582. It also tells you that the dates October 5-14, 1582, are false, as they have been omitted by the Gregorian calendar reform.

Solving Rubik’s Cube

  • version 1.1, 2018-01-27 : pdf updated world record in speedcubing (2017)
    first published: 2010-09-28
    MSC Primary 20B25, Secondary 20B30, 20B35

Dedicated to Sylvia for her hospitality and in recognition of her MD promotion

Description of a strategy for solving Rubik‘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 – but you have to learn much more – or they are more efficient in terms of number of turns. To go deeper you need to understand some mathematical concepts, like groups; some ideas are developed in the appendix.

Solving Sudoku

  • version 1.0, rev. 110, 2011-04-05 : sudoku.c source code, sudoku.h header file
    first published: 2007-09-19
  • version 1.0, 2015-03-04 : pdf – programming notes and source file listing
    first published: 2007-09-19
    MSC Primary 05-04, Secondary 15-04

This paper contains the description of a program for solving sudoku puzzles. There are several programs available in the Internet, see Wayne Gould Puzzles, Simple Sudoku, A Su Doku Solver, Sudoku Essentials, Sudoku Solver by Andrew Stuart , Sudoku Solver by Logic.

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 Algorithmics of sudoku sketches one approach and has given me some early orientation.

The Programming Notes explain the structure and development of my C program sudoku and give sufficient justification for understanding the algorithms. As I developed the program I made use of basic information structures, that Knuth describes in The Art of Computer Programming (volume 1: fundamental algorithms). I thank Carmen for firing up my inspiration in this task.

Gauss’ calendar formula for the day of the week

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.

On Wed, May 06, 2009, I finally looked into Gauss Werke and found the formula in the Nachlass. This new revision has been updated accordingly.

  • version 1.4, 2010-12-03 : gauss.c source code
    first published: 2009-03-26
  • version 1.4a, 2018-11-14 : pdf (english)
    first published: 2001-06-30
  • version 1.4, 2015-03-04 : pdf (deutsch)
    first published: 2005-02-26

Here are my older implementations of gauss made available under the GPL license in Perl gauss.pl and in REXX gauss.rexx.

Much more historic background can be found in Peter Meyer’s excellent exposition on The Julian and Gregorian Calendars. Other interesting articles there include the Julian Day Numbers and The Maya Calendar.