Problem 42. Find the alphabetic word product
Solution Stats
Problem Comments
-
9 Comments
For the bonus question (on OSX):
words= textread('/usr/share/dict/words','%s');
for k=1:numel(words)
wordprod(k) = word_product(words{k});
end
[~,i] = min(abs(wordprod-1000000));
words{i}
wordprod(i)
% curing with word product of 1000188
For the bonus question, we can rule out any number that has a prime factor greater than 26 (z). The product found by Jason Friedman is the first number greater than 10^6 that does not have such a prime factor. The product 999856 is the largest number less than 10^6 to be part of a possible solution.
I like playing with strings and ASCII table ;)
Everett appears to miss the fact that 1000000 has no prime factors above 26, and Jason's dictionary doesn't seem to include obsolete words. 'tetty' scores a perfect 1000000.
Well, if you happen to know someone named 'BettyJ', thus a first name of Betty, last initial J, this works: word_product('BettyJ').
Could you send me the answer?
I had benn worked for 1 week but Icouldnt find answer. İf anyone solves Please send answer. Really I need it.
Nice problem
Can you give me a hint on how to program the bonus question? I used factor but that is not a good way.
If we can include multiple words in our bonus answer, the word "tea" 3 times scores perfect. n = 'teateatea'
Solution Comments
-
1 Comment
easy ;)
-
2 Comments
'curing' returns 1000188.
Closest 10 words are 'curing', 'Nicaragua', 'comers', 'Moors', 'rooms', 'banquet', 'Arkansas', 'sulks', 'alkaline' and 'Canaveral'.
-
1 Comment
Words that make 1000,000, tetty and typey apparently, :)
-
1 Comment
Very clever way of converting to a number
-
1 Comment
closest I can get is 'curing', 188 away.
-
1 Comment
'god' equals 420.
-
1 Comment
large but working ;-)
-
2 Comments
'j' corresponds to 10 according to the code above so, the word that gives exaclty 1E+6 is 'jjjjjj'
% word_product('jjjjjj')=1E+6
I don't think that 'jjjjjj' is really a word...
Problem Recent Solvers2911
Suggested Problems
-
253 Solvers
-
991 Solvers
-
First non-zero element in each column
769 Solvers
-
1251 Solvers
-
Relative ratio of "1" in binary number
971 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!