Ralf Hemmecke
unread,Nov 5, 2024, 11:01:41 AM11/5/24Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to fricas-devel
Hi Martin, hi Waldek,
I just stumpled over the behaviour below.
The result is not wrong in the case of algebraic numbers, but I wonder
why the resulting recurrence is not "normalized" in some way.
OK, one cannot simply take out the "gcd" of the coefficients, because
that wouldn´t work for AN without recognizing that the numbers in the
recurrence are actually integers.
Can you explain your design decision or is it just an oversight and
there is room for improvement?
Ralf
%%% (1) -> cq := [(1/2)^k for k in 0..20]
(1)
1 1 1 1 1 1 1 1 1 1 1 1 1 1
[1, -, -, -, --, --, --, ---, ---, ---, ----, ----, ----, ----, -----,
2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384
1 1 1 1 1 1
-----, -----, ------, ------, ------, -------]
32768 65536 131072 262144 524288 1048576
Type:
List(Fraction(Integer))
%%% (2) -> sq := guessRec(cq, functionName=='co).1
(2) [co(n): - 2 co(n + 1) + co(n) = 0, co(0) = 1]
Type:
Expression(Integer)
%%% (3) -> ca := [((1/2)::AN)^k for k in 0..20]
(3)
1 1 1 1 1 1 1 1 1 1 1 1 1 1
[1, -, -, -, --, --, --, ---, ---, ---, ----, ----, ----, ----, -----,
2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384
1 1 1 1 1 1
-----, -----, ------, ------, ------, -------]
32768 65536 131072 262144 524288 1048576
Type:
List(AlgebraicNumber)
%%% (4) -> sa := guessRec(ca, functionName=='co).1
(4)
[
co(n):
- 738578176637708424660750 co(n + 1) + 369289088318854212330375
co(n) = 0
,
co(0) = 1]
Type:
Expression(Integer)