0%

Problem 98


Problem 98


Anagramic squares

By replacing each of the letters in the word CARE with $1$, $2$, $9$, and $6$ respectively, we form a square number: $1296 = 36^2$. What is remarkable is that, by using the same digital substitutions, the anagram, RACE, also forms a square number: $9216 = 96^2$. We shall call CARE (and RACE) a square anagram word pair and specify further that leading zeroes are not permitted, neither may a different letter have the same digital value as another letter.

Using words.txt (right click and ‘Save Link/Target As…’), a 16K text file containing nearly two-thousand common English words, find all the square anagram word pairs (a palindromic word is NOT considered to be an anagram of itself).

What is the largest square number formed by any member of such a pair?

NOTE: All anagrams formed must be contained in the given text file.


重排平方数

将单词CARE中的四个字母依次赋值为$1$、$2$、$9$、$6$,可以得到一个平方数:$1296 = 36^2$。神奇的是,使用同样的赋值规则,重排后的单词RACE同样对应于平方数:$9216 = 96^2$。我们因此称CARE和RACE为重排平方单词对,并且要求类似的单词对不允许有前导零,且不允许给不同字母赋相同的值。

在文本文件words.txt中包含了将近两千个常用英文单词,找出其中所有的重排平方单词对(一个回文单词不视为它自己的重排)。

在这些单词对中,通过赋值所能得到的最大平方数是多少?

注意:所有的重排单词必须出现在给定的文本文件中。