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
Show commentsProblem Recent Solvers3034
Suggested Problems
-
First non-zero element in each column
793 Solvers
-
Getting the row and column location from a matrix
276 Solvers
-
Given a matrix, swap the 2nd & 3rd columns
869 Solvers
-
329 Solvers
-
There are 10 types of people in the world
841 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!