Hello fellow dopers.
For fun ( and a free cookie ), I am trying to solve a math problem. Before any further comments, here is the problem in full:
“Show that the seven consecutive digits 2, 3, 4, 5, 6, 7, 8 can be arranged in 5040 different orders giving 5040 distinct seven digit integers, but none of these is a perfect square.”
First brainstorm has me putting the numbers 2 3 4 5 6 7 8 in a permutation. Then after the perm, I would filter the results to eliminate the non-perfect square answers.
This, if I correctly assume, is the easy answer to the problem – not having to solve long hand, which I’m not sure how to attempt and if anybody would be willing to help with that, I would be willing to share my cookie.
Anyways, back to my original plan…
I use Mathematica, which is basically a calculator on crack for your computer. I am attempting the problem via my original method, and I start with the perm.
“Permutations[{2, 3, 4, 5, 6, 7, 8}]” gives me all the possible resulting combinations. Here is where I run into the wall. The answers are in this format "{2,3,4,5,6,8,7} etc., etc. What I need to do is pull them out of this format and make them whole integers and then run a filter on the resulting integers to eliminate all possible perfect suqares.
Any genius dopers with experience in Mathematica that can help me out?
Thanks in advance.
Yesterdog