1
$\begingroup$

Consider the following code:

g = Table[Sign[StieltjesGamma[n]], {n, 0, 30}];
s = FindSequenceFunction[g];

The result is a certain DifferenceRoot object (too long to include here), which essentially solves the recurrence relation $$ a_{n+1}=a_n $$ with "initial conditions" $a_i=g_i$. In other words, the DifferenceRoot is actually storing the first 30 elements of g as initial conditions, and predicting the rest to be a constant sequence: $$ s_i=\begin{cases}g_i & i\in[1,30]\\ 1 & i>30\end{cases} $$

This is obviously cheating: you could do the same thing to any sequence, that is, store all the known elements as initial conditions to an arbitrary recurrence relation, and predict the rest using that recurrence relation. Such a prediction would be meaningless. Is this behaviour of FindSequenceFunction a bug?

Note that in this case there is no known closed-form expression for g, so s should be returned unevaluated. In fact, that's what I expected to get; the DifferenceRoot object was certainly a surprise. In any case, there is nothing special about the Stieltjes constants: the sequence g can be replaced with any random sequence of integers, such as

SeedRandom[1]
g = RandomChoice[{-1, 1}, 30];

which has the same behaviour: FindSequenceFunction returns a DifferenceRoot object that stores the elements of g as initial conditions to an (arbitrarily chosen?) recurrence relation.

$\endgroup$
8
  • $\begingroup$ I'm not sure what tags to use here. Please feel free to edit them. I do know I'm not supposed to add the bug one though... $\endgroup$ Commented Jan 30, 2018 at 17:40
  • $\begingroup$ why this should be a bug? In this way, and as you note, FindSequenceFunction can predict any element of the sequence, can't it? Or am I missing something ? $\endgroup$ Commented Jan 30, 2018 at 18:37
  • $\begingroup$ @JoséAntonioDíazNavas It doesn't "predict" anything. It just stores what you already know, and fails to predict the rest of the sequence. Note that the Stieltjes constants are not all positive for $i>30$, unlike what s suggests. $\endgroup$ Commented Jan 30, 2018 at 18:54
  • $\begingroup$ note you do not get such result for every random sequence. $\endgroup$
    – george2079
    Commented Jan 30, 2018 at 18:54
  • 2
    $\begingroup$ FindSequenceFunction makes no claim at being predictive. You may be right it is a useless result, but not a bug. $\endgroup$
    – george2079
    Commented Jan 30, 2018 at 18:56

0

Browse other questions tagged or ask your own question.