This is book number 87 in the The Boxcar Children Mysteries series.
When their friend Sam gets a letter full of riddles from an eccentric millionaire, the Aldens are eager to help him crack the code. If Sam can solve the puzzle, he will inherit the millionaire's money! But Sam isn't the only one in town to receive a letter - and whoever solves the mystery first will win the prize!