Inspired by a student who was asked the typical question of
What is the missing number in the sequence
8, 15, 25, 38, ??, 73
I thought: Well, this type of question is silly; if the student knows about OEIS and it exists there, then there is no challenge and if it does not appear there, then there is a chance that the question is too hard or too broad for such low-level student!
What a silly teacher I thought, as I found the 54 that their teacher was probably looking for, using the generator $3/2\,{n}^{2}+5/2\,n+4 $.
Now, as we all know, such sequence is bound to not be unique. An example, I like to use is to consider the function
$$ \frac{(1-n)(2-n)(3-n)(4-n)(5-n)(6-n)(7-n)(8-n)(9-n)( y-n)}{(n-1)!} +n $$ This silly function returns
\begin{array}{|c|c|c|c|c|c|c|c|c|c|c|c|} n&1&2&3&4 & 5& 6& 7& 8& 9& 10& 11& 12 \\\hline \text{out} &1& 2& 3& 4& 5& 6& 7& 8& 9& y& y& 6+ y/2 \end{array}
for $n = 1,\ldots, 12$ and any chosen $y$(!)
Now, in a similar fashion, can you create a function or algorithm that, for an input $n$ satisfies the below table for some $y$ so we can help our beloved student show off to their teacher?
\begin{array}{|c|c|c|c|} n& 1& 2 & 3 & 4 & 5 &6 \\\hline \text{out} & 8& 15 & 25& 38& y & 73 \end{array}