Question: Pattern matching in a sequence of digits


This problem arised in a math forum.

I would like to check wether the consecutive digits of a given positive integer (n) are in the first 100000 digits of Pi.

For example the given integer (n) = 1592653 and this is in 3,1415926535897.... so the result is true.

I also would like to use this pattern matching for checking the type of a variable in a procedure:

...end proc;

The procedure accepts n if n fullfils the condition above.

How to do it in Maple? How to define mytype?



Please Wait...