Suppose A=1, B=2, C=3, ..., Z=26. Then, ETUDE is an interesting word. It has 5 letters, it starts and ends with the 5th letter of the alphabet, and E+T+U+D+E=5+20+21+4+5=55. What other words both start and end with the Xth letter of the alphabet and add up to XX, where X is the number of letters in the word and XX is X concatenated with X? (For ETUDE, X=5.)
My word list is less extensive than Dej Mar's:
etude 55
exile 55
gasting 77
gawping 77
gorging 77
griming 77
hyacinth 88
OPEN "\words\words.txt" FOR INPUT AS #1
DO
LINE INPUT #1, w$
w$ = LCASE$(w$)
IF LEFT$(w$, 1) = RIGHT$(w$, 1) THEN
l = LEN(w$)
totV = 0
FOR i = 1 TO l
v = INSTR("abcdefghijklmnopqrstuvwxyz", MID$(w$, i, 1))
totV = totV + v
IF i = 1 AND v <> l THEN totV = 0: EXIT FOR
NEXT
IF totV > 0 THEN
v1 = totV \ 10
v2 = totV MOD 10
IF v1 = l AND v2 = l THEN
PRINT w$, totV
END IF
END IF
END IF
LOOP UNTIL EOF(1)
|
Posted by Charlie
on 2011-11-04 17:12:17 |