superprismatic Posted September 23, 2009 Report Share Posted September 23, 2009 A certain 10-letter word having the second and fifth letters the same is treated as follows: the first two letters are multiplied together (using the values A=1, B=2, ..., Y=25, Z=0); then the next two letters are similarly multiplied together and the two products added (mod 26). The sum is reconverted into a letter using the same correspondence. The same operations are performed on letters 2 to 5 producing another letter. This is continued until the seventh letter is produced from the last four letters of the word. The letters so generated are, in order, FPSLMMZ. What is the word? Quote Link to comment Share on other sites More sharing options...
0 Guest Posted September 24, 2009 Report Share Posted September 24, 2009 perfection Quote Link to comment Share on other sites More sharing options...
0 Guest Posted September 24, 2009 Report Share Posted September 24, 2009 perfection Really confused how did you get this answer? Quote Link to comment Share on other sites More sharing options...
0 Guest Posted September 25, 2009 Report Share Posted September 25, 2009 Really confused how did you get this answer? Run this python script in a folder with a text file in it called wordlist.txt which is a list of English words (that contains the correct word). I think that formatting gets messed up, so I will use a ~ sign for indentation rather than just a space. #!/usr/bin/python def translate(s): ~st = ''; ~for k in range(len(s)-3): ~~p = ord(s[k]); ~~if p < 97: ~~~a = (p-64) % 26; ~~else: ~~~a = (p-96) % 26; ~~p = ord(s[k+1]); ~~if p < 97: ~~~b = (p-64) % 26; ~~else: ~~~b = (p-96) % 26; ~~p = ord(s[k+2]); ~~if p < 97: ~~~c = (p-64) % 26; ~~else: ~~~c = (p-96) % 26; ~~p = ord(s[k+3]); ~~if p < 97: ~~~d = (p-64) % 26; ~~else: ~~~d = (p-96) % 26; ~~ch = (a*b+c*d) % 26; ~~if ch == 0: ~~~ch += 26; ~~ch = chr(ch+64); ~~st += ch; ~if st == 'FPSLMMZ': ~~print s, st; x = open('wordlist.txt').read() import re; z = re.findall('[^a-zA-Z]([A-Za-z]([A-Za-z])[A-Za-z]{2}\\2[A-Za-z]{5})[^a-zA-Z]',x); for k in z: ~translate(k[0]); Quote Link to comment Share on other sites More sharing options...
0 Guest Posted September 25, 2009 Report Share Posted September 25, 2009 Run this python script in a folder with a text file in it called wordlist.txt which is a list of English words (that contains the correct word). I think that formatting gets messed up, so I will use a ~ sign for indentation rather than just a space. #!/usr/bin/python def translate(s): ~st = ''; ~for k in range(len(s)-3): ~~p = ord(s[k]); ~~if p < 97: ~~~a = (p-64) % 26; ~~else: ~~~a = (p-96) % 26; ~~p = ord(s[k+1]); ~~if p < 97: ~~~b = (p-64) % 26; ~~else: ~~~b = (p-96) % 26; ~~p = ord(s[k+2]); ~~if p < 97: ~~~c = (p-64) % 26; ~~else: ~~~c = (p-96) % 26; ~~p = ord(s[k+3]); ~~if p < 97: ~~~d = (p-64) % 26; ~~else: ~~~d = (p-96) % 26; ~~ch = (a*b+c*d) % 26; ~~if ch == 0: ~~~ch += 26; ~~ch = chr(ch+64); ~~st += ch; ~if st == 'FPSLMMZ': ~~print s, st; x = open('wordlist.txt').read() import re; z = re.findall('[^a-zA-Z]([A-Za-z]([A-Za-z])[A-Za-z]{2}\\2[A-Za-z]{5})[^a-zA-Z]',x); for k in z: ~translate(k[0]); ok still confused but it looks impressive Quote Link to comment Share on other sites More sharing options...
0 Guest Posted September 25, 2009 Report Share Posted September 25, 2009 ok still confused but it looks impressive Look up "regular expressions". It is a way of searching through text for a particular pattern. The string: '[^a-zA-Z]([A-Za-z]([A-Za-z])[A-Za-z]{2}\\2[A-Za-z]{5})[^a-zA-Z]' basically tells the program to look for a 10 letter word with the second and fifth characters being the same. [^a-zA-Z] means a non-letter (the ^ symbol means none of the following) [A-Za-z] means a capital or non-capital letter adding parentheses around it makes it so you can reference it later which is what the \\2 does. It means look for whatever letter was matched in the second pair of parentheses encountered. the {2} and the {5} mean look for the previous thing 2 times or 5 times. Once the computer has found all the potential matches, you just need to perform the translation described in the post on each word and see if any match up with the encoded answer. Quote Link to comment Share on other sites More sharing options...
Question
superprismatic
A certain 10-letter word having the
second and fifth letters the same is
treated as follows: the first two
letters are multiplied together
(using the values A=1, B=2, ...,
Y=25, Z=0); then the next two letters
are similarly multiplied together and
the two products added (mod 26).
The sum is reconverted into a letter
using the same correspondence. The
same operations are performed on
letters 2 to 5 producing another
letter. This is continued until the
seventh letter is produced from the
last four letters of the word. The
letters so generated are, in order,
FPSLMMZ. What is the word?
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.