6
$\begingroup$

The help page states that Method is an option to use with FindSequenceFunction, but I don't find any further information. (There is also a FunctionSpace option--for which I know that "Polynomial" is one possibility. But the full list is not easy, it seems, to locate. I presume that if a FunctionSpace option is not specified, all possibilities are explored.)

$\endgroup$
  • $\begingroup$ I managed to discover some valid option values, although not for Method. Can you help in figuring out what each option value does? If yes, feel free to post another answer with a short explanation. $\endgroup$ – Szabolcs Nov 9 '16 at 10:42
  • $\begingroup$ I'll a little uncertain whether the remark that "I managed to discover..." (which I just noticed for the first time ) came before or after the lengthy "spelunking"l answer. So, i'm not sure whether further action on my part is being requested. Of course, I'm willing to help in gaining any further insight into the FindSequenceFunction command. $\endgroup$ – Paul B. Slater Nov 10 '16 at 13:20
7
$\begingroup$

This is not a complete answer. It is a long comment about what I found when I looked at the inspectable source code of this function using various spelunking tools (e.g.. Spelunking package, GeneralUtilities`PrinteDefinitions, etc.).

Method parsing looks unusual

First, I wonder if parsing for the Method option is buggy. First it does this internally:

$UserMethod = Method /. Flatten[{opts}] /. Options[FindSequenceFunction];

Then the whole function has a condition (/;) on evaluation which includes this:

($UserMethod===Automatic||OptionQ[$UserMethod])

To translate what this means: the only accepted Method specifications are Method -> Automatic or something of the form Method -> (opt -> value). This double Rule construct could be what was meant, but is definitely suspect.

Further evidence:

FindSequenceFunction[{1, 1, 2, 3, 5, 8, 13}, n, Method -> "foo"]
(* FindSequenceFunction[{1, 1, 2, 3, 5, 8, 13}, n, Method -> "foo"] *)

FindSequenceFunction[{1, 1, 2, 3, 5, 8, 13}, n, Method -> (foo -> "foo")]
(* Fibonacci[n] *)

I wasn't able to dig deep enough to discover concrete accepted values for Method

Values for FunctionSpace

Automatic and All are equivalent, I think.

Other than these, try any of the following or a list of them:

"PeriodicSequence"
"Polynomial"
"RationalFunction"
"HypergeometricTerm"
"ConstantRecursive"
"HolonomicSequence"
"QHolonomicSequence"

Values for TransformationFunctions

A list of some of these:

"Ratio", "Difference", "BinomialTransform", 
"BinomialInverseTransform", "BoustrophedonTransform", 
"BoustrophedonInverseTransform", "StirlingTransform", 
"StirlingInverseTransform", "MoebiusTransform", 
"MoebiusInverseTransform", "Convolution", "ExponentialConvolution"

You can also use All, which means all of them, or Automatic, which means {"Ratio", "Difference"}.


Warning: All this information is obtained by looking naively at the implementation. These are just option values which I think are valid. I am not certain, I may have made a mistake. I don't know what the effect of these values are. Since they are undocumented, I don't know if they are meant to be used at all. Some may be experimental or unimplemented. Don't be surprised if Mathematica does unexpected things when you use them.

$\endgroup$
  • 1
    $\begingroup$ Wow! What a conscientious "answer". I'll certainly give it an up vote. It seems that the "bottom line" for a user like me, is just to leave the options unspecified--which has been my practice over the years. I always thought of this command as a (rather amazing) "black box" (yielding, for example--after much further massaging, Fig. 3 in arxiv.org/pdf/1301.6617.pdf). Szabolics has "opened the box" considerably. $\endgroup$ – Paul B. Slater Nov 9 '16 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.