rec.puzzles Archive

How do I solve letter substitutions (cryptarithms) like SEND + MORE = MONEY?

arithmetic/digits/cryptarithm Added material

Problem

How do I solve letter substitutions (cryptarithms) like
SEND + MORE = MONEY?
What are some more examples?
Show solution
Here are some additive cryptarithms (also called "alphametics").
The program below will find the unique letter substitutions
(assuming that the first digit is not zero) that work in these
examples:

A + CHILLY + LADY = GODIVA
ALL + ALPHA + METICS + SEEM = SIMPLE
BROWN + YELLOW = PURPLE
CARBON + COBALT + BORON = ELEMENT
CROSS + ROADS = DANGER
EASY + AS + ONE + TWO = THREE
FIRST + THREE + HORSES = TRIPLE
GEE + TAM + SEE + THEM = WEEDS
ICY + NORTH + OCEAN = ARCTIC
LET + THERE + BE = LIGHT
MARTIN + GARDNER = RETIRES
NACL + KCL + LICL = SALT
OH + YES + SHE = SAYS
PAPER + PENCIL + AND + AN = ERASER
RIDER + DROPS + REINS + HORSE = LOSES
SPANISH + SAILING + SHIP = GALLEON
SEND + MORE = MONEY
THE + LATE + THE + FUTURE = ARTHUR
WE + WANT + NO + NEW + ATOMIC = WEAPON

Here are some double-meaning examples from Journals from 1980 to 1984
that fit:

TWELVE + TWELVE + NINE + NINE + NINE + NINE + FIVE + FIVE = SEVENTY
SIXTEEN + TWENTY + TWENTY + TEN + TWO + TWO = SEVENTY
SIXTEEN + TWELVE + TWELVE + TWELVE + NINE + NINE = SEVENTY
THREE + NINE + NINE + NINE + TWENTY + THIRTY = EIGHTY
FIFTY + EIGHT + EIGHT + TEN + TWO + TWO = EIGHTY
FIVE + FIVE + TEN + TEN + TEN + TEN + THIRTY = EIGHTY
THREE + THREE + THREE + THREE + THREE + THREE + THREE + FIVE + FIVE +
FIVE + FIVE + FIVE + ELEVEN + ELEVEN + ELEVEN + ELEVEN = NINETY
SIXTY + EIGHT + THREE + NINE + TEN = NINETY
EIGHT + EIGHT + THREE + THREE + ONE + ONE + ONE + ONE + ONE + ONE + ONE
+ ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE =
FORTY

In Roman numerals:

I + IV + XIV + XLIV + XXII = LXXXV
DCL + DLIX + CDII = MDCXI
LIV + CCXIV + DCCI + MDCI = MDLX

In languages other than English:

AONO + AHIKU + AIWA + AWALU + UMI = KANAHA
JEDEN + JEDEN + JEDEN + JEDEN = CZTERY
SIETE + SIETE + TRECE + TRECE + VEINTE + TREINTA = NOVENTA
ZEVEN + TWEE + EEN + EEN + EEN = TWAALF

If numbers not made up a single word are allowed:

NINETEEN + THIRTEEN + SIXTEEN + THREE + THREE + ONE + ONE + ONE + ONE +
ONE + ONE + ONE = SIXTYONE
THIRTEEN + THIRTEEN + THIRTEEN + THIRTEEN + NINE + ONE + ONE + ONE +
ONE + ONE = SIXTYSIX

And for a really long one:

HUNDRED + HUNDRED + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE + THREE +
THREE + THREE + THREE + THREE + THREE + ONE + ONE + ONE + ONE + ONE +
ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE +
ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE +
ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE +
ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE +
ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE +
ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE +
ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE +
ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE +
ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE +
ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE +
ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE +
ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE +
ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE +
ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE +
ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE +
ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE + ONE +
ONE + ONE + ONE = THOUSAND

Here are some multiplicative cryptarithms, that the program will not
solve without extensions (so we give the solutions):

KISS x KISS = PASSION
2033 x 2033 = 4133089

MIN x NIE = MOUSE
321 x 124 = 39804

----------------------------------cut here----------------------------
#include <stdio.h>
#include <stdlib.h>

/*
 * Tom Magliery
 * National Center for Supercomputing Applications
 * 605 E. Springfield
 * Champaign, IL 61820
 * email:  mag@ncsa.uiuc.edu
 *
 * Generates a C program which will solve a given cryptarithm (is that
what
 * what they're called?).  Anyway, I mean puzzles like this:
 *
 *                                 s e n d
 *                               + m o r e
 *                               ---------
 *                               m o n e y
 *
 * where each letter stands for a different digit.  That particular
 * puzzle has 1 "interesting" solution (neither m nor s=0), and 24
 * "uninteresting" ones.
 *
 * The input is a character string of the form "send + more = money".
 * It may have any number of addends (including 1 or 0, in which case
 * the appropriate '+' and '=' are omitted).  There must be exactly one
 * space on either side of each '+' and '='.  Strange, unpredictable,
 * and most importantly, *incorrect*, behavior will probably result if
 * you don't follow these rules.
 *
 * The generated program runs with no arguments.  It tries every
possible
 * combination of digits and prints all that work, including ones with
 * leading zeroes in the addends and/or sum.
 *
 * The generated program is printed to standard output.  Redirect it to
 * a file with a ".c" extension and compile it.  Both this program and
 * the generated program are ANSI C.  It (they) may require some hacking
 * to work with a non-ANSI compiler.
 *
 */

typedef struct {
                char symbols[11];
                int num_of_addends;
                char** addends;
                char* sum;
               } REC;


void ParseInput (char*, REC*);
void printHeader (REC*);
void printMain (REC*);
void printMatch (REC*);
void printPrint (REC*);
int index_of (char, char*);


main (int argc, char**argv)
{
   REC* pzl = (REC*) malloc (sizeof (REC));

   if (argc<2)
      fprintf (stderr, "No problem.  ;-)\n");
   else {
      ParseInput (argv[1], pzl);
      printHeader (pzl);
      printMain (pzl);
      printMatch (pzl);
      printPrint (pzl);
      }
}



void ParseInput (char* problem, REC* pzl)
{
   char** words;
   int i, index, length = strlen(problem), spaces=0;

   /* record the different symbols used in the problem */
   for (i=0; i<11; i++) pzl->symbols[i] = '\0';
   for (i=0; i<length; i++)
      if (problem[i] != ' ' && problem[i] != '+' && problem[i] != '=')
         if (index_of(problem[i], pzl->symbols) == -1) {
            if (strlen(pzl->symbols) == 10) {
               printf ("Error -- too many symbols in problem.\n");
               exit (37);
               }
            pzl->symbols[strlen(pzl->symbols)] = problem[i];
            }

   /* count the spaces */
   for (i=0; i<length; i++)
      if (problem[i]==' ') spaces++;

   /* there is one more word than the number of spaces */
   /* WARNING:  not robust -- assumes no two consecutive spaces */
   words = (char**) malloc ((spaces+1)*sizeof(char*));

   /* set pointers to individual words */
   words[0] = problem;
   index = 1;
   for (i=0; i<length; i++)
      if (problem[i] == ' ')
         words[index++] = &problem[i+1];

   /*  make words null-terminated */
   for (i=0; i<length; i++)
      if (problem[i] == ' ')
         problem[i] = '\0';

   /* # of addends is always half # of spaces */
   pzl->num_of_addends = spaces/2;

   /* construct the list of addends */
   pzl->addends = (char**) malloc (pzl->num_of_addends * sizeof(char*));
   for (i=0; i<pzl->num_of_addends; i++)
      pzl->addends[i] = words[2*i];

   /* sum is the last 'word' on the list */
   pzl->sum = words[spaces];
}



void printHeader (REC* pzl)
{
   int i;
   printf ("/*\n");
   printf (" * Automatically-generated program to solve the");
   printf (" following cryptarithm:\n");
   printf (" *      ");
   for (i=0; i<pzl->num_of_addends; i++) {
      printf ("%s", pzl->addends[i]);
      printf ("%s", i<pzl->num_of_addends-1 ? " + " : " = ");
      }
   printf ("%s\n", pzl->sum);
   printf (" */\n");
}



void printMain(REC* pzl)
{
   printf ("#include <stdio.h>\n");
   printf ("#include <stdlib.h>\n");
   printf ("#define M %d\n", strlen(pzl->symbols));
   printf ("int tuple[10];\n");
   printf ("int Used[10] = {0,0,0,0,0,0,0,0,0,0};\n");
   printf ("void perm(int*, int);\n");
   printf ("int match();\n");
   printf ("void print();\n");
   printf ("main () {\n");
   printf ("   perm (Used, M);\n");
   printf ("}\n");
   printf ("void perm (int Used[10], int Size) {\n");
   printf ("int i;\n");
   printf ("if (Size == 1) {\n");
   printf ("   for (i=0; i<10; i++)\n");
   printf ("      if (!Used[i]) {\n");
   printf ("         tuple[M-Size] = i;\n");
   printf ("         if (match()) print();\n");
   printf ("         }\n");
   printf ("   }\n");
   printf ("else {\n");
   printf ("   for (i=0; i<10; i++) {\n");
   printf ("      if (!Used[i]) {\n");
   printf ("         Used[i] = 1;\n");
   printf ("         tuple[M-Size] = i;\n");
   printf ("         perm (Used, Size-1);\n");
   printf ("         Used[i] = 0;\n");
   printf ("         }\n");
   printf ("      }\n");
   printf ("   }\n");
   printf ("}\n");
}



void printMatch(REC* pzl)
{
   int a, i, len=strlen(pzl->sum), multiplier=1;

   printf ("int match () {\n");
   printf ("return !(");
   for (i=0; i<len; i++) {
      if (i>0) printf ("         ");
      printf ("%10d*(", multiplier);
      for (a=0; a<pzl->num_of_addends; a++) {
         if (i<strlen(pzl->addends[a])) {
            printf ("tuple[");
            printf ("%d",
                    index_of
(pzl->addends[a][strlen(pzl->addends[a])-i-1],
                              pzl->symbols));
            }
         else
            printf ("       ");
         if (a < pzl->num_of_addends-1)
            printf ("%s", i<strlen(pzl->addends[a]) ? "]+" : "  ");
         else
            printf ("%s", i<strlen(pzl->addends[a]) ? "]" : " ");
         }
      printf ("-tuple[");
      printf ("%d", index_of (pzl->sum[len-i-1], pzl->symbols));
      printf ("])");
      printf ("%s", i<len-1 ? "+\n" : ");\n");
      multiplier *= 10;
      }
   printf ("}\n");
}



void printPrint(REC* pzl)
{
   int i, j;
   char* current_addend;

   printf ("void print () {\n");

   printf ("printf (\"");
   current_addend = pzl->addends[0];
   for (i=0; i < pzl->num_of_addends; i++) {
      for (j=0; j<strlen(pzl->addends[i]); j++)
         printf ("%%d");
      printf ("%s", i<pzl->num_of_addends-1 ? " + " : " = ");
      }
   for (j=0; j<strlen(pzl->sum); j++)
      printf ("%%d");
   printf ("\\n\",\n        ");

   for (i=0; i<pzl->num_of_addends; i++) {
      for (j=0; j<strlen(pzl->addends[i]); j++)
         printf ("tuple[%d], ", index_of(pzl->addends[i][j],
pzl->symbols));
      printf ("\n        ");
      }
   for (j=0; j<strlen(pzl->sum); j++) {
      printf ("tuple[%d]", index_of(pzl->sum[j], pzl->symbols));
      printf ("%s", j<strlen(pzl->sum)-1 ? ", " : ");\n");
      }

   printf ("return;\n}\n");
}



int index_of (char ch, char* str)
{
   int i, len = strlen(str);
   for (i=0; i<len; i++)
      if (str[i] == ch)
         return i;
   return -1;
}

Additional material

Alphametic Puzzles (Truman Collins, 1998)
-----------------------------------------

An alphametic puzzle (also sometimes known as a cryptarithm) is a type
of puzzle where words are put together into an arithmetic formula such
that digits can be substituted for the letters to make the formula
true.  Here are two examples, the first being one of the simplest and
the second being probably the best known alphametic puzzle:

    I       S E N D
+ B B     + M O R E
-----     ---------
I L L     M O N E Y

In the first, I = 1, B = 9, and L = 0.

There are two rules that must be followed for solutions:
- The leftmost letter can't be zero in any word.
- There must be a one-to-one mapping between letters and digits.  In
  other words, if you choose the digit 6 for the letter M, then all of
  the M's in the puzzle must be 6 and no other letter can be a 6.

Around the time I finished graduate school (in computer science) I
wrote a program to solve addition alphametic puzzles.  It's now about
ten years later, and my wife and I have just had a baby.  I gave
Kristin the SEND + MORE = MONEY puzzle to do while she was nursing our
daughter.  She had fun solving it, and I found a few more for her.  I
thought it would be interesting to augment the program (written in C++)
I wrote before to search for puzzles given a set of words.  It turned
out to be pretty effective at finding new ones, so I'm making some of
them available on the net for anyone who's interested.  Incidentally,
my wife and I have only solved a few of these by hand.

I've found lots of valid puzzles, but I've only listed the ones here
that were at least a little more interesting than random related
words.  For example, I found 77 puzzles made out of state names.
I've just included ones where several states added together equal the
word "STATES".

All of the puzzles listed here have exactly one correct solution in base
10 (meaning the digits 0-9 are usable).  Incidentally, I've made
available a web-based puzzle solver in case you need some help.

The number in parenthesis after the puzzle is the estimated difficulty on
a scale from 1 to 5.  Note that this is determined via automation, so it
doesn't correspond in all cases with the difficulty a human has in
solving it.  It's really a guess at how hard the puzzle is.

BILL + WILLIAM + MONICA = CLINTON (4)

IDAHO + NEVADA = STATES (4)
ALASKA + KANSAS + NEVADA = STATES (4)
ALASKA + KANSAS + TEXAS = STATES (4)
HAWAII + MAINE + TEXAS = STATES (4)
IDAHO + MAINE + OHIO = STATES (4)
IDAHO + NEVADA + OHIO = STATES (5)
KANSAS + MAINE + NEVADA = STATES (5)
KANSAS + MAINE + OHIO = STATES (4)
HAWAII + IDAHO + IOWA + OHIO = STATES (4)
IDAHO + IOWA + OHIO + TEXAS = STATES (5)

COSTARICA + ERITREA + ESTONIA = COUNTRIES (5)
AUSTRIA + COSTARICA + CROATIA + IRAN = COUNTRIES (5)
AUSTRIA + COSTARICA + IRAN + RUSSIA = COUNTRIES (5)
COSTARICA + CROATIA + IRAN + RUSSIA = COUNTRIES (5)
COSTARICA + ERITREA + RUSSIA + TUNISIA = COUNTRIES (5)
AUSTRIA + COSTARICA + CROATIA + RUSSIA + TUNISIA = COUNTRIES (4)
COSTARICA + ERITREA + ESTONIA + IRAN + NAURU = COUNTRIES (5)
AUSTRIA + COSTARICA + ESTONIA + IRAN + NAURU + RUSSIA = COUNTRIES (5)

BEIGE + GREY = COLORS (2)
CORAL + ORANGE = COLORS (3)
GREEN + ORANGE = COLORS (3)
SIENNA + SILVER = COLORS (3)
AQUA + MAROON + SALMON = COLORS (4)
BEIGE + OLIVE + SILVER = COLORS (4)
BLACK + MAROON + SALMON = COLORS (5)
BLUE + CORAL + PURPLE = COLORS (4)
BLUE + OLIVE + SILVER = COLORS (3)
BLUE + PLUM + PURPLE = COLORS (3)
BROWN + CORAL + CYAN = COLORS (2)
BROWN + CORAL + SALMON = COLORS (4)
CORAL + CYAN + MAROON = COLORS (3)
CORAL + CYAN + ORANGE = COLORS (3)
CORAL + CYAN + SIENNA = COLORS (4)
CORAL + GREEN + SALMON = COLORS (5)
CORAL + MAROON + SALMON = COLORS (4)
CORAL + MAROON + TAN = COLORS (3)
CORAL + MAROON + TEAL = COLORS (4)
CORAL + OLIVE + SILVER = COLORS (3)
CORAL + OLIVE + VIOLET = COLORS (3)
CORAL + SIENNA + TAN = COLORS (4)
CYAN + GREEN + GREY = COLORS (2)
CYAN + GREEN + ORANGE = COLORS (3)
GOLD + OLIVE + SILVER = COLORS (4)
GREEN + ORANGE + SALMON = COLORS (4)
GREEN + ORANGE + TEAL = COLORS (4)
LIME + MAROON + SALMON = COLORS (4)
LIME + RED + SILVER = COLORS (2)
LIME + SALMON + SIENNA = COLORS (4)
LIME + SILVER + VIOLET = COLORS (4)
MAROON + NAVY + SALMON = COLORS (4)
MAROON + SALMON + SIENNA = COLORS (4)
MAROON + SALMON + TEAL = COLORS (4)
AQUA + CORAL + MAROON + SALMON = COLORS (4)
CORAL + CYAN + GREEN + GREY = COLORS (3)
CORAL + GOLD + GREEN + RED = COLORS (2)
CORAL + GREEN + MAROON + SALMON = COLORS (5)
CORAL + GREEN + ORANGE + SALMON = COLORS (5)
CORAL + GREEN + ORANGE + SIENNA = COLORS (5)
CORAL + GREEN + TAN + TEAL = COLORS (3)
CORAL + OLIVE + SILVER + TEAL = COLORS (4)
CYAN + GREEN + GREY + ORANGE = COLORS (4)
GOLD + GREEN + ORANGE + RED = COLORS (4)
OLIVE + SILVER + TEAL + VIOLET = COLORS (4)
CORAL + CYAN + MAROON + NAVY + SALMON = COLORS (5)
CORAL + GREEN + ORANGE + TAN + TEAL = COLORS (5)

CHESS + CHECK + KING = KNIGHT (3)
CHECK + MATE + KING = KNIGHT (3)
CHECK + KING + QUEEN = KNIGHT (4)

PACIFIC + PACIFIC + PACIFIC = ATLANTIC (3)

SATURN + URANUS = PLANETS (3)
SUN + URANUS + NEPTUNE = PLANETS (4)
MARS + SATURN + URANUS + NEPTUNE = PLANETS (5)
SATURN + URANUS + NEPTUNE + PLUTO = PLANETS (5)

GEMINI + VIRGO = CANCER (4)
GEMINI + LIBRA = CANCER (4)
TAURUS + PISCES = SCORPIO (4)
LEO + LIBRA + ARIES = PISCES (4)

DALI + MONET = RENOIR (2)
MATISSE + RENOIR = CASSATT (4)
RENOIR + SEURAT = GAUGUIN (3)
CASSATT + RENOIR = PICASSO (3)
MANET + SEURAT = RENOIR (4)
CASSATT + CEZANNE + MANET = MATISSE (4)
CASSATT + MATISSE + MIRO = PICASSO (4)
CASSATT + MATISSE + MONET = PICASSO (4)
DEGAS + INGRES + SARGENT + SEURAT = GAUGUIN (5)
CASSATT + MANET + MATISSE + MONET = PICASSO (4)
MANET + MATISSE + MIRO + MONET + RENOIR = CASSATT (5)
CASSATT + GAUGUIN = ARTISTS (4)
GAUGUIN + RENOIR = ARTISTS (3)
BOSCH + CASSATT + ESCHER = ARTISTS (4)
BRAQUE + RUBENS + SEURAT = ARTISTS (4)
CASSATT + COROT + INGRES = ARTISTS (4)
CASSATT + DEGAS + SEURAT = ARTISTS (4)
CASSATT + MANET + MONET = ARTISTS (3)
CASSATT + PICASSO + RENOIR = ARTISTS (4)
CASSATT + RUBENS + SEURAT = ARTISTS (5)
COROT + PICASSO + RENOIR = ARTISTS (4)
CEZANNE + MANET + MATISSE = ARTISTS (4)
DAVID + MATISSE + SEURAT = ARTISTS (4)
DEGAS + SARGENT + SEURAT = ARTISTS (4)
DURER + GAUGUIN + SEURAT = ARTISTS (4)
GOYA + INGRES + SARGENT = ARTISTS (3)
INGRES + MONET + RENOIR = ARTISTS (4)
INGRES + RODIN + SARGENT = ARTISTS (3)
MANET + RENOIR + SEURAT = ARTISTS (4)
MANET + RUBENS + SEURAT = ARTISTS (4)
CASSATT + COROT + DALI + DAVID = ARTISTS (3)
CASSATT + COROT + ESCHER + SEURAT = ARTISTS (4)
CASSATT + COROT + INGRES + SARGENT = ARTISTS (4)
CASSATT + COROT + MANET + MIRO = ARTISTS (3)
CASSATT + COROT + PICASSO + RENOIR = ARTISTS (4)
CASSATT + COROT + RENOIR + RODIN = ARTISTS (5)
CASSATT + INGRES + RENOIR + SARGENT = ARTISTS (4)
CASSATT + MANET + MIRO + RENOIR = ARTISTS (5)
CASSATT + MANET + MONET + RENOIR = ARTISTS (5)
CASSATT + MATISSE + MIRO + SEURAT = ARTISTS (4)
DAVID + DEGAS + INGRES + SARGENT = ARTISTS (4)
DAVID + DURER + MATISSE + SEURAT = ARTISTS (4)
DEGAS + DURER + INGRES + SARGENT = ARTISTS (4)
DEGAS + INGRES + MANET + MATISSE = ARTISTS (4)
DURER + MANET + MATISSE + SEURAT = ARTISTS (4)
GAUGUIN + INGRES + RENOIR + SEURAT = ARTISTS (5)
GOYA + INGRES + RENOIR + SARGENT = ARTISTS (4)
INGRES + MANET + MIRO + MONET = ARTISTS (3)
INGRES + MATISSE + MIRO + SARGENT = ARTISTS (4)
INGRES + MIRO + MONET + SARGENT = ARTISTS (4)
INGRES + RENOIR + SARGENT + SEURAT = ARTISTS (5)
MIRO + MONET + RENOIR + SARGENT = ARTISTS (5)
CASSATT + COROT + MANET + MIRO + RENOIR = ARTISTS (5)
CASSATT + COROT + MIRO + MONET + RENOIR = ARTISTS (5)
CASSATT + MANET + MIRO + MONET + RENOIR = ARTISTS (5)
COROT + MANET + MATISSE + MONET + RENOIR = ARTISTS (5)
COROT + MATISSE + MIRO + MONET + RENOIR = ARTISTS (4)
DURER + GAUGUIN + INGRES + SARGENT + SEURAT = ARTISTS (5)
INGRES + MANET + MATISSE + MONET + SARGENT = ARTISTS (4)
INGRES + MANET + MATISSE + SARGENT + SEURAT = ARTISTS (5)
INGRES + MANET + MIRO + MONET + SARGENT = ARTISTS (4)
INGRES + MATISSE + MIRO + MONET + RENOIR = ARTISTS (4)
MANET + MATISSE + MIRO + MONET + RENOIR = ARTISTS (4)
MANET + MATISSE + MONET + RENOIR + SARGENT = ARTISTS (5)
CASSATT + MANET + MATISSE + MIRO + MONET + RENOIR = ARTISTS (5)

SUMAC + ALDER + ELDER = TREES (4)
ALDER + MAPLE + ELDER = TREES (4)
ELM + ALDER + MAPLE + ELDER = TREES (4)
ALDER + MAPLE + ELDER + PALM = TREES (4)
ELM + ALDER + ASPEN + MAPLE + PALM = TREES (5)
ELM + ALDER + ASPEN + ELDER + PALM = TREES (5)
ALDER + ASPEN + MAPLE + ELDER + PALM = TREES (4)
ELM + ALDER + ASPEN + MAPLE + ELDER + PALM = TREES (4)

GOD + SODOM = BIBLE (2)
GOD + EVE + EVIL = BIBLE (2)
CAIN + SIN + MICAH + SARAH + CANAAN + ISAIAH + MANNA + NEHEMIAH +
  SACRAMENT = CHRISTIAN (4)

COMPLEX + LAPLACE = CALCULUS (2)
CIRCLE + ELLIPSE + EULER + SERIES + SUM = CALCULUS (2)
ABSCISSA + AREA + CIRCLE + EQUAL + EULER + SCALAR = CALCULUS (2)
AREA + CONE + LAPLACE + PARALLEL + POLAR + SCALAR + SLOPE = CALCULUS (3)
ARC + AREA + ELLIPSE + EULER + LAPLACE + SCALAR + SERIES + SUM =
  CALCULUS (3)

I don't have a particular interest in solving alphametic puzzles
myself, but I did enjoy writing the program to solve and generate them.
There are some other pages dealing with more exotic types of these
puzzles.  Mike Keith has created a page with interesting types of these
puzzles (http://members.aol.com/s6sj7gt/mikealp.htm), and Jorge Soares
has a page with more puzzles and links
(http://www.geocities.com/Athens/Agora/2160/).

-- Truman Collins <tcollins@teleport.com>, July 1998,
   http://www.teleport.com/~tcollins/alphamet/alphamet.html


The Alphametics Page (Mike Keith, c. 1998)
------------------------------------------

[ Editor: from Mike Keith's web page, the one Truman Collins points to
above, whose title is the alphametic ALPH + .A. = METIC. ]

Yes, this is it!  The official one and only Alphametic Page, dedicated
to that most elegant of puzzles (combining mathematical and word play)
with which I have been obsessed, on and off, for my entire adult life.
If you've never seen an alphametic, I'll show you what the fuss is all
about.  If you have, I will try to regale you some of my own creations
that have pushed the envelope of alphametic possibilities to new and
bizarre heights.

Some History and Philosophy

An alphametic is a peculiar type of mathematical puzzle, in which a set
of words is written down in the form of an ordinary "long-hand" addition
sum, and it is required that the letters of the alphabet be replaced
with decimal digits so that the result is a valid arithmetic sum.  For
an example one can do no better than the first modern alphametic,
published by the great puzzlist H.E. Dudeney in the July 1924 issue of
_Strand Magazine_:

     SEND
     MORE
    -----
    MONEY

whose (unique) solution is:

     9567
     1085
    -----
    10652

There are two fairly obvious (but worth stating) rules which every
alphametic obeys:

    1. The mapping of letters to numbers is one-to-one.  That is, the
    same letter always stands for the same digit, and the same digit is
    always represented by the same letter.

    2. The digit zero is not allowed to appear as the left-most digit in
    any of the addends or the sum.

Why are alphametics so cool?  For one thing, there is their economy:
with only a few words, a puzzle that can easily take half an hour to
solve can be written down.  The process of solving an alphametic is
itself interesting, often illustrating the triumph of logic over trial
and error.  The puzzle above (SEND + MORE = MONEY) is especially elegant
in this regard - it can be solved in a matter of seconds via a few
observations.

The other obvious attraction is that alphametics are hard to construct.
First of all, since we usually deal in base 10, only 10 different
letters of the alphabet (at most) can be used.  This, naturally, makes
it hard to write phrases or sentences that read well.  (There is a vague
analogy here to the difficulty of writing a long palindrome that reads
well.)  Even if we write down a nice phrase or sentence representing a
prospective alphametic, the odds that the alphametic will actually be
solvable are pretty small.  Finally, there is what I consider the most
important feature an alphametic should have (but which imposes an
additional harsh constraint on the constructor):

    Any truly elegant alphametic should have a *unique* solution.

This condition of uniqueness is often not required by alphametic
constructors.  They hack around this difficulty by presenting the
problem with a "side condition", such as "make the sum a prime number"
or some such statement.  In my opinion this is very inelegant, and so on
this page I only allow alphametics that have a unique solution.

The problem of alphametic construction can essentially be thought of as
a very difficult form of constrained writing: the object is to write a
phrase or sentence that (a) reads well, and (b) when considered as an
alphametic (with the last word being the sum word), it is solvable
(preferably with a unique solution).  For the last ten years or so, I
have primarily concentrated on this "meta-problem" - the construction of
ever-more-elaborate alphametics that have a unique solution.

In the following sections, I'll present the creme de la creme of
alphametic puzzledom - both traditional alphametics devised by others as
well as some of my unusual creations.  Every alphametic presented here
has a unique solution, which you are hereby encouraged to find!

By the way, the title of this page, ALPH + .A. + METIC [Editor: the
page heading shows ALPH and .A. added to give METIC], is a
uniquely-solvable alphametic, where the period is considered one of the
ten symbols to be replaced with digits.  In fact, in 1995 I proved that
this alphametic is the smallest uniquely-solvable alphametic containing
all 10 digits.  It is rather elegant that the smallest such alphametic
contains the word "alphametic", is it not?

Some Traditional Alphametics

In this section I list some of the nicer "traditional" alphametics I've
seen over the years.  For conciseness, I just write them as sentences.
It is understood that the first n-1 words are the addends and the nth
word is the sum, that case is to be ignored, and that punctuation is not
part of the alphametic (only the words).  There are basically two types:
phrases or lists, and complete sentences.

Phrases and Lists

    Fifty states: America.                  (Alister W. Macintyre)
    Terrible number thirteen.               (Steven Kahan)
    Earth, air, fire, water: nature.        (Herman Nijon)
    Saturn, Uranus, Neptune, Pluto: planets. (Peter J. Martin)
    Georgia, Oregon, Vermont, Virginia.     (Sidney Kravitz)

The 'planets' one is very elegant, since it lists precisely the last four
planets in the solar system.

Sentences

    Winter breeze bred bitter freeze.       (M.R.W. Buckley)
    Winter is windier, summer is sunnier.   (Brian Barwell)
    No snow in view on roofs in Venice.     (A.G. Bradbury)
    Martin Gardner retires.                 (H. Everett Moore)
    Nathan ate green peppers.               (Sidney Kravitz)
    Amelia peeled a banana.                 (Sidney Kravitz)
    Who is this idiot?                      (Sidney Kravitz)
    Romans also more or less added letters. (Steven Kahan)
    Gee, I see a rare magic square.         (Steven Kahan)
    Scientific American master creates frenetic interest in IMF metric
    (tens) state: fantastica!               (R.S. Johnson)

The last one here is a standout, because it reads well, is fairly long,
and contains some long words.  It also does a very nice job of not
looking like it only contains 10 distinct letters.  This alphametic
inspired me to tackle the following interesting question: what's the
longest word that can be worked into a uniquely-solvable alphametic?  My
best effort can be found in the New Literary Frontiers section.

The Doubly-True Genre

The doubly-true alphametic is an important sub-genre of alphametic
puzzledom that made its first appearance in 1969.  Since then, the
creator of this first puzzle, Steven Kahan, has published literally
hundreds more and has elevated the doubly-true alphametic to a high art
form.

A doubly-true alphametic is one with the following remarkable property:
the addends and the sum are "number words", and when read as words they
also form a valid addition sum.  Here is a simple example:

     THREE
     THREE
       TWO
       TWO
       ONE
    ------
    ELEVEN

This, as a matter of fact, is the "smallest" doubly-true English
alphametic with unique solution, where "smallest" means having the
smallest sum word (11).  In 1998 I conducted an exhaustive search of the
1,642,992,467 doubly-true alphametics with sum words TWO through
ONEHUNDRED, and found that there are exactly 47764 with a unique
solution.  Here are some more examples:

    SEVEN + SEVEN + SIX = TWENTY
    EIGHT + EIGHT + TWO + ONE + ONE = TWENTY
    ELEVEN + NINE + FIVE + FIVE = THIRTY
    NINE + SEVEN + SEVEN + SEVEN = THIRTY
    TEN + SEVEN + SEVEN + SEVEN + FOUR + FOUR + ONE = FORTY
    FOURTEEN + TEN + TEN + SEVEN = FORTYONE
    NINETEEN + THIRTEEN + THREE + TWO + TWO + ONE + ONE + ONE = FORTYTWO

Here are a few "long" examples.  The last one is the longest (most
number of addends), and also has the largest sum word (1000), of any
uniquely-solvable doubly-true alphametic I'm aware of.

    FOUR + THREE + THREE + THREE + THREE + ONE [24 times] = FORTY

    FOURTEEN + THREE + TWO + ONE [22 times] = FORTYONE

    NINETEEN + NINETEEN + TEN + TEN + TEN + TEN +
     NINE + NINE + NINE + NINE + NINE + ONE [877 times] = THOUSAND

New Literary Frontiers

In the "Traditional" section I present some examples of nice phrases or
sentences that are uniquely-solvable alphametics.  There's a vast,
relatively unexplored, expanse beyond the humble sentence: longer
sentences, poetry, special kinds of sentences (e.g., palindromes), and
so on.  It's not inconceivable that one could write an entire story in
which each sentence is a uniquely-solvable alphametic.  In this section
I present some alphametics I've constructed that open up new territory
in the literary realm.

First, a few poems.  Here is a native nursery rhyme from the mythical
island of Sevvoth that lies in the midst of the North Sea.  In this
poem, the words in the poem are the addends and the title of the poem is
the sum word.

                    Sevvoth

        Ten herons rest near North Sea shore
            As tan terns soar to enter there.
        As herons nest on stones at shore,
            Three stars are seen; tern snores are near!

Note that this poem has perfect meter.  A different type of constraint
is that imposed by the haiku, which consists of exactly three lines of
5, 7, and 5 syllables.  Here is a haiku (again, with the title being the
sum word) inspired by contemplating the flatness of glacial ice sheets:

                    Flatiana

        In Arctic terrain
        An ancient, eerie ice tract
        I enter a trance

Here is my best attempt so far to incorporate long words into an
alphametic.  This alphametic - a free-verse poem of sorts - contains a
17-letter word, which I believe is the current world record, along with
a large number of other long words.  Once again, the last word is the
sum.

        Realtor resales apparitions' sapiental stateliness,
            Entoparasite's reinterpretation piles settlor's
            interpenetrations.
        Representational spoorers snap sanitationist's
            retranslations...
            Representationist snootiness?  Si.  Snorers sin:
            sarsapirillas.
        Reinterpretation: "plenipotentiaries".

I once posed the following problem, which remained unsolved for several
years: find a sentence that is a uniquely-solvable alphametic and also a
palindrome.  Finally, Mike Staniforth of the U.K discovered four
examples, of which the two best are:

        Emit a mile, Lima time.
        Live Devo love devil.

and I subsequently found the following longer one, an extension of the
classic _Dennis and Edna sinned_ (in which "Dad-'n'-I" is interpreted as
one word (DadnI) for the purpose of the alphametic):

        Dennis, Nell, Edna, a Mr. Idi Amin, Dada, Dad-'n'-I, Maid Irma,
        and Ellen sinned.

My most involved literary alphametic is _The James B. Cabell Estate_ -
the first long poem written entirely in uniquely-solvable alphametics.
[ Editor: the poem was on a separate page, not included here. ]

"Found" Alphametics

In the late 1970's I constructed the uniquely-solvable alphametic

        Double, double, toil, trouble.

which is nearly a quote from Act IV, Scene 1 of _Macbeth_, missing only
the 'and' before 'trouble'.  Many years later, this inspired the search
for "found" alphametics - exact quotes from literature that just happen
to be uniquely-solvable alphametics.  Here are a few I've found:

        What was thy cause?                 (King Lear, Act IV, Scene 4)
        I think it be thine, indeed.        (Hamlet, Act V, Scene 1)

Chessametics

Lest you think that alphametic possibilities are limited to words, here
is a rather unusual type of alphametic I invented about twenty years ago
- the chess alphametic, or chessametic.

A good representative chessametic is the first one I published, in Vol.
8 No. 4 of the _Journal of Recreational Mathematics_ (1975).  Starting
from the initial position in chess, consider the following legal chess
game:

        P-K4   P-K4
        B-B4   P-R4
        Q-B3   P-R4
        QxP

......and checkmate: White says "I win!".

Amazingly, if we write all the moves of the game in a single column,
with White's final exclamation at the bottom, we obtain a solvable
alphametic, where the ten symbols to be replaced by digits are
P,K,B,R,Q,I,W,N,-, and x:

        P-K4
        P-K4
        B-B4
        P-R4
        Q-B3
        P-R4
         QxP
        ----
        IWIN

In a chessametic (or indeed, in any alphametic where some digits are
already given), any digits already shown in the puzzle are simply to be
left as is, and are still available to be substituted for one of the
symbols.

This puzzle has two slight shortcomings from a chess point of view: (1)
the two P-R4 moves are ambiguous (they could mean either KR4 followed by
QR4 or the reverse), but this makes no difference in the final game
position, and (2) in the last move (QxP), the fact that it is Black's
KBP that is captured has to be inferred from the stated fact that this
move is checkmate.  These flaws are somewhat offset by the fact that
this chessametic is of a very special kind, since it starts with the
chess pieces in their initial position.  It is, of course, much easier
to construct a chess alphametic where the starting position as well as
the moves are specified (as opposed to just the moves).

Here is another chessametic for your amusement.  This one is much longer
(12 1/2 moves!), also begins from the starting position, has no
ambiguities in the chess notation, is a much nicer chess game, and as an
alphametic has a unique solution.  In short, it's perfect!

          P-K4    P-K4
         N-KB3   N-QB3
          B-B4    N-B3
          P-Q4     PxP
           O-O    P-Q3
           NxP    B-K2
         N-QB3     O-O
         P-KR3    R-K1
          R-K1    N-Q2
           BxP     KxB
          N-K6     KxN
          Q-Q5    K-B3
         Q-KB5

......and Black loses, saying "Boo hoo!"

The total word, in this case, is BOOHOO.

Finally, here is an alphametic based on the game of checkers (a
checkermetic).  It uses algebraic notation to represent the moves, not
the traditional notation in which the 32 squares are numbered.  The
starting position (w and b represent white and black pieces, not Kings)
is:

                Black

         8    .   .   .   .
         7  .   .   .   .
         6    .   .   .   .
         5  .   .   .   .
         4    .   b   .   .
         3  .   .   b   .
         2    .   b   w   .
         1  .   w   .   w
            a b c d e f g h

                White

and the subsequent moves (White to move) are:

         g1-h2
         e3xg1
         c1xc5
        ------
        CURSES

At this point Black CURSES because White has won.  Again, the solution
is unique.

Alphametic Word Squares

Here's another strange type of alphametic:

        MANY
        EGOS
        ONCE
        SEAR

This nxn array has an amazing property.  If we attempt to solve it as an
alphametic (with the bottom word being the sum), subject to the side
condition of trying to maximize the numerical value of the sum, it has a
unique solution.  The same alphametic with the side condition "make the
value of the sum minimum" also has a unique solution.  If we rotate the
array by 90 degrees, the resulting array also has a unique solution
under each of the two side conditions!  And so does the array rotated by
180 and 270 degrees.  So, in all, there are eight interesting puzzles
contained within this single array.

This is a 4x4 alphametic word square.  Do larger word squares exist
(e.g., 5x5)?  Is it possible to make one that has words reading both
horizontally and vertically (i.e., a traditional word square)?  Is it
possible to make one that has a single unique solution for all four
puzzles (instead, as in this one, a unique solution for the conditions
max and min sum)?  These are all unsolved problems.

For an even more elaborate alphametic word square, see my puzzle L=-U
(http://users.aol.com/s6sj7gt/mikepuz.htm).

Order-n Alphametics

Here is a very bizarre type of alphametic: the order-n alphametic.  A
simple example is

        Thy hay myth.

where, as usual the last word is the sum.  The goal of this puzzle is
multifaceted.  First, find its unique solution.  Then, take each of the
three numbers (the two addends and the sum) in the solution and replace
each number (m) with f(m) = the last M digits of m^2 (where M is the
number of digits of m).  For example, if m=234, you would square it to
get 54756, then take the last three digits (756).  Next, replace all the
digits in the result by letters using the rule (A=1, B=2, ... J=10).
Consider what you have now as an alphametic, and solve it again!  Then
apply the function f(n) again, convert to letters, and solve again!  In
this remarkable puzzle, all three alphametics have a unique solution.

An alphametic of this type, in which n uniquely-solvable alphametics are
cleverly concealed, is referred to as an order-n alphametic (under some
function f(m), which must be specified).

I have constructed one order-4 alphametic, which you are hereby
challenged to solve:

        Tar star tree.

(with the same function f(m) as the one above).

So far I haven't devised any with order greater than 4, or with more
than three words.  But I'm sure they're out there waiting to be
discovered...

-- Mike Keith, http://users.aol.com/s6sj7gt/mikealp.htm

[ Editor: from the web page "Cryptarithms and Alphametics" by TRM,
which drew mostly on rec.puzzles and this archive.  Puzzles already
listed above are left out.  No solutions were given except SEND +
MORE = MONEY. ]

Cryptarithms, or alphametics as they are sometimes called, are
fascinating puzzles for the mathematically inclined.  Each letter
uniquely represents one digit.  The most famous cryptarithm is SEND +
MORE = MONEY with the unique solution: 9567 + 1085 = 10652.

Miscellany

MONEY + POP + SOME + MONEY = PLEASE
HE + SENT + HE + SENT + THE + TEN = THEN
SAMS + IDEA + MADE = SENSE (The IDEA wasn't ODD!)
SEE + YOU = SOON
HEAR + THOSE + THREE = CHEERS
THY + HAY = MYTH.
ROMANS + ALSO + MORE + OR + LESS + ADDED = LETTERS
GO * ON = TROT

Long Sentences:

SCIENTIFIC + AMERICAN + MASTER + CREATES + FRENETIC + INTEREST + IN +
IMF + METRIC + STATE = FANTASTICA!

A + TREE + IS + A + RARE + TREAT + I + SIESTA + AS + I + SIT + AT +
IT + I + STIR + AS + I + STARE + AT + SEA + AS + I + SIT + STARS +
RISE = NICELY.

DAD + AND + SON + SAT + ON + SOD + DAD + STOOD + AT + NOON, + AND +
SON + SOON + STOOD, + TOO + A + SAD + SON, + SANS + DAD, + STOOD +
AND + STOOD. + NO + DAD. + A + SAD, + SAD = FINALE.

REALTOR + RESALES + APPARITIONS + SAPIENTAL + STATELINESS, +
ENTOPARASITE'S + REINTERPRETATION + PILES + SETTLOR'S +
INTERPENETRATIONS. + REPRESENTATIONAL + SPOORERS + SNAP +
SANITATIONIST'S + RETRANSLATIONS... + REPRESENTATIONIST + SNOOTINESS?
+ SI. + SNORERS + SIN: + SARSAPIRILLAS. + REINTERPRETATION =
"PLENIPOTENTIARIES".

Politics

NO + GUN + NO = HUNT
FIFTY + STATES = AMERICA
MOON + MEN + CAN = REACH
UK + USA + USSR = ABOMB
DPRK + AND + ROK + GO + NON = NUKE (Minimal NUKE)
LYNDON x B = JOHNSON
TAYLOR + LINCOLN + CARTER = CLINTON
WHO + IS + THIS = IDIOT
MONTANA + MONTANA + MONTANA + MONTANA + MONTANA + MONTANA + MONTANA =
NEBRASKA
GEORGIA + OREGON + VERMONT = VIRGINIA

Battle of the sexes:

HE * HE = SHE
ALAS + LASS + NO + MORE = CASH
EVE/DID = .TALKTALK ...
FEMALES + AT + LAST + DEFEAT = EVEREST
MEN * AND = WOMEN
ADAM + AND + EVE = MOVED

Environment

EARTH + AIR + FIRE + WATER = NATURE
NORTH + SOUTH + EAST + WEST = EARTH (15 solutions to the general
equation, find the largest EARTH)
SATURN + URANUS + NEPTUNE + PLUTO = PLANETS
TITAN + ATLAS + MIMAS = DIONE
WINTER + BREEZE + BRED + BITTER = FREEZE
WINTER + IS + WINDIER + SUMMER + IS = SUNNIER
WORST + EAST + COAST = STORM (Find the biggest storm)

Mathematics and Science:

GEE + I + SEE + A + RARE + MAGIC = SQUARE
FERMAT * S = LAST + THEOREM. (L and O are interchangeable)
THREE is a prime number, FOUR is a perfect square, EIGHT is a perfect
cube.
FEET feet = INCHES inches
TERRIBLE + NUMBER = THIRTEEN
SEVEN + SEVENS = SQUARE

So appropriate:

OLD + SALT + TOLD + TALL = TALES
LETTERS + ALPHABET = SCRABBLE
WHEN + IN + ROME + BE + A = ROMAN

From Shakespeare:

I + THINK + IT + BE + THINE = INDEED (Hamlet, Act V, Scene 1)
ONCE + MORE + ONTO + THE = BEACH
DOUBLE + DOUBLE + TOIL = TROUBLE
WHAT + WAS + THY = CAUSE? (King Lear, Act IV, Scene 4)

Madison Avenue:

THE + SEVEN + SEVEN = TEASER
XMAS + MAIL + EARLY = PLEASE
SEND / A = GIFT (A very ODD GIFT)
CALL + 1800 + 2385355 + FEDERAL = EXPRESS

Miscellaneous:

WINNIE / THE = POOH
MUCHU + PICCHU = INDIAN
DIVER + DIVES + DEEP + IN = RIVER
DID + HE + READ + HER = DIARY
NATHAN + ATE + GREEN = PEPPERS
TALL + TOLL + TAKER + TOOK + SEAT + ON = STOOL (Find the largest
STOOL, in base 10 and 9)
AMELIA + PEELED + A = BANANA
ADAM + SAYS + YES + IM + ADAM = MADAM
ADAM + EVE + CAIN + ABEL = BIBLE (find the greatest BIBLE)
BONGO + BONGO + BONGO + ON + THE = CONGO
SUSIES + SISTER + SISSIE + SKIS + IN + SUSIES = BIKINIS
NO + SNOW + IN + VIEW + ON + ROOFS + IN = VENICE
PRETTY + POLLY + PARROT = REPEATS
CRABBY + CRABBY + TABBY + MAY = SCRATCH
REST + BREAK + AT + BAKER = STREET
TRIED + DRIVE = RIVET
POSH + CHOP = SHOP
DONALD + GERALD = ROBERT
DEVIL x 4 = LIVED
SHHH - S = ZZZ

French:

BIEN + BON + JOUR + BONNE = OEUVRE (The better the day, the better the
deed)
UN + UN + NEUF = ONZE
MARS + TERRE + SOLEIL = ASTRES
SABLE + SOLEIL = BIKINI
VALET + VALET + VALET + VALET = CARRE

Spanish:

DOS + DOS + TRES = SIETE

Italian:

PRESTO + LENTO + PRESTO = OCTUOR

Dutch:

WINNIE / DE = POEH
KOMETEN / 7 = HALLEY
HONDERD / TIEN = TIEN
DOZIJN / ZES = TWEE
STAAT + VAAK + MET + EEN + KRAAM + AAN + EEN + MARKT = KRAMER
EEN + EEN + EEN = DRIE (1 + 1 + 1 = 3)
EEN + DRIE + ZES = TIEN (1 + 3 + 6 = 10)
BIJ + TIP + ZIT + JE = GOED (ABR. TIP=THE INTERNET PLAZA)

Finnish/Swedish:

YKSI + YKSI + YKSI + YKSI + KAKSI = KUUSI and TRE + TRE = SEX
(1+1+1+1+2=6 and 3+3=6)

And now for the numbers, but numbers don't always work out nicely.

TWO x TWO = THREE

Doubly Correct (in order by answer)

7
THREE + THREE + ONE = SEVEN (THREE is divisible by 3 and SEVEN is
divisible by 7)
NINE + LESS + TWO = SEVEN

8
ONE + THREE + FOUR = EIGHT (FOUR is divisible by 8 and EIGHT is
divisible by 16)

11
FOUR + THREE + THREE + ONE = ELEVEN (FOUR is divisible by 4)
THREE + THREE + TWO + TWO + ONE = ELEVEN

20
SEVEN + SEVEN + SIX = TWENTY
EIGHT + EIGHT + TWO + ONE + ONE = TWENTY
ONE + ONE + ONE + THREE + THREE + ELEVEN = TWENTY

30
ELEVEN + NINE + FIVE + FIVE = THIRTY
[ Editor: the two THIRTY puzzles run together on one line in the
original. ]
NINE + SEVEN + SEVEN + SEVEN = THIRTY

40
FOUR + THREE + THREE + THREE + THREE + ONE [24 times] = FORTY
TEN + SEVEN + SEVEN + SEVEN + FOUR + FOUR + ONE = FORTY
TEN + TEN + NINE + EIGHT + THREE = FORTY (NINE is a perfect square)

41
FOURTEEN + THREE + TWO + ONE [22 times] = FORTYONE
FOURTEEN + TEN + TEN + SEVEN = FORTYONE

42
NINETEEN + THIRTEEN + THREE + TWO + TWO + ONE + ONE + ONE = FORTYTWO

60
FORTY + TEN + TEN = SIXTY

70
TWENTY + TWENTY + THIRTY = SEVENTY (2 soln)

72
3(TWENTY) + TWELVE = 9(EIGHT) (EIGHT is even, of course)

90
ONE + NINE + TWENTY + THIRTY + THIRTY = NINETY
20(FOUR) + 2(FIVE) = NINETY

94
3(TWENTYTWO) + 6(FOUR) + 2(TWO) = NINETYFOUR

1000
NINETEEN + NINETEEN + TEN + TEN + TEN + TEN + NINE + NINE + NINE +
NINE + NINE + ONE [877 times] = THOUSAND

A computer program to solve these puzzles can be obtained here.  This
is a program I wrote a few months ago.  This version is shareware and
is slower than the registered version.  Approximate size, zipped, ~110
KB.

Credits

  1. Glenn C. Rhoads, Rutgers University, Dept. of Computer Science,
     Piscataway, NJ
  2. Chris Cole and the ever-loving FAQ
  3. Journal of Recreational Mathematics, Various authors
  4. Hunter Madachy, Mathematical Diversions
  5. JA Hunter, Challenging Mathematical Teasers
  6. Rec.puzzles archive: http://alpha.acast.nova.edu/puzzles.html
  7. Gijsjebertix Van Uden

-- TRM, "Cryptarithms and Alphametics" web page

[ Editor: "Constrained cryptarithms", rec.puzzles, August 1996.  No
solution was posted in the collected material. ]

To me, the most satisfying cryptarithmetic problems are the ones with
some interesting constraints: like "SEND+MORE=MONEY" and
"DONALD+GERALD=ROBERT", where it produces some kind of message as well
as making a valid arithmetic problem when each of the letters is
substituted for a different digit.

In most cryptarithmetic problems in "The Cryptogram" (bimonthly
magazine of the American Cryptogram Association), the digit<->letter
key often spells out a keyword... but it's tricky both to get sense
from the equations and sense from the key.  Here's one I came up with
last night:

        PILFER + RIFFLE = TRUANT

The key (0-9) is two words, if you need anagramming help solving it.

Shameless plug:  If you enjoy doing these problems, the American
Cryptogram Association has over a dozen each issue, ranging from
additions to square roots and occasionally cube roots.  You can
subscribe by sending $20 to "ACA Treasurer, RR3, Box 987, Meredith NH
03253-9401" -- out of North America the prices are somewhat different;
see me if you need more info.

-- Jim Gillogly <jim@acm.org>

Number-word sums: the question behind them
------------------------------------------

[ Editor: the question to which Wei-Hwa Huang replied (June 1995) with
the number-word sums already listed in the entry above. ]

cpf@alchemy.Ithaca.NY.US (Courtenay Footman) writes:

>This is a truly beautiful problem:  the underlying word arithmetic
>problem is true (1+1+1+3+3+11 really does equal twenty), and the
>problem to be solved is a perfect arithmetic ciphers:  there are ten
>letters, each representing the numbers 0-9 once;  0-9 all occur in the
>puzzle, and there are no leading zeros.

>My question is "How many other puzzles meet all of these criteria?"
>(I do not know the answer to this!)

>To be precise, here are the criteria I am interested in:
>1)  The puzzle must be an arithmetic sum;
>2)  Each entry in the sum must be one of the twenty seven single word
>numbers 1-20, 30, 40, 50, 60, 70, 80, and 90;
>3)  The sum expressed in words must be correct (as in the 1+1... = 20
>problem)
>4)  The sum must form a proper arithmetic cipher, such that:
>A)  There are exactly ten distinct letters in all the words combined;
>B)  There is a _unique_ mapping between the letters and and the digits
>      0-9 that produces a correct numerical sum.
>C)  There are no leading zeros.

>Are there other solutions if the word "ZERO" is allowed in the sum?
>What if numbers not made up a single word are allowed?

CROSS + ROADS = DANGER
----------------------

In article <1994Jan19.162516.2844@crosfield.co.uk> jxk@crosfield.co.uk
(#John Kirk) writes:
>Fill in with one number for each letter to make addition correct.
>
>                        CROSS
>                     +  ROADS
>                       ------
>                    =  DANGER

solution:

d = 1, c = 9, r = 6, s = 3, a = 5, o = 2, n = 8, g = 7, e = 4

-- Christopher Simonich <simonich@twisto.compaq.com>, January 1994

Greek cryptarithms
------------------

In article <314CA298.1CFB@questrel.com>, Chris Cole
<chris@questrel.com> wrote:
> In languages other than English:
>
> SIETE + SIETE + TRECE + TRECE + VEINTE + TREINTA = NOVENTA
> AONO + AHIKU + AIWA + AWALU + UMI = KANAHA

In Greek language (from an old Greek periodical named "Labyrinth"):

1. DWDEKA + DWDEKA + DWDEKA + DWDEKA + DWDEKA = EJHNTA

2. TRITO + TRITO + TRITO = MONADA

3. ENAS + ENAS + ENAS + ENAS + ENAS = PENTE

4. PENTE + PENTE + TRIA + TRIA + TRIA = 55333

5. PENTE + PENTE + PENTE + EFTA + EFTA = 55577

6. PENTE + PENTE + PENTE + PENTE + TRIA = 55553

7. ENNIA * 2 = TRIA * 6

Translations:

DWDEKA = TWELVE
EJHNTA = SIXTY
ENAS = ONE,
ENNIA = NINE
EFTA = SEVEN
MONADA = UNITY (1)
PENTE = FIVE
TRIA = THREE
TRITO = 1/3

Enjoy!

-- Antreas P. Hatzipolakis <xpolakis@prometheus.hol.gr>, March 1996

How to solve them by hand: SEVEN - NINE = EIGHT
-----------------------------------------------

In article <4igb37$io8@news2.realtime.net>, jsimmons@bga.com (John
Simmons) wrote:

> Here's what seems to be a simple problem but I can't solve it.  Can
> someone solve it and explain the methodology for solving this type of
> puzzle?
>
>      S E V E N
>      - N I N E
>      ---------
>      E I G H T

John,

This is a long answer, so I'm going to break it into several sections.

I know someone else posted the rec.puzzles archive "solution" to this,
but I don't think the archived solution is a very useful answer
because:

(a) it describes only addition puzzles, not subtractions, and the
    program offered as a general solution will reject input with
    a minus sign, and the algorithm would need to be modified to
    work for subtractions,

(b) even if the program could solve subtractions (the modifications
    necessary are not large), it is not commented, and it would be
    hard for someone wanting to know how to solve such puzzles to
    decipher what the program is really doing (anyone who could
    interpret the program meaningfully probably already _knows_ how
    to solve cryptarithmetic puzzles),

and

(c) the algorithm it uses is a brute force elimination of alternatives,
    which is not usually an efficient way for a person to solve these
    puzzles, except when the alternatives have been reduced to a
    manageable number by more analytic methods.  Computers are great
    at keeping track of a lot of branching alternatives; people
    aren't.

The discussion in the next section is specific to subtraction puzzles,
but its lessons are easily transferred to addition puzzles.

Solving number subtraction puzzles
==================================

This is a discussion of how to solve encoded subtraction puzzles such
as SEVEN - NINE = EIGHT.

First, some terminology.  I will label the columns from right to left
starting with c1 as the rightmost column, c2 the next one, etc.  The
leftmost column will also be called the last column or 'cN'.

To avoid a lot of white space, I will refer to the contents of a column
inline rather than drawing them from top to bottom, as, e.g., "XYZ",
meaning X is on the top row and Z is in the result row.  I will use
letters near the beginning of the alphabet when describing a pattern of
_different_ letters in the puzzle and letters near the end of the
alphabet when they might be the same, e.g., in ABC, none of the digits
are equal, whereas in XYZ, any of the digits could be equal, and in
AXY, X and Y might be equal to each other, but neither of them equals
A.  If I describe a pattern with two A's and an X, the X may or may not
equal A.

It sometimes helps to make a notation for each column as to whether
there was borrowing into or out of it.  In the discussion tex, I will
use ">> cx" to mean there was borrowing into cx from c(x+1), and
"cx >>" to mean there was borrowing out of cx into c(x-1).  In the
diagrammed puzzle, I mark this as a single > over the column borrowed
from.

If a column cx contains XYZ, then there are 4 possibilities:

   Y+Z=X      if not >> cx and not cx >>
   Y+Z=X-1    if not >> cx, but cx >>
   Y+Z=X+10   if >> cx, but not cx >>
   Y+Z=X+9    if >> cx and cx >>

For difficult puzzles, it sometimes helps to make a chart with the
possible values for each letter, e.g., "G: 2 3 5 6 7", and cross them
off as they are eliminated.

Also keep a running chart of the known relationships, such as A < B, or
A=B+2.  Then when values are ascertained or eliminated for one letter,
one can compute or eliminate values for the other letters in the
relationship.

I find it easiest to start with the following steps:

Step 1. Look for obvious zero's and nines, and eliminate obvious
        non-zeros.

Cryptarithmetic puzzles never contain leading zeros, so any letter
appearing as the leftmost digit of any number-word cannot be a zero.

The patterns AAX and AXA in c1 indicate that X is a zero.  (These
patterns cannot appear in cN, because all digits in cN are leading
digits.)  In an internal column cx, these patterns could be satisfied
by X=0 if not >> cx and not cx >>, or by X = 9, if >> cx >>.  Often
other areas of the puzzle will eliminate one of the two possibilities,
allowing one to establish not only the value of X, but the borrowing
status of cx and neighboring columns.  (Alas, the SEVEN - NINE = EIGHT
puzzle has neither of these patterns.)

Step 2. Look for successor relationships.

The pattern "A_B" in cN (i.e., the second row has fewer digits than the
top row and the result) implies that B = A-1, and that cN >>.  Note
that when this pattern is noticed, one can also eliminate 1 as a
possible value of A (since B can't be 0).

Step 3. Try to establish which columns have borrowing, and then look
        for implied orderings.

There is never c1 >> or >> cN.  Steps 1 and 2 may also determine some
of the borrowing state.  If not >> cx for cx whose contents is AXY (for
non-zero X,Y, and remember this notation means X and Y aren't A), then
X and Y are both less than A.  If >> cx, then X and Y are both greater
than A.  (Nothing is implied about the relative order of X and Y,
though.)

Usually after that it becomes ad hoc, in a strict subtraction puzzle.
Each inference will suggest another.

The next section will solve your specific example.

column:   5 4 3 2 1
          > > >
          S E V E N
        -   N I N E
        -----------
          E I G H T

Inference                  By:

(a)  S, E, N, and T are not 0.   c1 and c5
(b1) S = E+1               c5
(b2) c5 >> c4              c5
(c)  E < N                 c4, (b2)
(d1) T+E = N               c1, (c)
(d2) not c2 >> c1          c1, (c)
(e)  c3 >> c2              c2, (c)
(f)  N+H = E+10            c2, (d2), (e)
(g)  N+I = E+9             c4, (b2), it can't be E+10 by (f)
(h)  c4 >> c3              (g)
(i)  I+G = V+9             c3, (e), (h)
(j)  I+1 = H               (f), (g)
(k)  S > 1                 (a), (b1)
(l)  T > 1                 (b1), (d1)
(m)  N > 2                 (a), (b1), (c)
(n)  E < 8                 (d1), (l)
(o)  I < 9 ; H > 0         (j)
(p)  N < 9                 (g) (if N=9 then E=I)
(q)  N+I = S+8             (g), (b1) (this form is useful for ...)
(r)  N < 8; I < 8          (q) (if N=8 I=S or if I=8, N=S)
(s)  E < 6                 (r), (l), (d1)
(t)  S < 6                 (q), (r)  (N+I <= 13 => S = N+I-8 <= 5)

At this point on this puzzle I would stop doing calculations based on
the three starting steps, and start trying alternatives to see which
ones lead to contradictions (two implied values for the same letter),
or duplications (two letters having the same value).  It is a matter of
experience when it is most efficient to make the switch in tactics, but
usually it works when at least one variable has been reduced to only
three or four possible choices, and there are enough constraints
identified to calculate at least two other dependent variables from the
one you are trying alternatives for.  This is usually enough to
generate contradictions from a wrong choice.

The best letter(s) to start at are those with the fewest alternatives,
or the most implications.  In this puzzle, E and N are fairly closely
tied for that status, but E wins out because it implies a value for S.

So, using (g) and (r)
if E,S are 4,5, then (g) N+I=13 => N&I are 7&6
if E,S are 3,4, then (g) N+I=12 => N&I are 7&5
if E,S are 2,3, then (g) N+I=11 => N&I are 7&4 or 6&5
if E,S are 1,2, then (g) N+I=10 => N&I are 7&3 or 6&4

If N&I only differ by 1, then N must be the lesser, or H and N would
both be I+1.  If the differ by at least 2, though, they could be in
either order.  (Based on the deductions so far, of course.  In reality
the whole solution is determined.)

Now let's see which of the above possibilities permit a solution for
the remaining letters, H, T, V and G.  I will rewrite some of the
expressions above as definitions for these letters:

   H = I + 1               (j)
   T = N - E               (d1)
   H = E + 10 - N          (f)
.: T = 10 - H
   V = (H+G) - 10          (i), (j)
   V = G - T

Try E,S,N,I = 4,5,6,7  =>  H = 8 by (j), T = 2 by (d1), agrees with
                  (f), leaving 0,1,3,9, of which only 1 & 3 differ by
                  T (2).  So V = 1, G = 3.

Ha!  The first one we tried worked!  Well, let's see what contradictions
we get with the others anyway.  (If the subtraction was part of a
larger puzzle, such as the division puzzles discussed below, we would
need to check whether the solution to the subtraction was unique before
making the assignments.)

Try E,S,N,I = 3,4,5,7 =>  H = 8, T = 2,
                    leaving 0,1,6,9, none of which differ by T (2).
Try E,S,N,I = 3,4,7,5 =>  H = 6, T = 4, which duplicates S=4
Try E,S,N,I = 2,3,4,7 =>  H = 8, T = 2, which duplicates E=2
Try E,S,N,I = 2,3,7,4 =>  H = 5, T = 5, which duplicates 5
Try E,S,N,I = 2,3,5,6 =>  H = 7, T = 3, which duplicates S=3
Try E,S,N,I = 1,2,3,7 =>  H = 8, T = 2, which duplicates S=2
Try E,S,N,I = 1,2,7,3 =>  H = 4, T = 6,
                    leaving 0,5,8,9, none of which differ by T (6).
Try E,S,N,I = 1,2,4,6 =>  H = 7, T = 3,
                    leaving 0,5,8,9.  Hmm.  5 and 8 differ by 3.
                    So V = 5, G = 8 also works.
Try E,S,N,I = 1,2,6,4 =>  H = 5, T = 5, which duplicates 5.

So there are two possible solutions to SEVEN - NINE = EIGHT, as
follows:

   5 4 1 4 6        2 1 5 1 4
   S E V E N        S E V E N
 -   6 7 6 4      -   4 6 4 1
     N I N E          N I N E
   ---------        ---------
   4 7 3 8 2        1 6 8 7 3
   E I G H T        E I G H T

Solving number division puzzles
===============================

The most commonly encountered kind of number arithmetic problems are
the "word division" puzzles seen in many puzzle magazines.  One can go
very far on word division puzzles by using only the information in the
subtraction steps.  There are some additional kinds of inference that
can be made in division puzzles, though, by taking into account the
multiplications.

In division puzzles, I will call the numbers that are obtained by
multiplying the divisor by a quotient digit the "d-multiples".  (They
will also be the second rows of the subtraction steps.)

*  Look for a d-multiple being the same as the divisor, which indicates
   that the corresponding quotient digit must be 1.

*  Look for two consecutive dividend digits being dropped down for a
   single subtraction step, which indicates that the quotient digit for
   the "skipped" multiplication was a zero.

*  When a number ending in zero occurs in c1 of some d-multiple, that
   means either the rightmost digit of the divisor, or the
   corresponding digit of the dividend, is 5, and the other of those
   two factors is an even number.  Checking other rows may help
   establish which is the case.  If some other d-multiples end in
   anything other than 0 or the rightmost digit of the divisor, then
   the 5 must be the quotient digit.  Beware, though: if all the
   d-multiples contain either 0 or the rightmost digit of the divisor,
   it is no guarantee that the 5 is the rightmost divisor digit.  The
   d-multiples containing matching rightmost digits could be due to
   multiplication of any even number by 6.

*  If you have determined that one d-multiple is less than another
   (usually from the subtraction steps), then the corresponding
   quotient digits have the same order relationship.  (This, like all
   the other tips, is trivial as an arithmetic rule, but novice solvers
   often overlook it, unlike the zero and one rules, which are hardly
   ever overlooked.)

*  Use what you know about the value or range of values for the
   leftmost digit of a d-multiple, the leftmost digit of the divisor,
   and the corresponding digit of the quotient to constrain the range
   of possible values for the others.  E.g., if the divisor is XYZ, and
   one step of the puzzle includes the multiplication D * XYZ = QRS,
   then you know that Q is between the leftmost digit of D*X, and the
   leftmost digit of D*(X+1).

That should be enough to enable you to solve these on your own.

*  When you get down to the eliminating alternatives stage, it helps
   (if they aren't second nature to you) to make a pair of special
   multiplication tables which lists the first and second digit of each
   multiplication separately, since the d-multiples will tell you
   something like "A*B ends in C".

-- Teri Pettit <pettit@adobe.com>, March 1996

MEAT + BALLS + MAKE + SMALL = MEALS
-----------------------------------

In the following sum each letter represents a digit from 1 to 9.  Given
that B=2, make the sum work:

         MEAT+BALLS+MAKE+SMALL=MEALS

-- Celso G. Lima <cglima@centroin.com.br>, March 1996

[ Editor: no solution was found in the collected postings. ]

ABRA + CA + DABRA = KAZAAM
--------------------------

Following the same theme as the recent HOCUS+POCUS puzzle, substitute
each letter with a single digit to make the statement true.  Only one
rule: no digit can be represented by more than one letter (i.e., if "A"
is "2", "B" cannot also be "2").

                                    ABRA
                                      CA
                                +  DABRA
                                --------
                                  KAZAAM

-- Bill Frolik <bill@hpcvxbf2.cv.hp.com>, November 1996

I get this puzzle as unsolvable in base 10.  K must be 1, the only
possible overflow from two digits.  In that case, A must be 1 or 0 from
the 2nd column (D+[1|2] overflows, so D must be 8 or 9 and D+o
therefore must be 0 (9+1,8+2) or 1 (9+2)).  Unfortunately, since we
need an overflow from the third column (A+A+o), A must be at least 4
which is a contradiction.  Of course all of this presumes an "honest"
puzzle, in which an indicated overflow digit (K in this case) is
non-zero

-- Bob Stearns <is@groucho.dev.uga.edu>, November 1996

LetterEq, a solver
------------------

Terry Frangakis wrote:
> A long time ago I saw a posting about a program that someone wrote to
> solve word-type puzzles eg.
>
>  ONE
> +TWO
> ---------
> THREE
>
> Can someone please point me to a site where I can find it?

It was I.

click to download LetterEq:
 http://eureka.vermontel.com/~kms/vrsion21.zip

Please send me any good ones that don't appear here:
 http://eureka.vermontel.com/~kms/Cryptarithms.html

-- TRM ("Toby") <diogenes@mail.tds.net>, March 1998