As someone who attended high school in the 1960s, I'm still impressed by the mathematical feats that can nowadays be accomplished in seconds and that would have been impossible in that decade. Take for instance, this sequence from the OEIS:
A258166 | Indices of the start of 10 successive distinct digits in the decimal expansion of e (2.718281828...). |
1730, 2031, 2032, 3682, 4655, 5445, 5836, 9756, 10607, 11496, 11497, 11576, 17724, 17951, 18935, 18936, 20948, 21488, 21489, 22519, 26310, ...
I'm going to use SageMathCell to accomplish the task, using nothing more than an Internet connection and a web browser. Firstly, let's state in general terms what needs to be done:
begin
generate the decimal expansion of e up to a certain point
generate a list of all permutations of the digits 1234567890
check through successive blocks of ten in the decimal expansion of e
record initial position of any block that is in the list of permutations
end
Fortunately, SageMathCell will be able to handle all of these tasks. To generate the decimal expansion of e, we'll use:
str(e.n(digits=26320)) --> 2.71828182845904523536...
Of course, it's not necessary to view this expansion. It's sufficient to let D = str(e.n(digits=26320)) and then the digits are stored in active memory for later use by the program. Remember we need to go ten positions past 26310 so that's the reason for the 26320 limit.
Now what about all the permutations of the digits 1234567890. There are 10! = 3,628,800 of them which is quite a lot. To find the permutations, it's necessary to separate 1234567890 into its separate digits and then shuffle them in every possible way:
1234567890.digits() --> [0, 9, 8, 7, 6, 5, 4, 3, 2, 1]
For programming purposes, I'll let ID = 1234567890.digits()
Permutations(ID) --> lists all 10! arrangements
It's then just a question of picking successive groups of digits in the decimal expansion of e and seeing if they match any of the 3,628,800 permutations. For example, the first group of ten digits would be:
[7, 1, 8, 2, 8, 1, 8, 2, 8, 4] which isn't a match
The next group of ten digits is:
[1, 8, 2, 8, 1, 8, 2, 8, 4, 5] which again isn't a match
The SageMath program will continue creating these groups of ten and trying to find a match. Figure 1 shows the actual code together with a permalink:
Figure 1 |
1730, 2031, 2032, 3682, 4655, 5445, 5836, 9756, 10607, 11496, 11497, 11576, 17724, 17951, 18935, 18936, 20948, 21488, 21489, 22519, 26310, 26311, ...
No comments:
Post a Comment