Enigmatic Code

Programming Enigma Puzzles

Enigma 1196: A small crossnumber

From New Scientist #2352, 20th July 2002 [link]

The septitude of a two-digit number, n, is obtained by first dividing n by 7 and noting the remainder, r. We use r to calculate a new number as follows:

if r is 0, 1, 2, 3, 4, 5, 6 then the new number is n + 29, n – 23, n + 15, n – 40, n + 31, n + 25, n – 37 respectively.

If the new number is in the range 10 to 99 then it is the septitude of n, otherwise add or subtract 84 from the new number to get a number in the range 10 to 99, and that latter number is the septitude of n.

For example, the septitudes of 14, 15, and 74 are 43, 76, and 21 respectively.

In the crossnumber puzzle (below):

Enigma 1196

each of the four answers, 1 Across, 3 Across, 1 Down and 2 Down, 
equals the septitude of another of these four answers. Also 3 Across is larger than 2 Down.

What are 1 Across and 3 Across?

[enigma1196]

Advertisements

One response to “Enigma 1196: A small crossnumber

  1. Jim Randell 26 October 2015 at 7:17 am

    This Python program runs in 58ms.

    from itertools import product, combinations
    from enigma import irange, printf
    
    def septitude(n):
      s = n + [29, -23, 15, -40, 31, 25, -37][n % 7]
      if s < 10: return s + 84
      if s > 99: return s - 84
      return s
    
    # check the examples we are given
    assert septitude(14) == 43
    assert septitude(15) == 76
    assert septitude(74) == 21
    
    # consider the puzzle:
    #
    #  a b
    #  c d
    #
    # cd > bd, so c > b
    
    for (a, d) in product(irange(1, 9), irange(0, 9)):
      for (b, c) in combinations(irange(1, 9), 2):
        # the answers in the cross figure puzzle
        s = (10 * a + b, 10 * a + c, 10 * b + d, 10 * c + d)
        # the septitudes of the answers
        ss = tuple(septitude(n) for n in s)
        # each answer must be the septitude of one of the answers
        if not(set(s).issubset(ss)): continue
        # print the solution
        printf("{a}{b}/{c}{d} [{s} => {ss}]")
    

    Solution: The solution to 1 across is 63. The solution to 3 across is 92.

    Enigma 1196 - Solution

    By repeatedly calculating “septitudes” we get the following cyclical chain: 63 → 92 → 69 → 32 → 63.

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: