Neve,

to save you some time... see attachement.

BTW, look at the first 4 values in the result below.
Unfortunately, I do not see how one can extract from the result from
which point on it is valid. In fact, I find it a bit strange that it
doesn't agree at the beginning, but seemingly Martin Rubey and Waldek
Hebisch had their reasons or I do not understand why for f(0),...,f(3)
we just get 0*f(n)+0 = 0 from the guessing result.

Ralf

(1) -> l := [44, 178, 412, 746, 1168, 1669, 2260, 2941, 3712, 4573,
5524, 6565]

   (1)  [44, 178, 412, 746, 1168, 1669, 2260, 2941, 3712, 4573, 5524, 6565]
                                                  Type:
List(PositiveInteger)
(2) -> Z ==> Integer
                                                                   Type:
Void
(3) -> E ==> Expression Z
                                                                   Type:
Void
(4) -> K ==> Kernel E
                                                                   Type:
Void
(5) -> P ==> Polynomial Z
                                                                   Type:
Void
(6) -> e1 := guess(l).1

   (6)
   [
     f(n):
               4      3       2                  6        5       4        3
           (- n  + 6 n  - 11 n  + 6 n)f(n) + 45 n  - 174 n  - 17 n  + 402 n
         +
                2
           128 n  - 384 n
       =
         0
     ]
                                                    Type:
Expression(Integer)
(7) -> e2 := getEq(e1)$RecurrenceOperator(Z, E)

   (7)
         4      3       2                  6        5       4        3
      2
     (- n  + 6 n  - 11 n  + 6 n)f(n) + 45 n  - 174 n  - 17 n  + 402 n  +
128 n
   +
     - 384 n
                                                    Type:
Expression(Integer)
(8) -> k2 := mainKernel(e2)::K

   (8)  f(n)
                                            Type:
Kernel(Expression(Integer))
(9) -> e3 := k2::E

   (9)  f(n)
                                                    Type:
Expression(Integer)
(10) -> e4 := eval(e2,e3,0)

             6        5       4        3        2
   (10)  45 n  - 174 n  - 17 n  + 402 n  + 128 n  - 384 n
                                                    Type:
Expression(Integer)
(11) -> pol1 := e4::P

             6        5       4        3        2
   (11)  45 n  - 174 n  - 17 n  + 402 n  + 128 n  - 384 n
                                                    Type:
Polynomial(Integer)
(12) -> e5 := (e2-e4)/e3

            4      3       2
   (12)  - n  + 6 n  - 11 n  + 6 n
                                                    Type:
Expression(Integer)
(13) -> pol2 := e5::P

            4      3       2
   (13)  - n  + 6 n  - 11 n  + 6 n
                                                    Type:
Polynomial(Integer)
(14) -> factor pol1

                                    2
   (14)  (n - 3)(n - 2)(n - 1)n(45 n  + 96 n + 64)
                                          Type:
Factored(Polynomial(Integer))
(15) -> factor pol2

   (15)  - (n - 3)(n - 2)(n - 1)n
                                          Type:
Factored(Polynomial(Integer))
(16) -> rat:=-pol1/pol2

             2
   (16)  45 n  + 96 n + 64
                                          Type:
Fraction(Polynomial(Integer))
(17) -> [eval(rat,n=i) for i in 0..12]

   (17)
   [64, 205, 436, 757, 1168, 1669, 2260, 2941, 3712, 4573, 5524, 6565, 7696]
                                    Type:
List(Fraction(Polynomial(Integer)))

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/22379b73-cae1-53a5-c47d-8c21fed79111%40hemmecke.org.
--)clear complete
l := [44, 178, 412, 746, 1168, 1669, 2260, 2941, 3712, 4573, 5524, 6565]
Z ==> Integer
E ==> Expression Z
K ==> Kernel E
P ==> Polynomial Z

e1 := guess(l).1
e2 := getEq(e1)$RecurrenceOperator(Z, E)
k2 := mainKernel(e2)::K
e3 := k2::E
e4 := eval(e2,e3,0)
pol1 := e4::P
e5 := (e2-e4)/e3
pol2 := e5::P
factor pol1
factor pol2
rat:=-pol1/pol2
[eval(rat,n=i) for i in 0..12]

Reply via email to