The World of Astoria Bob

Create and Solve Number Puzzles

Course Outline

January 23
Algorithms and Pseudocode
Krypto card game
Insumnia and Countdown Numbers

January 30
Magic Squares
Kakuro
Yohaku
Other Arithmetic Square Puzzles

February 6
Crossnumber Puzzles
Crossword/number Hybrids
Crossword Puzzles
Short Exploration of Other Puzzle Types


Notes for Week 3

Crossnumber Puzzles

I recently created another crossnumber puzzle in Crosshare. I can share it with class, or share some of the other puzzles I've made. This puzzle was made starting with filling in the grid (the answers) first, then making up clues to get to the numbers in the grid. It has the advantage that creating the grid is just random, and the only digit that doesn't work is 0 in the first position of a clue number. One could conceive of a computer program that fills in the grid completely randomly, then checks for zeros in the wrong places and changes them. A computer program to come up with clues would be cool. There are already lots of them to do words, which I think are harder.

I've created a few other crossnumber puzzles in Crosshare and another puzzle interface called Puzzle Me, from Amuse Labs. We'll take a little tour of these two platforms (which are somewhat interrelated) so students can get an idea of what's out there in terms of creating your own crossword/number puzzles and viewing and solving others. The Puzzle Me (Amuse Labs) interface is a little harder to create a symmetric grid, but does allow HTML tags in the clues, which makes for a clearer final puzzle for math-based clues.


Online Compendium of Crossnumber Clues

There are several online resources which can help with clues for crossword puzzles, but none that I know of that help with crossnumber puzzles. So... I started one! Currently only filled with some clues for the number 1, it will eventually (I hope) have thousands or millions of clues for numbers up to and maybe exceeding 12 or 13 digits. The idea is solicit input from puzzle creators, and even to have an app that scoops up the crossnumber puzzle clues for inclusion in this database. It can then be a resource for lazy crossnumber puzzle creators, or entertainment for geeks the world over! For now, the OC3 resides on my website. Check it out!


Chemistry-themed Crossword Puzzles

Here's another puzzle I created which has chemistry and math in the grid, making it unnecessary to use software or luck to fit words into the standard types of grids.

You can really play around with chemical formulas and numbers in a grid like this, so that you learn all sorts of things about both. You can design the grid any way you want, and after a while, Crosshare gives up on trying to find words for you. The even more fun part will be coming up with cheeky clues for these grid answers. My favorite above, and one I didn't know about, is E261, which is potassium acetate, or K+ CH3COO-, which is a food additive. I started filling in the grid from the upper left, but it doesn't matter.


Other puzzle types and more resources

Another resource is the Cross-Number Puzzle Generator from WorksheetWorks.com. Here's an example of a 10x10 crossnumber puzzle (with solution). Here is another crossnumber puzzle playing site. This and more puzzle sites are available on my website. I'm especially fond of the alphametic/cryptorithmic puzzles, so we will briefly look at them in class.

Here's a short math puzzle I stole off the Math Is Fun website: Can you arrange the numerals 1 to 9 (1, 2, 3, 4, 5, 6, 7, 8 and 9) in a single fraction that equals exactly 1/3 (one third)? This might be a good candidate for our brute force algorithm. We could decrease the iterations necessary by only trying a four-digit numerator divided by a five-digit denominator, since you can't repeat and this would be the only possible combination that would come close to ⅓. Giving the problem to ChatGPT, here's the Javascript script it came up with, and the answer, gotten in about 5 seconds:

  function solvePuzzle() {
   let numerator, denominator, fraction;

   for (denominator = 12345; denominator <= 98765; denominator++) {
    for (numerator = 1234; numerator <= 9876; numerator++) {
      fraction = numerator / denominator;
      if (fraction === 1/3) {
        let numeratorDigits = ('' + numerator).split('');
        let denominatorDigits = ('' + denominator).split('');
        let allDigits = numeratorDigits.concat(denominatorDigits);
        if (allDigits.sort().join('') === '123456789') {
          console.log(numerator + "/" + denominator);
          }
        }
      }
    }
  }

  solvePuzzle();

There are 2 solutions:

  5823/17469, 5832/17496

I really love the way ChatGPT put together a fraction from a group of digits!! (Note that if using this script on a website, the console.log() line would instead be document.write()).

This problem is typical of the kind of number problems that exist in puzzle books and websites. Again, though maybe some of the fun of trying to solve it on your own is lost with this computer solution, we can maybe make it up by being able to examine related problems, like is there a solution if the desired fraction is ½? Or are there solutions that are close to a particular simple fraction target? Maybe some other combination of digits? Exploring these meta problems can be fun as well!

Tweaking the script above to cycle through all the unit fractions from 1/2 to 1/19, we get the following solution set:

1/2 = 6729/13458, 6792/13584, 6927/13854, 7269/14538, 7293/14586, 7329/14658, 7692/15384, 7923/15846, 7932/15864, 9267/18534, 9273/18546, 9327/18654
1/3 = 5832/17496, 5823/17469
1/4 = 3942/15768, 4392/17568, 5796/23184, 7956/31824
1/5 = 2697/13485, 2769/13845, 2937/14685, 2967/14835, 2973/14865, 3297/16485, 3729/18645, 6297/31485, 7629/38145, 9237/46185, 9627/48135, 9723/48615
1/6 = 2943/17658, 4653/27918, 5697/34182 
1/7 = 2394/16758, 2637/18459, 4527/31689, 5274/36918, 5418/37926, 5976/41832, 7614/53298
1/8 = 3187/25496, 4589/36712, 4689/37512, 4591/36728, 4691/37528, 4769/38152, 5237/41896, 5371/42968, 5789/46312, 5791/46328, 5839/46712, 5892/47136, 5916/47328, 5921/47368, 6479/51832, 6741/53928, 6789/54312, 6791/54328, 6839/54712, 7123/56984, 7312/58496, 7364/58912, 7416/59328, 7421/59368, 7894/63152, 7941/63528, 8174/65392, 8179/65432, 8394/67152, 8419/67352, 8439/67512, 8932/71456, 8942/71536, 8953/71624, 8954/71632, 9156/73248, 9158/73264, 9182/73456, 9316/74528, 9321/74568, 9352/74816, 9416/75328, 9421/75368, 9523/76184, 9531/76248, 9541/76328
1/9 = 6381/57429, 6471/58239, 8361/75249
1/12 = 6129/73548, 7461/89532, 7632/91584, 3816/45792
1/13 = 5184/67392, 6273/81549, 7281/94653 
1/14 = 4713/65982, 1839/25746, 1956/27384, 2967/41538, 3297/46158, 3678/51492, 3912/54768
1/15 = 6183/92745, 1863/27945
1/16 = 4581/73296, 6147/98352, 2871/45936
1/17 = 1579/26843, 1679/28543, 1738/29546, 2174/36958, 2689/45713, 2693/45781, 3217/54689, 3478/59126, 3821/64957, 3841/65297, 3952/67184, 3954/67218, 4519/76823, 4523/76891, 4596/78132, 4619/78523, 4623/78591, 4796/81532, 4916/83572, 4921/83657, 5261/89437, 5263/89471, 5273/89641, 5378/91426, 5461/92837, 5463/92871, 5478/93126
1/18 = 1593/28674
1/19 = 2736/51984, 4293/81567

Can anyone spot a pattern? Can we name the fractions that have no corresponding answers to this puzzle (1/10 and 1/11) a certain kind of number? How about the fractions that are unique solutions, like 1593/28674 (1/18)? These are the kinds of things a brute-force solution by computer can bring out. Cool!


Ultimate TicTacToe

This looks like a great site! Also, this site is good. Ultimate tic tac toe was brought up by a student in the week 2 class. It doesn't involve math, but is a good variation on the original that takes a little more brainpower to play.


I also recommend the recreational math website recmath, despite its age. Some cool stuff! Unfortunately, there doesn't seem to be a recreational math website that is maintained currently. Maybe we can try to resurrect such a site! Students should email me with any puzzle sites they think are good, and I'll take a look. There's a lot of garbage and ad-filled sites out there, but I'm sure there are gems that would be great to publicize.


Set

We finished the last night of class looking at the website for Set, a pattern-matching logic puzzle that is wildly popular around the world. Take a peek at the daily puzzle and see if you can solve it!


Puzzle Night

For those students that are interested, I intend to follow through with the suggestion made in the first class to have a puzzle night each week at a local public venue, where we could all bring puzzles to share, or where we pick a puzzle master each week, and they bring puzzles to share. I'll be asking in class if there is a good time for students and/or a good place. It could be a social event that also allows us to indulge our puzzle passions. These weekly or biweekly events will probably start in early March.