On Fri, Feb 07, 2025 at 12:21:01PM +0100, 'Ralf Hemmecke' via FriCAS - computer 
algebra system wrote:
> Dear Waldek,
> 
> can you explain how to extract the respective formulas from the return value
> of Martin's and your guessing package?
> 
> ====================
> %%% (1) -> guess([factorial(4*n)/factorial(n)^4 for n in 1..10])
> 
>                               3           2
>              n - 1   256 p    + 1152 p    + 1712 p   + 840
>              ++-++        10          10          10
>    (1)  [24   | |    -------------------------------------]
>               | |             3        2
>             p   = 0        p    + 6 p    + 12 p   + 8
>              10             10       10        10
> ====================
> 
> (1) How can I manipulate the expression from (1), i.e.
>     decompose it into its parts (operator, argument, numer, denom)?

res := %
k1 := first(kernels(first(res)))
al := argument(k1)

               3          2
         256 %B  + 1152 %B  + 1712 %B + 840
   (4)  [----------------------------------, %B, p  , 0, n - 1]
                 3       2                        10
               %B  + 6 %B  + 12 %B + 8
                                              Type: List(Expression(Integer))

Note that above operator is '%defprod', so you just use normal
ways to decompose expressions (that is kernels, operator, argument).

> (2) How do I get the rational function under the product?

eval(al(1), al(2), al(3))
                                   
gives you expression, you can coerce it to a rational function.

> (3) Can I give an option to guess so that the running variable
>     is returned as k instead of p10?

It seems that you need to 'eval' to get different variable name.
Note that 'guess' can return nested sums or products, so there
may be several running variables.

> (4) Is there a demo somewhere or a detailed descriptions also
>     for the other guessing functions?

There is 'mantepse.input', documentation in HyperDoc and an
article in Journal of Symbolic Computation.  There are wiki pages:

http://wiki.fricas.org/GuessingFormulasForSequences
http://wiki.fricas.org/SandBoxGuessingSequence

There are messages in the mailing list, yours from 8 Oct 2020,
Martin's from 13 Jan 2009 and 24 Aug 2022 and some other.

You also asked about range of product/summation index.  AFAICS
this is fixed.  This range is related to range of indices of
the sequence so when changing we probably should change both
(but ATM neither is changable).

-- 
                              Waldek Hebisch

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/fricas-devel/Z6fXceZ6a3SqzdEi%40fricas.org.

Reply via email to